Binance
tradectl supports Binance USD-M Futures (Linear), COIN-M Futures (Inverse), and Spot.
Supported features
- Real-time
bookTickerand@trade(aggregate trade) WebSocket streams - L2 depth subscriptions (when the strategy opts in)
- Market and limit orders, post-only and IOC time-in-force
- Take-profit (limit) and stop-loss (stop-market) exits via
ExitOrder - Configurable leverage; isolated and cross margin modes
- Hedge mode and one-way mode
- User-data WebSocket for fill events (USD-M uses
/private/ws/<listenKey>; COIN-M uses/ws/<listenKey>)
API key setup
- Log in to Binance
- API Management → Create API
- Enable Enable Futures trading permission (and Enable Spot & Margin Trading if running on spot)
- Restrict IP to the host running the bot — strongly recommended
- Do not enable withdrawals — tradectl never needs them
Configuration
json
{
"api": { "provider": "Binance", "key": "...", "secret": "..." },
"strats": [{
"name": "btc-linear",
"type": "shot",
"marketType": "LINEAR",
"isEmulator": false,
"pairs": ["BTCUSDT", "ETHUSDT"],
"leverage": 10
}]
}marketType accepts LINEAR (USD-M futures), INVERSE (COIN-M futures), or SPOT.
Fees
| Tier | Maker | Taker |
|---|---|---|
| VIP 0 | 0.0200% | 0.0400% |
| VIP 1 | 0.0160% | 0.0400% |
Use your actual fee tier when configuring backtests for accurate results — defaults are conservative.
Testnet
Binance provides separate testnets for USD-M and COIN-M. When adding credentials in the dashboard, mark them as Testnet. The CLI auto-routes to testnet endpoints based on this flag.
