Trading on an exchange

Your agent can read your accounts freely, and act on them only with your consent, one order at a time.

Adding accounts

In Authentification, the Comptes exchange section takes as many accounts as you want across Binance, Bybit, OKX, Coinbase, Kraken, Bitget, KuCoin, Gate.io, HTX and MEXC. An account is a name the agent will use (Binance-main), the API key, the secret, a passphrase where the exchange asks for one, and testnet where it offers one. Tester opens the connection and reads the balance.

Create the keys on the exchange with exactly the rights you want to grant. The application has no withdrawal tool, so a key without withdrawal rights loses nothing.

Then, in each agent’s settings, tick the accounts it may pilot. An agent with no account attached has no exchange tool at all.

What it reads, without asking

ExchangeBalanceBalances, with a USD estimate, across the accounts it may see.
ExchangePositionsFutures positions, PnL, liquidation price.
ExchangeOrdersOpen orders, or the history with fees.
ExchangeTickerPrice, order book and funding on that exchange.
ExchangeWatchA reading every N seconds for up to ten minutes, stopping on a condition: a price, a PnL, a liquidation distance, a closed position.

What it does, only when you say so

PlaceOrderMarket, limit, stop, stop-limit, take-profit; size in asset or in quote; reduce-only; leverage.
CancelOrderCancels an open order.
ClosePositionCloses a position, whole or a fraction.
TransferMoves funds between spot and futures on the same account, or from the funding wallet.
SetLeverageSets the leverage on a pair.

Limits per exchange

Each exchange has its own limits, taken from its documentation and from ccxt. The application knows them and refuses before any call, with the reason; the agent reads them in its prompt too.

ExchangeFuturesSpot ↔ futures transferTestnetWorth knowing
BinanceyesyesyesSpot testnet and futures testnet keys are distinct.
Bybityesno, unified accountyesTestnet keys from testnet.bybit.com.
OKXyesno, unified trading accountdemoPassphrase; demo keys are created in demo mode.
CoinbasenononoAdvanced Trade; the secret is the CDP key’s EC private key, pasted as is.
KrakennononoKraken Futures has its own keys, outside this integration.
BitgetyesyesnoPassphrase; the account must be in one-way mode.
KuCoinyesyesnoPassphrase; one key with Spot and Futures permissions serves both.
Gate.ioyesyesyesNo margin mode through the API, leverage only.
HTXyesnonoNo margin mode through the API.
MEXCread onlyyesnoMEXC closed futures order placement through its API in 2022.

Two details that save an afternoon

  • On Bybit, OKX, KuCoin, and Binance’s funding wallet, a deposit lands in a separate wallet, not on the trading account. Tester and ExchangeBalance read both and say where the funds are; Transfer with from: funding brings them to trading.
  • Your computer’s clock is compensated: the offset with each exchange is measured at connection and every ten minutes, and requests are dated at the exchange’s time. Binance and Bybit refuse a request dated more than a second after theirs; such a refusal is named as what it is.

Two common skills guide every profession here: trading-execution (balance, price, size, order, confirmation) and trade-review (positions and history, alert thresholds).