Skip to content

Binance

tradectl supports Binance USD-M Futures (Linear), COIN-M Futures (Inverse), and Spot.

Supported features

  • Real-time bookTicker and @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

  1. Log in to Binance
  2. API ManagementCreate API
  3. Enable Enable Futures trading permission (and Enable Spot & Margin Trading if running on spot)
  4. Restrict IP to the host running the bot — strongly recommended
  5. 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

TierMakerTaker
VIP 00.0200%0.0400%
VIP 10.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.

tradectl — Automate Crypto Trading