A trading bot talks to your exchange through an API key. The key decides what the bot is allowed to do, so most of the safety work happens on the exchange’s API page, before the bot is involved at all. This guide covers the settings that matter and how the AvalonQuant grid kit uses the key.
Short version: create a key with read and trade permission only. Never enable withdrawals. Add an IP restriction if your internet address doesn’t change. Keep the secret somewhere only you can read, and delete the key the day you stop using the bot.
What an API key is made of
- API key (sometimes “access key”): identifies the key. Not secret on its own, but don’t post it.
- Secret: signs each request. The exchange shows it once, when you create the key. If you lose it, delete the key and make a new one.
- Passphrase (OKX and Bitget): a password you choose when you create the key. The exchange doesn’t show it again, so write it down with the secret.
Step 1: create a key for this bot only
Every exchange puts this under its account menu, usually called API Management. Give each bot its own key, named so you’ll recognise it later (for example avalonquant-grid). One key per app means you can revoke one without breaking the others, and the exchange’s API log shows which app did what.
Exchanges ask for two-factor confirmation when you create a key. If you haven’t turned on 2FA yet, do that first; it protects the account the key belongs to.
Step 2: set the permissions
| Permission | For the grid kit | Why |
|---|---|---|
| Read | On | Balances, open orders and your account UID. |
| Spot trading | On for Crypto Grid | Places and cancels BTC/USDT spot orders. |
| Futures / derivatives trading | On only if you’ll run Crypto Grid (Futures) | Leave it off if you only use spot. Fewer permissions, less exposure. |
| Withdraw / transfer | Off, always | The app never needs it. A leaked key without withdrawal rights can place bad trades but can’t move your funds off the exchange. |
The kit’s terms say the same thing: trading permission only, never withdrawal permission. If an exchange page tries to bundle withdrawals into a preset (“full access”), switch to the custom setting and untick it.
Step 3: decide on an IP restriction
An IP restriction (also called an IP whitelist or allowlist) tells the exchange to accept the key only from the internet addresses you list. A stolen key is then useless from anywhere else. It’s the strongest single setting after turning withdrawals off.
There’s a catch for home setups. The grid kit runs on your own computer, so the requests come from your home or office internet address, and many home connections get a new address from time to time. When that happens, the exchange starts rejecting the key and the app reports it:
“[Exchange] rejected the request — check that your saved API key/secret (and passphrase, if it needs one) are correct and still active.”
Pick one of these:
- Your address is fixed (a static IP from your provider): add it. Search “what is my IP” from the same computer to see it.
- Your address changes: either add the new address on the exchange each time it changes, or leave the key unrestricted, keep withdrawals off, and check the exchange’s API page for an expiry date. Some exchanges limit how long a key without an IP restriction stays valid.
A VPN changes your address too. If you use one, the address the exchange sees is the VPN’s, not your home’s.
Step 4: save the key in the app
In the grid kit, keys go under Accounts → Your crypto exchanges, not in a file:
- Pick the exchange: Binance, Bybit, Bitget, OKX or Gate.
- Paste the API Key and the Secret. For OKX and Bitget, a Passphrase field appears as well.
- Click Save keys.
Before saving, the app makes one read-only request to the exchange: it fetches your balance. If that works you’ll see “Connected. Account reachable, N currency balance(s) visible.” If it doesn’t, nothing is saved and the message starts with “Not saved:” followed by the exchange’s own reason. A wrong secret, a missing passphrase and an IP restriction that doesn’t include your address are the usual causes.
Where the key lives afterwards
- Keys are stored in the app’s folder on your computer, in its local database. The secret and passphrase are encrypted with a key file that only your user account can read.
- The app sends your keys only to the exchange. They are never sent to avalonquant.com.
- Anyone who can use your computer can use the app, so lock the screen and keep the computer up to date. That’s the part encryption on disk can’t solve.
A few habits worth keeping
- Use a sub-account. Most exchanges let you open sub-accounts. Moving only the bot’s money there caps what any mistake can touch and keeps the bot’s numbers separate from your other trades. If you do this, create the key on the sub-account.
- Check the API log now and then. Most exchanges list recent API activity or key usage. Orders you don’t recognise are a reason to delete the key at once.
- Delete keys you no longer use. Clearing them in the app (Clear this exchange) removes them from your computer, but the key still works on the exchange until you delete it there.
Next steps
With a key saved, give a strategy some practice capital and let it run in Paper mode first. Our paper-trading checklist covers what to watch. If you haven’t installed the kit yet, start with the install guide.
Educational material. Test with small amounts first. We are not liable for losses or software errors.
📊 A new strategy backtested every day — the numbers, the drawdown, and what breaks it.
▶ Subscribe to Avalon Quant⚠️ Not financial advice. This guide is for educational purposes only; trading can lose money, and past results do not guarantee future ones.


