This skill should be used when the user asks to 'buy BTC', 'sell ETH', 'place a limit order', 'place a market order', 'cancel my order', 'amend my order', 'long BTC futures', 'short ETH futures', 'open a position', 'close a position', 'flash close', 'reverse position', 'set take profit', 'set stop loss', 'set leverage', 'change margin type', 'adjust margin', 'auto add margin', 'check my orders', 'order status', 'fill history', 'trade history', 'futures balance', 'today PnL', 'commission rate', or any request to place/cancel/amend spot or USDT-M perpetual futures orders on Toobit CEX. Covers spot trading and USDT-M perpetual futures (leverage, margin, TP/SL, flash close, reverse position). Requires API credentials. Do NOT use for market data (use toobit-cex-market), or account balance/deposits/withdrawals (use toobit-cex-portfolio).
Spot and USDT-M perpetual futures order management on Toobit exchange. Place, cancel, amend, and monitor orders; set leverage and margin type; adjust margin; flash close and reverse positions; set take-profit/stop-loss. Requires API credentials.
toobit CLI:
npm install -g toobit-trade-cli
~/.toobit/config.toml:
default_profile = "live"
[profiles.live]
api_key = "your-api-key"
secret_key = "your-secret-key"
Or set environment variables:
export TOOBIT_API_KEY=your_key
export TOOBIT_SECRET_KEY=your_secret
toobit account check-api-key
Run this check before any authenticated command.
toobit account check-api-key # verify API key status and permissions
~/.toobit/config.toml, and wait for setup to complete before retrying.If any command returns a 401 / -2015 authentication error:
~/.toobit/config.toml
toobit account check-api-key to verifytoobit-cex-markettoobit-cex-portfoliotoobit-cex-trade (this skill)# Market buy 0.01 BTC (spot)
toobit spot place --symbol BTCUSDT --side BUY --type MARKET --quantity 0.01
# Limit sell 0.01 BTC at $100,000 (spot)
toobit spot place --symbol BTCUSDT --side SELL --type LIMIT --quantity 0.01 --price 100000
# View open spot orders
toobit spot orders --symbol BTCUSDT
# Cancel a spot order
toobit spot cancel --orderId <orderId>
# Long BTC futures at market
toobit futures place --symbol BTC-SWAP-USDT --side BUY_OPEN --orderType MARKET --quantity 0.01
# Set BTC futures leverage to 10x
toobit futures leverage --symbol BTC-SWAP-USDT --leverage 10
# Flash close BTC futures position
toobit futures flash-close --symbol BTC-SWAP-USDT --side LONG
# View futures positions
toobit futures positions --symbol BTC-SWAP-USDT
# Futures account balance
toobit futures balance
| # | Command | Type | Description |
|---|---|---|---|
| 1 | toobit spot place | WRITE | Place spot order (MARKET/LIMIT) |
| 2 | toobit spot cancel | WRITE | Cancel spot order by orderId |
| 3 | toobit spot cancel-all | WRITE | Cancel all open spot orders for a symbol |
| 4 | toobit spot get | READ | Single spot order details |
| 5 | toobit spot orders | READ | List open spot orders |
| 6 | toobit spot history | READ | Historical (filled/cancelled) spot orders |
| 7 | toobit spot fills | READ | Spot trade fill history |
| # | Command | Type | Description |
|---|---|---|---|
| 8 | toobit futures place | WRITE | Place futures order |
| 9 | toobit futures cancel | WRITE | Cancel futures order |
| 10 | toobit futures cancel-all | WRITE | Cancel all futures orders for a symbol |
| 11 | toobit futures amend | WRITE | Amend futures order (price/quantity) |
| 12 | toobit futures flash-close | WRITE | Flash close entire position at market |
| 13 | toobit futures leverage | READ/WRITE | Get or set leverage |
| 14 | toobit futures margin-type | WRITE | Set margin type (cross/isolated) |
| 15 | toobit futures get | READ | Single futures order details |
| 16 | toobit futures orders | READ | List open futures orders |
| 17 | toobit futures history | READ | Historical futures orders |
| 18 | toobit futures positions | READ | Open futures positions |
| 19 | toobit futures history-positions | READ | Closed position history |
| 20 | toobit futures fills | READ | Futures trade fill history |
| 21 | toobit futures balance | READ | Futures account balance (equity, margin, PnL) |
| 22 | toobit futures pnl | READ | Today's realized PnL |
| 23 | toobit futures commission | READ | Commission rate for a symbol |
| # | Tool | Type | Description |
|---|---|---|---|
| 24 | futures_set_trading_stop | WRITE | Set TP/SL on an existing position |
| 25 | futures_reverse_position | WRITE | Reverse (flip) position direction |
| 26 | futures_adjust_margin | WRITE | Adjust isolated margin |
| 27 | futures_auto_add_margin | WRITE | Enable/disable auto-add margin |
| 28 | futures_get_balance_flow | READ | Futures balance flow (ledger) |
| 29 | spot_batch_orders | WRITE | Batch place spot orders |
| 30 | spot_cancel_order_by_ids | WRITE | Cancel spot orders by multiple IDs |
| 31 | spot_place_order_test | WRITE | Test spot order (validates params, no execution) |
| 32 | futures_batch_orders | WRITE | Batch place futures orders |
| 33 | futures_cancel_order_by_ids | WRITE | Cancel futures orders by multiple IDs |
User: "Buy $500 worth of ETH at market"
1. toobit-cex-market toobit market ticker --symbol ETHUSDT → get current price to estimate qty
2. toobit-cex-portfolio toobit account info → confirm available USDT ≥ $500
↓ user approves
3. toobit-cex-trade toobit spot place --symbol ETHUSDT --side BUY --type MARKET --quantity <qty>
4. toobit-cex-trade toobit spot fills --symbol ETHUSDT → confirm fill price and size
User: "Long 0.1 BTC futures at market, TP at $105k, SL at $88k"
1. toobit-cex-portfolio toobit account info → confirm margin available
2. toobit-cex-trade toobit futures leverage --symbol BTC-SWAP-USDT → check current leverage
↓ user approves
3. toobit-cex-trade toobit futures place --symbol BTC-SWAP-USDT --side BUY_OPEN \
--orderType MARKET --quantity 0.1
4. toobit-cex-trade (MCP) futures_set_trading_stop → set tpPrice=105000, slPrice=88000
5. toobit-cex-trade toobit futures positions --symbol BTC-SWAP-USDT → confirm position opened
User: "Set BTC futures to 5x leverage then go long"
1. toobit-cex-trade toobit futures leverage --symbol BTC-SWAP-USDT → check current
↓ user approves change
2. toobit-cex-trade toobit futures leverage --symbol BTC-SWAP-USDT --leverage 5
3. toobit-cex-trade toobit futures place --symbol BTC-SWAP-USDT --side BUY_OPEN \
--orderType MARKET --quantity 0.1
4. toobit-cex-trade toobit futures positions --symbol BTC-SWAP-USDT → confirm position + leverage
User: "Close my BTC long and flip to short"
1. toobit-cex-trade toobit futures positions --symbol BTC-SWAP-USDT → confirm open long
2. toobit-cex-trade toobit futures flash-close --symbol BTC-SWAP-USDT --side LONG
OR
2. toobit-cex-trade (MCP) futures_reverse_position → reverse in one step
3. toobit-cex-trade toobit futures positions --symbol BTC-SWAP-USDT → confirm new short
User: "Cancel all my open BTC spot orders"
1. toobit-cex-trade toobit spot orders --symbol BTCUSDT → list open orders
2. toobit-cex-trade toobit spot cancel-all --symbol BTCUSDT
3. toobit-cex-trade toobit spot orders --symbol BTCUSDT → confirm all cancelled
Before any authenticated command:
toobit account check-api-key to verify API key validity~/.toobit/config.tomlSpot (symbol format: BTCUSDT):
toobit spot place/cancel/cancel-alltoobit spot get/orders/history/fillsFutures / Perpetual (symbol format: BTC-SWAP-USDT):
toobit futures place/cancel/cancel-all/amendtoobit futures flash-closefutures_reverse_positiontoobit futures leverage [--leverage <n>]toobit futures margin-type --symbol <sym> --marginType <type>futures_adjust_marginfutures_set_trading_stopfutures_auto_add_margintoobit futures get/orders/history/positions/history-positions/fills/balance/pnl/commissionRead commands (orders, positions, fills, get, balance, pnl, commission): run immediately.
Write commands (place, cancel, amend, flash-close, leverage set, margin-type): confirm key details once:
--symbol, --side (BUY/SELL), --type (MARKET/LIMIT), --quantity; --price required for LIMIT--symbol, --side (BUY_OPEN/SELL_OPEN/BUY_CLOSE/SELL_CLOSE), --orderType, --quantity--symbol and --side (LONG/SHORT); closes the entire position at marketfutures_set_trading_stopspot place: run toobit spot orders or toobit spot fills to confirmfutures place: run toobit futures orders or toobit futures positions to confirmflash-close: run toobit futures positions to confirm position size is 0toobit spot orders / toobit futures orders to confirm order removedtoobit spot place --symbol <sym> --side <BUY|SELL> --type <MARKET|LIMIT> \
--quantity <n> [--price <p>] [--json]
| Param | Required | Default | Description |
|---|---|---|---|
--symbol | Yes | - | Spot symbol (e.g., BTCUSDT) |
--side | Yes | - | BUY or SELL |
--type | Yes | MARKET | MARKET or LIMIT |
--quantity | Yes | - | Order size in base currency |
--price | Cond. | - | Required for LIMIT orders |
toobit spot cancel --orderId <id> [--clientOrderId <id>] [--json]
toobit spot cancel-all --symbol <sym> [--json]
Cancels all open orders for the specified symbol.
toobit spot get --orderId <id> [--clientOrderId <id>] [--json]
Returns: orderId, symbol, side, type, price, origQty, executedQty, avgPrice, status, time.
toobit spot orders [--symbol <sym>] [--limit <n>] [--json]
Returns all pending/open spot orders. Filter by --symbol optionally.
toobit spot history --symbol <sym> [--limit <n>] [--startTime <ms>] [--endTime <ms>] [--json]
Returns filled/cancelled orders.
toobit spot fills [--symbol <sym>] [--limit <n>] [--json]
Returns: symbol, orderId, price, qty, commission, commissionAsset, time.
toobit futures place --symbol <sym> --side <side> --orderType <type> \
--quantity <n> [--price <p>] [--leverage <n>] [--json]
| Param | Required | Default | Description |
|---|---|---|---|
--symbol | Yes | - | Futures symbol (e.g., BTC-SWAP-USDT) |
--side | Yes | - | BUY_OPEN, SELL_OPEN, BUY_CLOSE, SELL_CLOSE |
--orderType | Yes | MARKET | MARKET, LIMIT, LIMIT_MAKER |
--quantity | Yes | - | Order quantity |
--price | Cond. | - | Required for LIMIT orders |
--leverage | No | - | Set leverage with order |
Side values:
BUY_OPEN — open long positionSELL_OPEN — open short positionBUY_CLOSE — close short positionSELL_CLOSE — close long positiontoobit futures cancel --orderId <id> [--clientOrderId <id>] [--json]
toobit futures cancel-all --symbol <sym> [--json]
toobit futures amend --orderId <id> [--quantity <n>] [--price <p>] [--json]
Must provide at least one of --quantity or --price.
toobit futures flash-close --symbol <sym> --side <LONG|SHORT> [--json]
Closes the entire position at market price. Equivalent to placing a market close order for the full position size.
# Get current leverage
toobit futures leverage --symbol <sym> [--json]
# Set leverage
toobit futures leverage --symbol <sym> --leverage <n> [--json]
| Param | Required | Description |
|---|---|---|
--symbol | Yes | Futures symbol |
--leverage | No | New leverage value; omit to query current |
toobit futures margin-type --symbol <sym> --marginType <CROSS|ISOLATED> [--json]
| Value | Behavior |
|---|---|
CROSS | Cross margin — shared across positions |
ISOLATED | Isolated margin — independent per position |
toobit futures get --orderId <id> [--clientOrderId <id>] [--json]
Returns: orderId, symbol, side, type, price, origQty, executedQty, avgPrice, status, time.
toobit futures orders [--symbol <sym>] [--json]
toobit futures history --symbol <sym> [--limit <n>] [--json]
toobit futures positions [--symbol <sym>] [--json]
Returns: symbol, side, positionAmt, avgPrice, unrealisedPnl, leverage, marginType, liquidationPrice.
toobit futures history-positions [--symbol <sym>] [--json]
Returns closed position records with realized PnL.
toobit futures fills [--symbol <sym>] [--limit <n>] [--json]
toobit futures balance [--json]
Returns: futures account equity, available margin, total margin, unrealized PnL across all positions.
toobit futures pnl [--json]
Returns: today's realized PnL summary.
toobit futures commission --symbol <sym> [--json]
Returns: makerCommissionRate, takerCommissionRate for the specified symbol.
| Tool | Description |
|---|---|
spot_place_order | Place spot order |
spot_place_order_test | Test spot order (validates params, no execution) |
spot_batch_orders | Batch place multiple spot orders |
spot_cancel_order | Cancel spot order |
spot_cancel_open_orders | Cancel all open spot orders for a symbol |
spot_cancel_order_by_ids | Cancel spot orders by multiple IDs |
spot_get_order | Get single spot order details |
spot_get_open_orders | List open spot orders |
spot_get_trade_orders | Spot order history |
spot_get_fills | Spot fill history |
| Tool | Description |
|---|---|
futures_place_order | Place futures order |
futures_batch_orders | Batch place multiple futures orders |
futures_cancel_order | Cancel futures order |
futures_cancel_all_orders | Cancel all futures orders for a symbol |
futures_cancel_order_by_ids | Cancel futures orders by multiple IDs |
futures_amend_order | Amend futures order |
futures_get_order | Get single futures order details |
futures_get_open_orders | List open futures orders |
futures_get_history_orders | Futures order history |
futures_get_positions | Open futures positions |
futures_get_history_positions | Closed position history |
futures_set_leverage | Set futures leverage |
futures_get_leverage | Get current leverage |
futures_set_margin_type | Set margin type (CROSS/ISOLATED) |
futures_set_trading_stop | Set TP/SL on position |
futures_flash_close | Flash close position at market |
futures_reverse_position | Reverse (flip) position direction |
futures_adjust_margin | Adjust isolated margin amount |
futures_auto_add_margin | Enable/disable auto-add margin |
futures_get_balance | Futures account balance |
futures_get_fills | Futures fill history |
futures_get_commission_rate | Commission rate |
futures_get_today_pnl | Today's realized PnL |
futures_get_balance_flow | Futures balance flow (ledger) |
"Buy 0.05 BTC at market"
toobit spot place --symbol BTCUSDT --side BUY --type MARKET --quantity 0.05
# → Order placed: orderId 7890123456 (FILLED)
"Set a limit sell for 0.1 ETH at $3500"
toobit spot place --symbol ETHUSDT --side SELL --type LIMIT --quantity 0.1 --price 3500
# → Order placed: orderId 7890123457 (NEW)
"Show my open spot orders"
toobit spot orders --symbol BTCUSDT
# → table: orderId, symbol, side, type, price, origQty, executedQty, status
"Long 0.1 BTC futures at market"
toobit futures place --symbol BTC-SWAP-USDT --side BUY_OPEN --orderType MARKET --quantity 0.1
# → Order placed: orderId 7890123458 (FILLED)
"Close my BTC long position immediately"
toobit futures flash-close --symbol BTC-SWAP-USDT --side LONG
# → Position closed: BTC-SWAP-USDT LONG
"Set BTC futures leverage to 5x"
toobit futures leverage --symbol BTC-SWAP-USDT --leverage 5
# → Leverage set: BTC-SWAP-USDT 5x
"Switch BTC futures to isolated margin"
toobit futures margin-type --symbol BTC-SWAP-USDT --marginType ISOLATED
# → Margin type set: BTC-SWAP-USDT ISOLATED
"Show my futures positions"
toobit futures positions --symbol BTC-SWAP-USDT
# → symbol: BTC-SWAP-USDT | side: LONG | positionAmt: 0.1 | avgPrice: 95000 | upl: +120.5 | leverage: 10x
"What's my futures balance?"
toobit futures balance
# → equity: 5000.00 | availableMargin: 4200.00 | totalMargin: 800.00 | unrealisedPnl: +120.5
"What's my commission rate for BTC futures?"
toobit futures commission --symbol BTC-SWAP-USDT
# → maker: 0.02% | taker: 0.06%
BTCUSDT, ETHUSDTBUY or SELL (uppercase)--type MARKET does not require --price; LIMIT doestoobit market info for minQty and minNotional per symbolspot_place_order_test to validate parameters without executionBTC-SWAP-USDT, ETH-SWAP-USDTBUY_OPEN (open long), SELL_OPEN (open short), BUY_CLOSE (close short), SELL_CLOSE (close long)futures place with BUY_CLOSE/SELL_CLOSE and specific quantitymarket_get_risk_limits for max leverage per tierfutures_set_trading_stop after opening a position — requires symbol, side, tpPrice, slPrice~/.toobit/config.toml or env vars--json returns raw Toobit API response