How to connect a trading bot to your exchange safely
A trading bot needs an API key to place orders for you. Set up carelessly, the same key can let a thief empty your account. Set up well, the worst a leaked key can do is place trades. Here is how to do it well, on any exchange.
1. Make a key that can trade, and nothing else
Every major futures exchange lets you choose what a key may do. Tick futures trading (or "contract" or "derivatives" trading) and leave everything else off. Above all, withdrawals and transfers must be off. A bot never needs to move money out of your account, so any bot or service that asks for withdrawal rights is a red flag.
2. Lock the key to one internet address
Most exchanges let you add an IP list to a key, so it only works from the addresses you name. If the bot runs on your computer, use your home internet address; if it runs on a server, use the server's. A key copied by someone else is then useless from anywhere else. Some exchanges also expire keys without an IP list after a few weeks or months, so adding one keeps the bot running.
3. Use a sub-account for the bot
Many exchanges offer sub-accounts. Move only the money you want the bot to trade into one, and make the key for that sub-account. Your other funds stay out of reach, and it's easy to see exactly what the bot has done.
4. Know where the key is stored
Cloud bots keep your key on their servers, so you are trusting their security. A bot that runs on your own computer, or on a server in your own cloud account, keeps the key with you. Either can be fine; just know which one you're choosing.
5. Keep the account itself locked
- Turn on two-step sign-in with an authenticator app, not text messages.
- Set an anti-phishing code if the exchange offers one, and only sign in from the exchange's real address.
- If a key may have leaked, delete it on the exchange. That stops it at once.
How Anvil Quant does it
The Anvil Quant app runs on your computer (or your own server). It asks for a trade-only key, shows the internet address to put on the key's IP list, and keeps the key there: it is never sent to us. The setup guide has the exact clicks for Bybit, OKX, Binance Futures, Bitget, MEXC, Gate, KuCoin and Kraken.
Try Anvil Quant free for 2 weeks
The app follows every live trade in practice mode, with pretend money, on real prices. No payment needed. Leveraged futures can lose money fast, and what two weeks show depends on the market in those two weeks.