Skip to main content

Self-hosted arbitrage bot: your API keys stay on your own server

ZML Trade is a self-hosted cross-exchange arbitrage bot: it runs on your own cloud server, stores your API keys there encrypted and lets you bind them to that server’s IP.

ZML Trade is a self-hosted cross-exchange arbitrage bot, and every feature is free forever. It runs on a cloud server you manage yourself and stores your API keys there encrypted; keys for centralized exchanges can also be bound to the server’s IP. It runs your arbitrage strategy automatically: it opens when the open spread reaches your open trigger and closes when the close spread comes back to your close trigger, opening a hedged position across two markets.

Your API keys are stored on your server

Orders and transfers go straight from Trade on that server to the exchange, using your keys, and ZML’s servers take no part; the Secret Key is used only on that server, to sign requests. The API Key, Secret Key and Passphrase you enter are encrypted per account and stored there.

When you create the API key on the exchange, read and trade permissions are all it needs. When you save the account, Trade tells you if the key has withdrawal permission turned on, so you can go back and turn it off; Trade has no withdrawal feature lists the exchanges where it can check.

API keys can be bound to your server’s IP

API keys on centralized exchanges can carry an IP allowlist. Add this server’s egress IP to it and the key works only from this server. On most exchanges the IP allowlist is optional and takes effect only once you fill it in; on-chain exchanges such as Hyperliquid and Lighter have none.

Every public IP on the server can be an egress IP, so per-IP exchange limits go further; choose which ones each account uses and add them to the exchange’s IP allowlist. See Use several public IPs (Alibaba Cloud ECS, AWS EC2).

Only versions signed by ZML get installed

Before installing and before every update, Trade checks the package’s signature with ZML’s public key, and nothing is installed if the check fails; the install script is public: https://api.zmarketlab.com/install.sh. You can update whenever a new version is out, and if you don’t, it installs automatically within 7 days.

Runs on its own

Once installed it keeps running, with no expiry date. If ZML’s services can’t be reached it keeps trading, and your combos, trade records and settings stay on your server.

Trade reports its running status and errors to ZML; What Trade sends to ZML lists every item.

What it does for you

  • One order in each of two markets: the two sides can be on different exchanges and accounts, and the two orders open and close as one combo.

  • The lagging side catches up: whatever fills first on one side, the other side follows with the same amount; see Cross-exchange hedging: how to avoid getting filled on only one side.

  • Spot, cross margin and perpetuals: spot-futures, reverse spot-futures and futures-futures arbitrage are all supported.

  • Manage all your accounts in one place: add as many accounts as you need and use them for different strategies. Assets, balances and positions for all of them in one view.

  • Receive opportunities in one click: the market monitor Z Market Lab lists live spreads and funding rates across exchanges side by side, for example on the Bitcoin funding rate page. Send an opportunity you pick to Trade and the combo is set up on the spot; you decide whether to open it.

All ZML Trade features lists everything else.

Install and cost

On a cloud server, install with the illustrated steps; on any other server, run one command. The minimum is 2 CPU cores, 2 GB of memory and 20 GB of disk; see Install ZML Trade.

Does Trade cost anything? has the details on cost.