Running a trading bot from home: getting a stable IP for exchange APIs
The bot runs on the PC in the corner. It's been fine for weeks. Then the power goes out, the router restarts, and every order fails because the exchange no longer recognises your IP.
Running a trading bot from home is completely workable. The weak spot isn't your code or your PC. It's the IP address. Exchanges increasingly want API keys bound to an IP, and a home connection doesn't keep one. You can fix that without moving the bot to a VPS: keep the bot at home, and send its exchange traffic out through a fixed address. A static IP for exchange API keys does exactly that. Here's the whole setup, including the other things that trip up home bots.
Why the home IP is the problem
A home bot hits three things that a server doesn't.
Power cuts and router restarts. Most broadband in India gives you a dynamic address, and a restart can bring a new one. In a lot of places that's a weekly event, sometimes daily.
CGNAT. Many connections share a public address with other customers. Check your router's WAN address. If it falls between 100.64.0.0 and 100.127.255.255, you're behind carrier-grade NAT, and the IP you'd bind your key to isn't yours alone.
IPv4 and IPv6 at the same time. If your connection has both, your bot may reach some exchanges over IPv6 and others over IPv4. Bind the key to one and calls over the other fail. Delta Exchange returns ip_not_whitelisted_for_api_key when that happens, according to its API docs.
Meanwhile the exchange side keeps getting stricter. On Binance, keys without an IP restriction are limited to reading data. Delta Exchange India won't give trading permission without whitelisted IPs. So "just leave the key unrestricted" stops being an option.
Check what your bot looks like from outside
On the PC that runs the bot:
curl -4 https://ifconfig.co
curl -6 https://ifconfig.co
Write both down, then restart your router and run them again. If either changed, the IP restriction on your key will break the same way the next time the power goes.
It also helps to know which exchanges answer on which protocol. In our test from Mumbai on 29 October 2026, Binance, Bybit and WazirX didn't respond over IPv6 at all, while Delta Exchange, OKX and CoinDCX did. Your bot's calls to Binance will go over IPv4 whatever you do.
Three ways to keep one IP
Ask your ISP for a static IP
Possible, but it usually means a business plan, and it ties the bot to that connection. If your ISP has an outage and you switch to a phone hotspot, the IP changes anyway.
Move the bot to a VPS
A VPS with its own IP is the classic answer. It works, and it takes the power cuts out of the picture too. You do give up the home machine you already have, pay for the server, and keep it patched. If you move providers, you rebind every key.
Keep the bot at home, route the exchange traffic through a static IP
This is what TrueIP does. You get a dedicated IPv4 in Mumbai with its own proxy login. The bot sends its exchange calls through it, so every key sees the same address whatever your router does. If you switch to a hotspot during an outage, the exchange still sees the same IP. In ccxt it's two lines:
ex.httpsProxy = "http://USER:PASS@HOST:PORT" # REST
ex.wssProxy = "http://USER:PASS@HOST:PORT" # websockets
Set both. The REST setting doesn't cover websocket streams, so without the second line your price feed still leaves from your home connection. The traffic stays TLS encrypted, so we see the exchange's hostname, not your keys or orders.
The other home-bot problems
A fixed IP solves the whitelist problem, not everything else. A few things worth sorting out while you're at it:
- Power. A small UPS for the PC and the router means a short cut doesn't stop the bot. If the router dies but the PC doesn't, the bot just waits for the network.
- Sleep and updates. Turn off sleep on the machine, and set Windows to restart for updates outside the hours you trade.
- Restarts. Run the bot as a service, or under a process manager, so it starts again on its own after a reboot.
- Reconnects. Make sure the bot reconnects websockets and retries REST calls after a network drop, instead of crashing on the first error.
- Alerts. Have it message you on Telegram or email when it can't reach the exchange for more than a few minutes. You don't want to find out from your P&L.
Binding the key
Once the IP is fixed, bind each key to it in the exchange's API settings, and give the key only the permissions the bot needs. For most bots that's reading and trading, never withdrawals. One key per bot means you can revoke one without stopping the others.
And use the setup for exchanges and accounts you're allowed to use. A fixed IP is for binding your own keys, not for getting around anyone's rules.
Quick checklist
- Run
curl -4andcurl -6againstifconfig.co, restart the router, and check again. - Look for a
100.64to100.127WAN address, which means CGNAT. - Pick a fixed address: an ISP static IP, a VPS, or a static IP for your exchange API keys.
- Set both the REST and websocket proxy if you use ccxt.
- Add a UPS, turn off sleep, and make the bot restart and reconnect on its own.
Get your dedicated static IP
IPv6 ₹50 a month, IPv4 ₹200 a month, plus GST. Live in minutes, whitelisted once.