Workflow examples for common market/account/admin/trade scenarios.
# Add API account (required for private account/trade actions)
ccxt-admin.account_add_api exchange=gate payload={alias:gate-main,apiKey:<API_KEY>,secret:<SECRET>} runtimeContext={password:<MASTER_PASSWORD>}
# Verify accounts
ccxt-admin.account_lsccxt-admin.check_sandbox gate
ccxt-admin.check_symbol_support gate BTC/USDTAlways resolve exact symbols before trading.
ccxt-market.list_markets gate 50Use symbol exactly as listed by the exchange.
ccxt-market.fetch_ticker gate BTC/USDT
ccxt-market.fetch_order_book gate BTC/USDT 20
ccxt-market.fetch_ohlcv gate BTC/USDT 1h 50ccxt-account.fetch_balance gate
ccxt-account.fetch_balance gate runtimeContext={accountAlias:gate-main,password:<MASTER_PASSWORD>}
ccxt-account.fetch_open_orders gate BTC/USDT
ccxt-account.fetch_orders gate BTC/USDT 20
ccxt-account.fetch_my_trades gate BTC/USDT 20
ccxt-account.fetch_positions gate# 1) Validate order first
ccxt-trade.validate_order gate BTC/USDT limit buy 0.001 30000
# 2) Dry-run create order (safe path)
ccxt-trade.create_order gate BTC/USDT limit buy 0.001 30000 --dry-run
# 3) Real create order
ccxt-trade.create_order gate BTC/USDT limit buy 0.001 30000
# 4) Cancel order
ccxt-trade.cancel_order gate <ORDER_ID> BTC/USDT
# 5) Set leverage (derivatives/perps exchanges only)
ccxt-trade.set_leverage gate BTC/USDT 3# Missing API account
ccxt-admin.account_ls
# Unsupported symbol / wrong symbol format
ccxt-market.list_markets gate 100
# Check exchange capabilities
ccxt-admin.exchange_capabilities gate BTC/USDTNotes:
- Private actions require an API account in local encrypted store (
account_add_api). - Environment-variable credential mode is not used.
- For market buy on some exchanges, a
pricemay still be required to compute cost.