CCXT
One adapter, 100+ crypto exchanges. Binance, Coinbase, Kraken, OKX, Bybit, KuCoin, ...
CCXT is a unified Python client covering 100+ crypto exchanges with a common API shape. The Horizon CcxtVenue wraps one CCXT Exchange instance; instantiate one per exchange you trade.
Connect
python
import horizon as hz
ex = hz.connect("ccxt",
exchange_id="binance", # ccxt exchange id
sandbox=True, # testnet where supported
api_key="...",
api_secret="...",
)
ex.buy("BTC/USDT", qty=0.001, limit=65_000.0)
print(ex.balance())
ex.close()
Kwargs
| Kwarg | Type | Default | Notes |
|---|---|---|---|
exchange_id | str | required | "binance", "coinbase", "kraken", "okx", "bybit", "kucoin", … |
api_key | str \| None | None | Falls back to secrets.get("<exchange_id>.key"). |
api_secret | str \| None | None | Falls back to secrets.get("<exchange_id>.secret"). |
api_passphrase | str \| None | None | Required for Coinbase, OKX, KuCoin, Bitget. |
sandbox | bool | False | Enable testnet mode where the exchange supports it. |
options | dict \| None | None | Per-exchange CCXT options (e.g. {"defaultType": "swap"}). |
asset_class | AssetClass | Crypto | Set to Perp when trading perpetuals on the same venue. |
budget_usd | float | 0.0 | Optional hard cap. |
Unified symbol format: "BASE/QUOTE" ("BTC/USDT"). CCXT normalizes across exchanges.
Install
bash
pip install horizon[ccxt]
# or
pip install ccxt
Status
- Unified REST submit, cancel, amend, balance, positions: shipped.
- WebSocket feeds via
ccxt.pro(separate commercial license):horizon.data.live.ccxt_ws. - Per-exchange quirks (Binance margin mode, Bybit unified account): surface via
options.
Exchange-specific credential conventions, symbol mapping, rate-limit tuning: CCXT (professionals).