DEV Community

shakti tiwari
shakti tiwari

Posted on

SEBI 2026 Static IP Mandate: Retail Trader Compliance Guide

What changed on April 1, 2026 — and how to stay compliant without burning cash

SEBI’s April 2026 deadline for static IP whitelisting in algo trading isn’t a suggestion. Brokers are enforcing it. Dhan locks IPs for 7 days. Zerodha blocks non-whitelisted calls. Upstox rejects orders silently.

If you’re a retail trader running bots from home, this guide is your survival kit.

The regulation

SEBI circular March 2025: All algo orders must originate from a registered static IP. Purpose: traceability and audit trail.

Enforcement date: April 1, 2026

Penalty: API access revocation, account freeze

Which brokers enforce what

Broker Enforcement Level Max Whitelisted IPs Static IP Options
Dhan Strict 5 ISP, VPS, Tunnel
Zerodha Moderate 3 ISP only
Upstox Moderate 5 ISP, VPS
Angel One Strict 3 ISP only

How to verify your IP type

Mac (Terminal):

# Quick check
curl https://api.ipify.org

# 5 checks, 10 seconds apart
for i in {1..5}; do sleep 10; curl -s https://api.ipify.org; done
Enter fullscreen mode Exit fullscreen mode

Windows (CMD / PowerShell):

curl https://api.ipify.org
1..5 | ForEach-Object { Start-Sleep -Seconds 10; curl -s https://api.ipify.org }
Enter fullscreen mode Exit fullscreen mode

Linux / Termux:

curl https://api.ipify.org
watch -n 10 curl -s https://api.ipify.org
Enter fullscreen mode Exit fullscreen mode

If IPs differ → dynamic.

Solutions ranked by cost and reliability

1. ISP Static IP (Most Reliable)

Airtel Xstream Fiber:

  • Call 1501 or 1800-103-4444
  • Request: “Static IP for algo trading, SEBI compliance”
  • Cost: ₹300-600/month add-on
  • Setup: 2-3 days
  • Reliability: 99.9%

JioFiber:

  • Call 198 or 700
  • Request: “Static IP for trading”
  • Cost: ₹200-500/month add-on
  • Caveat: CGNAT in some areas — verify public IP
  • Reliability: 85% (inconsistent)

After getting static IP:

# Verify it’s truly static
curl https://api.ipify.org  # Run daily for 1 week
# Should return same IP every time
Enter fullscreen mode Exit fullscreen mode

Whitelist in Dhan:

  1. https://api.dhan.co → API Settings
  2. IP Whitelist → Add your static IP
  3. Save — locked for 7 days

2. VPS Proxy (Cheapest Permanent)

Hetzner CX11 (€3/month ≈ ₹260):

# After creating VPS at hetzner.cloud
ssh root@YOUR_VPS_IP

# Install squid proxy
apt update && apt install squid apache2-utils -y

# Add auth
htpasswd -c /etc/squid/passwd trader

# Configure
cat > /etc/squid/squid.conf << 'EOF'
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
http_port 3128
EOF

systemctl restart squid
systemctl enable squid
Enter fullscreen mode Exit fullscreen mode

Configure backend:

# Mac/Linux/Termux
export HTTPS_PROXY=http://trader:password@VPS_IP:3128

# Windows CMD
set HTTPS_PROXY=http://trader:password@VPS_IP:3128
Enter fullscreen mode Exit fullscreen mode

Hostinger VPS (₹199/month, Indian datacenter):

  • Lower latency to Dhan servers
  • 2GB RAM, 2 vCPU
  • Easier payment (UPI/cards)

3. Cloudflare Tunnel (Free, Temporary)

As covered in Dhan API Static IP Fix, this works but isn’t 100% reliable for production.

4. Dhan MCP (Free, Manual Trading Only)

Dhan’s Model Context Proxy handles IP internally. No whitelisting needed.

Setup:

  1. Enable MCP in Dhan developer portal
  2. Connect via Claude Desktop
  3. Trade via natural language

Limitation: Can’t automate XGBoost models through MCP.

Common errors and solutions

Error 100008: Unauthorized

{"stCode": 100008, "errMsg": "unauthorized"}
Enter fullscreen mode Exit fullscreen mode

Fix: IP not whitelisted or token expired. Check IP, regenerate token.

Error 1037: Session IP Mismatch

{"stCode": 1037, "errMsg": "session ip doesnt match with request ip"}
Enter fullscreen mode Exit fullscreen mode

Fix: IP changed after session started. Wait 7-day lock to expire.

Error 905: Missing Required Fields

{"errorType": "Input_Exception", "errorCode": "DH-905"}
Enter fullscreen mode Exit fullscreen mode

Fix: Token format invalid. Regenerate in Dhan portal.

Weekly maintenance checklist

# Check IP hasn't changed
echo "$(date): $(curl -s https://api.ipify.org)" >> ~/ip_check.log

# Compare with last known
if [ "$(tail -1 ~/ip_check.log | awk '{print $2}')" != "$(tail -2 ~/ip_check.log | head -1 | awk '{print $2}')" ]; then
    echo "IP CHANGED! Update Dhan immediately."
fi
Enter fullscreen mode Exit fullscreen mode

Cost comparison

Solution Monthly Setup Time Reliability
ISP Static IP ₹200-600 2-3 days 99.9%
VPS Proxy ₹200-300 1-2 hours 99.5%
Cloudflare Tunnel Free 30 mins 80%
Dhan MCP Free 10 mins 100% (manual)

My recommendation

Short term (this month):

  1. Test current IP → if dynamic, call ISP
  2. Set up auto-detect script
  3. Use Cloudflare Tunnel as temporary bridge

Long term (next quarter):

  1. Get ISP static IP (permanent)
  2. VPS proxy as backup
  3. Monitor both with health checks

TL;DR

  1. Test your IP nowcurl https://api.ipify.org
  2. Call ISP — request static IP for trading
  3. Whitelist in Dhan — add IP, remember 7-day lock
  4. Have backup — VPS or tunnel
  5. Monitor weekly — auto-detect script saves logs

Don’t wait for April 2026. Get compliant now.


Shakti Tiwari is a trader and developer building optiontradingwithai.in. He co-directs CodeVisser and authored books on trading psychology. Find him on Dev.to as @shaktitiwari715-ai.

Top comments (0)