# CLI Reference ## CLI vs MCP tool names Subcommands use **spaces** (`okx swap algo place`, `okx bot grid create`), not hyphens. AI agents see the same features under underscored MCP tool names (`swap_place_algo_order`, `bot_grid_create_order`). Do **NOT** convert an MCP tool identifier into a hyphen-joined CLI command — `okx swap place-algo` is not a valid command and will be rejected with `Unknown command`. Per-module mapping tables live in `skills/okx-cex-trade/references/-commands.md`. ## Installation ```bash npm install -g @okx_ai/okx-trade-cli ``` ## Global Options | Option | Description | |--------|-------------| | `--profile ` | Choose profile from `~/.okx/config.toml` | | `--demo` | Use simulated trading (demo) mode | | `--json` | Raw JSON output (useful for scripting with `jq`) | | `--help` | Show help | ```bash # Pipe to jq okx account balance --json | jq '.[] | {ccy: .ccy, eq: .eq}' ``` ## Exit Codes | Code | Meaning | |------|---------| | `0` | Success | | `1` | Any failure — network error, authentication error, argument validation error, or OKX business rejection (e.g. insufficient balance, invalid instrument) | Exit code 1 indicates failure. > **Partial batch failure:** if _any_ item in a batch request has `sCode != "0"`, the command exits with code 1. Agents and scripts should inspect the JSON output to identify which individual items failed. ```bash # Safe to use in scripts — exit code 1 if order was rejected for any reason okx spot place --instId BTC-USDT --side buy --ordType market --sz 100 --json if [ $? -ne 0 ]; then echo "Order failed" fi # Batch: exit code 1 even if only some orders fail — check each item's sCode okx spot batch place orders.json --json | jq '.[] | select(.sCode != "0")' ``` --- ## market — Market Data (no API key required) ```bash okx market ticker BTC-USDT okx market tickers SPOT okx market orderbook BTC-USDT --sz 5 okx market candles BTC-USDT --bar 1H --limit 10 okx market instruments --instType SWAP okx market funding-rate BTC-USDT-SWAP okx market funding-rate BTC-USDT-SWAP --history --limit 10 okx market mark-price --instType SWAP --instId BTC-USDT-SWAP okx market trades BTC-USDT --limit 20 okx market index-ticker --instId BTC-USD okx market price-limit BTC-USDT-SWAP okx market open-interest --instType SWAP # pair-spread — spread statistics between two instruments okx market pair-spread BTC-USDT-SWAP ETH-USDT-SWAP okx market pair-spread BTC-USDT-SWAP ETH-USDT-SWAP --bar 5m --window 4H okx market pair-spread BTC-USDT-SWAP ETH-USDT-SWAP --backtest-time 1715000000000 --json ``` Supported candle intervals: `1m` `3m` `5m` `15m` `30m` `1H` `2H` `4H` `6H` `12H` `1D` `1W` `1M` --- ## account ```bash okx account balance okx account balance BTC,ETH okx account asset-balance # funding account balance okx account positions okx account bills okx account bills --archive # bills older than 7 days (up to 3 months) okx account fees --instType SPOT okx account config okx account max-size --instId BTC-USDT-SWAP --tdMode cross okx account max-withdrawal okx account positions-history okx account set-position-mode --posMode net_mode ``` --- ## spot — Spot Trading ```bash okx spot orders okx spot orders --instId BTC-USDT --history okx spot get --instId BTC-USDT --ordId 123456 okx spot fills --instId BTC-USDT okx spot place --instId BTC-USDT --side buy --ordType market --sz 100 okx spot place --instId BTC-USDT --side sell --ordType limit --sz 0.001 --px 70000 # With attached TP/SL okx spot place --instId BTC-USDT --side buy --ordType limit --sz 0.001 --px 60000 \ --tpTriggerPx 65000 --tpOrdPx 64900 --slTriggerPx 58000 --slOrdPx 57900 okx spot amend --instId BTC-USDT --ordId 123456 --newPx 68000 okx spot cancel BTC-USDT --ordId 123456 ``` --- ## swap — Perpetual Contracts ```bash okx swap positions okx swap orders --history okx swap get --instId BTC-USDT-SWAP --ordId 123456 okx swap fills --instId BTC-USDT-SWAP okx swap place --instId BTC-USDT-SWAP --side buy --ordType market --sz 1 --posSide long --tdMode cross # With attached TP/SL okx swap place --instId BTC-USDT-SWAP --side buy --ordType market --sz 1 --posSide long --tdMode cross \ --tpTriggerPx 100000 --tpOrdPx 99900 --slTriggerPx 85000 --slOrdPx 84900 okx swap cancel BTC-USDT-SWAP --ordId 123456 okx swap close --instId BTC-USDT-SWAP --mgnMode cross okx swap leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode cross okx swap get-leverage --instId BTC-USDT-SWAP --mgnMode cross ``` --- ## futures — Delivery Contracts ```bash okx futures orders okx futures orders --history okx futures positions okx futures fills okx futures place --instId BTC-USDT-250328 --side buy --ordType market --sz 1 --tdMode cross # With attached TP/SL okx futures place --instId BTC-USDT-250328 --side buy --ordType market --sz 1 --tdMode cross \ --tpTriggerPx 100000 --tpOrdPx 99900 --slTriggerPx 85000 --slOrdPx 84900 okx futures cancel BTC-USDT-250328 --ordId 123456 okx futures get --instId BTC-USDT-250328 --ordId 123456 ``` --- ## bot — Trading Bots ```bash # ── Spot Grid (algoOrdType: grid) ───────────────────────────────────────────── # List / query okx bot grid orders --algoOrdType grid okx bot grid orders --algoOrdType grid --history okx bot grid orders --algoOrdType grid --instId BTC-USDT okx bot grid details --algoOrdType grid --algoId okx bot grid sub-orders --algoOrdType grid --algoId # filled trades okx bot grid sub-orders --algoOrdType grid --algoId --pending # open orders (--live: deprecated alias) # Create spot grid — invest in quote currency (USDT) okx bot grid create --instId BTC-USDT --algoOrdType grid \ --maxPx 100000 --minPx 80000 --gridNum 10 --quoteSz 100 # Create spot grid — invest in base currency (BTC) okx bot grid create --instId BTC-USDT --algoOrdType grid \ --maxPx 100000 --minPx 80000 --gridNum 10 --baseSz 0.001 # Create spot grid — geometric spacing (runType 2) okx bot grid create --instId BTC-USDT --algoOrdType grid \ --maxPx 100000 --minPx 80000 --gridNum 10 --quoteSz 100 --runType 2 # Stop spot grid (stopType: 1=sell all holdings (default), 2=keep holdings) okx bot grid stop --algoId --algoOrdType grid --instId BTC-USDT okx bot grid stop --algoId --algoOrdType grid --instId BTC-USDT --stopType 2 # ── Contract Grid (algoOrdType: contract_grid) ──────────────────────────────── # List / query okx bot grid orders --algoOrdType contract_grid okx bot grid orders --algoOrdType contract_grid --history okx bot grid details --algoOrdType contract_grid --algoId okx bot grid sub-orders --algoOrdType contract_grid --algoId # Create contract grid — neutral direction, 3x leverage, 100 USDT margin okx bot grid create --instId BTC-USDT-SWAP --algoOrdType contract_grid \ --maxPx 100000 --minPx 80000 --gridNum 10 \ --direction neutral --lever 3 --sz 100 # Create contract grid — long direction, 5x leverage, 100 USDT margin okx bot grid create --instId BTC-USDT-SWAP --algoOrdType contract_grid \ --maxPx 100000 --minPx 80000 --gridNum 10 \ --direction long --lever 5 --sz 100 # Create contract grid — short direction, 3x leverage, 100 USDT margin okx bot grid create --instId BTC-USDT-SWAP --algoOrdType contract_grid \ --maxPx 100000 --minPx 80000 --gridNum 10 \ --direction short --lever 3 --sz 100 # Create coin-margined contract grid — sz is in BTC (not USDT) okx bot grid create --instId BTC-USD-SWAP --algoOrdType contract_grid \ --maxPx 100000 --minPx 80000 --gridNum 20 \ --direction long --lever 5 --sz 0.1 # Stop contract grid (stopType: 1=close position+stop (default), 2=keep position+stop) okx bot grid stop --algoId --algoOrdType contract_grid --instId BTC-USDT-SWAP okx bot grid stop --algoId --algoOrdType contract_grid --instId BTC-USDT-SWAP --stopType 2 # ── Moon Grid (algoOrdType: moon_grid) — list/query only ───────────────────── okx bot grid orders --algoOrdType moon_grid okx bot grid details --algoOrdType moon_grid --algoId # ── Contract DCA ────────────────────────────────────────────────────────────── okx bot dca orders [--algoId ] [--instId ] okx bot dca orders --history okx bot dca details --algoId okx bot dca sub-orders --algoId okx bot dca sub-orders --algoId --cycleId okx bot dca create \ --instId BTC-USDT-SWAP --lever 3 --direction long \ --initOrdAmt 100 --safetyOrdAmt 50 --maxSafetyOrds 3 \ --pxSteps 0.03 --pxStepsMult 1 --volMult 1 --tpPct 0.03 # Note: safetyOrdAmt, pxSteps, pxStepsMult, volMult are required when maxSafetyOrds > 0 # With optional params (stop-loss, trigger strategy) okx bot dca create \ --instId BTC-USDT-SWAP --lever 3 --direction long \ --initOrdAmt 100 --safetyOrdAmt 50 --maxSafetyOrds 3 \ --pxSteps 0.03 --pxStepsMult 1 --volMult 1 \ --tpPct 0.03 --slPct 0.15 --slMode market okx bot dca stop --algoId ``` --- ## smartmoney — Smart Money Analytics (read-only) ```bash # ── Trader family ─────────────────────────────────────────────────────────── # Leaderboard ranking by pool conditions okx smartmoney traders-by-filter --period 30 --sortBy pnl --limit 10 okx smartmoney traders-by-filter --minWinRate 0.8 --maxDrawdown 0.1 --period 30 --json # PnL/win-rate profile for one or more authorIds (--sortBy + --period required; defaults pnl + 90) okx smartmoney performance-by-trader --authorIds , --sortBy pnl --period 30 # Current open positions for one trader okx smartmoney trader-positions --authorId okx smartmoney trader-positions --authorId --instId BTC-USDT-SWAP # Closed-position history (paginated by posId) okx smartmoney trader-positions-history --authorId --limit 50 okx smartmoney trader-positions-history --authorId --after --limit 50 # Order/fill flow (paginated by ordId) okx smartmoney trader-orders-history --authorId --limit 50 okx smartmoney trader-orders-history --authorId --instId BTC-USDT-SWAP --limit 50 # ── Signal / coin family ──────────────────────────────────────────────────── # Top-N most-watched-by-smart-money instruments — pool filter mode (current hour) okx smartmoney signal-overview-by-filter --topInstruments 20 okx smartmoney signal-overview-by-filter --topInstruments 20 --pnlTier PNL_TOP20 # Single-asset signal — pool filter mode (current hour) okx smartmoney signal-overview-by-filter --instCcyList BTC okx smartmoney signal-overview-by-filter --instCcyList BTC --pnlTier PNL_TOP20 --winRateTier WR_GE_80 # Multi-asset signal — restricted to specific authorIds (current hour); --sortBy / --period drive capability metrics (defaults pnl / 7) okx smartmoney signal-overview-by-trader --authorIds , --instCcyList BTC,ETH --sortBy pnl --period 7 # Single-asset signal time-series — pool filter, last 30 daily buckets ending at the current UTC hour okx smartmoney signal-trend-by-filter --instCcy BTC --granularity 1d --limit 30 # Anchor at a specific hour: 10-digit yyyyMMddHH UTC okx smartmoney signal-trend-by-filter --instCcy BTC --asOfTime 2026050100 --granularity 1d --limit 30 # Restricted to authorIds (authorIds-direct-lookup); --sortBy / --period exposed; capability tier filters not exposed okx smartmoney signal-trend-by-trader --authorIds , --instCcy BTC --granularity 1h --limit 7 --sortBy pnl --period 7 ``` Tier enums (signal family): - `pnlTier`: `PNL_ANY` / `PNL_TOP50` / `PNL_TOP20` / `PNL_TOP5` - `winRateTier`: `WR_ANY` / `WR_GE_50` / `WR_GE_80` - `maxDrawdownTier`: `MR_ANY` / `MR_LE_20` / `MR_LE_50` - `aumTier`: `AUM_ANY` / `AUM_TOP50` / `AUM_TOP20` / `AUM_TOP5` > Need a trader's full picture? Run `performance-by-trader`, `trader-positions`, and `trader-orders-history` in parallel — the old `smartmoney trader` composite command has been removed. --- ## config ```bash okx config show okx config set default_profile live ``` --- ## setup — Configure MCP Clients ```bash # Write MCP server entry into client config file okx setup --client claude-desktop okx setup --client cursor okx setup --client windsurf okx setup --client vscode # writes .mcp.json in current directory okx setup --client claude-code # runs claude mcp add # With specific profile and modules okx setup --client claude-desktop --profile live --modules market,spot,account ``` Supported clients: `claude-desktop` `cursor` `windsurf` `vscode` `claude-code` Also available directly as `okx-trade-mcp setup --client ` without installing the CLI. --- # CLI 命令参考(中文) ## 安装 ```bash npm install -g @okx_ai/okx-trade-cli ``` ## 全局选项 | 选项 | 说明 | |------|------| | `--profile ` | 指定 `~/.okx/config.toml` 中的 Profile | | `--demo` | 使用模拟盘模式 | | `--json` | 原始 JSON 输出(便于配合 `jq` 脚本使用) | | `--help` | 显示帮助 | ```bash # 配合 jq 使用 okx account balance --json | jq '.[] | {ccy: .ccy, eq: .eq}' ``` ## 退出码 | 退出码 | 含义 | |--------|------| | `0` | 成功 | | `1` | 任何失败——网络错误、鉴权错误、参数校验错误,或 OKX 业务拒绝(如余额不足、合约不存在) | 退出码 1 表示失败。 > **批量部分失败:** 只要批量请求中_任意一笔_的 `sCode != "0"`,命令即以退出码 1 退出。Agent 和脚本应检查 JSON 输出,以确定哪些具体条目失败。 ```bash # 脚本中可安全使用——任何原因导致的下单失败都会返回退出码 1 okx spot place --instId BTC-USDT --side buy --ordType market --sz 100 --json if [ $? -ne 0 ]; then echo "下单失败" fi # 批量:即使只有部分订单失败也会返回退出码 1——逐条检查 sCode okx spot batch place orders.json --json | jq '.[] | select(.sCode != "0")' ``` --- ## market — 行情数据(无需 API Key) ```bash okx market ticker BTC-USDT okx market tickers SPOT okx market orderbook BTC-USDT --sz 5 okx market candles BTC-USDT --bar 1H --limit 10 okx market instruments --instType SWAP okx market funding-rate BTC-USDT-SWAP okx market funding-rate BTC-USDT-SWAP --history --limit 10 okx market mark-price --instType SWAP --instId BTC-USDT-SWAP okx market trades BTC-USDT --limit 20 okx market index-ticker --instId BTC-USD okx market price-limit BTC-USDT-SWAP okx market open-interest --instType SWAP ``` K线周期:`1m` `3m` `5m` `15m` `30m` `1H` `2H` `4H` `6H` `12H` `1D` `1W` `1M` --- ## account — 账户 ```bash okx account balance okx account balance BTC,ETH okx account asset-balance # 资金账户余额 okx account positions okx account bills okx account bills --archive # 7天前账单(最多3个月) okx account fees --instType SPOT okx account config okx account max-size --instId BTC-USDT-SWAP --tdMode cross okx account max-withdrawal okx account positions-history okx account set-position-mode --posMode net_mode ``` --- ## spot — 现货交易 ```bash okx spot orders okx spot orders --instId BTC-USDT --history okx spot get --instId BTC-USDT --ordId 123456 okx spot fills --instId BTC-USDT okx spot place --instId BTC-USDT --side buy --ordType market --sz 100 okx spot place --instId BTC-USDT --side sell --ordType limit --sz 0.001 --px 70000 # 附带止盈止损 okx spot place --instId BTC-USDT --side buy --ordType limit --sz 0.001 --px 60000 \ --tpTriggerPx 65000 --tpOrdPx 64900 --slTriggerPx 58000 --slOrdPx 57900 okx spot amend --instId BTC-USDT --ordId 123456 --newPx 68000 okx spot cancel BTC-USDT --ordId 123456 ``` --- ## swap — 永续合约 ```bash okx swap positions okx swap orders --history okx swap get --instId BTC-USDT-SWAP --ordId 123456 okx swap fills --instId BTC-USDT-SWAP okx swap place --instId BTC-USDT-SWAP --side buy --ordType market --sz 1 --posSide long --tdMode cross # 附带止盈止损 okx swap place --instId BTC-USDT-SWAP --side buy --ordType market --sz 1 --posSide long --tdMode cross \ --tpTriggerPx 100000 --tpOrdPx 99900 --slTriggerPx 85000 --slOrdPx 84900 okx swap cancel BTC-USDT-SWAP --ordId 123456 okx swap close --instId BTC-USDT-SWAP --mgnMode cross okx swap leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode cross okx swap get-leverage --instId BTC-USDT-SWAP --mgnMode cross ``` --- ## futures — 交割合约 ```bash okx futures orders okx futures orders --history okx futures positions okx futures fills okx futures place --instId BTC-USDT-250328 --side buy --ordType market --sz 1 --tdMode cross # 附带止盈止损 okx futures place --instId BTC-USDT-250328 --side buy --ordType market --sz 1 --tdMode cross \ --tpTriggerPx 100000 --tpOrdPx 99900 --slTriggerPx 85000 --slOrdPx 84900 okx futures cancel BTC-USDT-250328 --ordId 123456 okx futures get --instId BTC-USDT-250328 --ordId 123456 ``` --- ## bot — 交易机器人 ```bash # ── 现货网格(algoOrdType: grid)───────────────────────────────────────────── # 查询 okx bot grid orders --algoOrdType grid okx bot grid orders --algoOrdType grid --history okx bot grid orders --algoOrdType grid --instId BTC-USDT okx bot grid details --algoOrdType grid --algoId okx bot grid sub-orders --algoOrdType grid --algoId # 已成交子订单 okx bot grid sub-orders --algoOrdType grid --algoId --pending # 挂单中子订单(--live 为已废弃别名) # 创建现货网格 — 用计价货币(USDT)投入 okx bot grid create --instId BTC-USDT --algoOrdType grid \ --maxPx 100000 --minPx 80000 --gridNum 10 --quoteSz 100 # 创建现货网格 — 用基础货币(BTC)投入 okx bot grid create --instId BTC-USDT --algoOrdType grid \ --maxPx 100000 --minPx 80000 --gridNum 10 --baseSz 0.001 # 创建现货网格 — 等比间距(runType 2) okx bot grid create --instId BTC-USDT --algoOrdType grid \ --maxPx 100000 --minPx 80000 --gridNum 10 --quoteSz 100 --runType 2 # 停止现货网格(stopType: 1=卖出全部持仓(默认), 2=保留持仓) okx bot grid stop --algoId --algoOrdType grid --instId BTC-USDT okx bot grid stop --algoId --algoOrdType grid --instId BTC-USDT --stopType 2 # ── 合约网格(algoOrdType: contract_grid)──────────────────────────────────── # 查询 okx bot grid orders --algoOrdType contract_grid okx bot grid orders --algoOrdType contract_grid --history okx bot grid details --algoOrdType contract_grid --algoId okx bot grid sub-orders --algoOrdType contract_grid --algoId # 创建合约网格 — neutral 方向,3倍杠杆,100 USDT 保证金 okx bot grid create --instId BTC-USDT-SWAP --algoOrdType contract_grid \ --maxPx 100000 --minPx 80000 --gridNum 10 \ --direction neutral --lever 3 --sz 100 # 创建合约网格 — 做多,5倍杠杆,100 USDT 保证金 okx bot grid create --instId BTC-USDT-SWAP --algoOrdType contract_grid \ --maxPx 100000 --minPx 80000 --gridNum 10 \ --direction long --lever 5 --sz 100 # 创建合约网格 — 做空,3倍杠杆,100 USDT 保证金 okx bot grid create --instId BTC-USDT-SWAP --algoOrdType contract_grid \ --maxPx 100000 --minPx 80000 --gridNum 10 \ --direction short --lever 3 --sz 100 # 创建币本位合约网格 — sz 单位为 BTC(非 USDT) okx bot grid create --instId BTC-USD-SWAP --algoOrdType contract_grid \ --maxPx 100000 --minPx 80000 --gridNum 20 \ --direction long --lever 5 --sz 0.1 # 停止合约网格(stopType: 1=平仓并停止(默认), 2=保留仓位并停止) okx bot grid stop --algoId --algoOrdType contract_grid --instId BTC-USDT-SWAP okx bot grid stop --algoId --algoOrdType contract_grid --instId BTC-USDT-SWAP --stopType 2 # ── 月网格(algoOrdType: moon_grid)— 仅支持查询 ───────────────────────────── okx bot grid orders --algoOrdType moon_grid okx bot grid details --algoOrdType moon_grid --algoId # ── 合约 DCA ────────────────────────────────────────────────────────────────── okx bot dca orders [--algoId ] [--instId ] okx bot dca orders --history okx bot dca details --algoId okx bot dca sub-orders --algoId okx bot dca sub-orders --algoId --cycleId okx bot dca create \ --instId BTC-USDT-SWAP --lever 3 --direction long \ --initOrdAmt 100 --safetyOrdAmt 50 --maxSafetyOrds 3 \ --pxSteps 0.03 --pxStepsMult 1 --volMult 1 --tpPct 0.03 # 注意:当 maxSafetyOrds > 0 时,safetyOrdAmt、pxSteps、pxStepsMult、volMult 为必填 # 带可选参数(止损、触发策略) okx bot dca create \ --instId BTC-USDT-SWAP --lever 3 --direction long \ --initOrdAmt 100 --safetyOrdAmt 50 --maxSafetyOrds 3 \ --pxSteps 0.03 --pxStepsMult 1 --volMult 1 \ --tpPct 0.03 --slPct 0.15 --slMode market okx bot dca stop --algoId ``` --- ## smartmoney — 聪明钱分析(只读) ```bash # ── Trader 家族 ───────────────────────────────────────────────────────────── # 排行榜(按池筛选) okx smartmoney traders-by-filter --period 30 --sortBy pnl --limit 10 okx smartmoney traders-by-filter --minWinRate 0.8 --maxDrawdown 0.1 --period 30 --json # 指定 authorIds 的 PnL / 胜率画像 okx smartmoney performance-by-trader --authorIds , --period 30 # 单交易员当前持仓 okx smartmoney trader-positions --authorId okx smartmoney trader-positions --authorId --instId BTC-USDT-SWAP # 历史平仓(按 posId 游标分页) okx smartmoney trader-positions-history --authorId --limit 50 okx smartmoney trader-positions-history --authorId --after --limit 50 # 订单 / 成交流水(按 ordId 游标分页) okx smartmoney trader-orders-history --authorId --limit 50 okx smartmoney trader-orders-history --authorId --instId BTC-USDT-SWAP --limit 50 # ── Signal / coin 家族 ───────────────────────────────────────────────────── # Top-N 聪明钱关注度最高的标的 —— 池过滤模式(当前小时) okx smartmoney signal-overview-by-filter --topInstruments 20 okx smartmoney signal-overview-by-filter --topInstruments 20 --pnlTier PNL_TOP20 # 多币信号 —— 池过滤模式(当前小时) okx smartmoney signal-overview-by-filter --instCcyList BTC okx smartmoney signal-overview-by-filter --instCcyList BTC --pnlTier PNL_TOP20 --winRateTier WR_GE_80 # 多币信号 —— 限定指定 authorIds(当前小时) okx smartmoney signal-overview-by-trader --authorIds , --instCcyList BTC,ETH # 单币信号时间序列 —— 池过滤,最近 30 个日 K,锚定当前 UTC 整点 okx smartmoney signal-trend-by-filter --instCcy BTC --granularity 1d --limit 30 # 锚定指定整点(10 位 yyyyMMddHH UTC) okx smartmoney signal-trend-by-filter --instCcy BTC --asOfTime 2026050100 --granularity 1d --limit 30 # 限定 authorIds(authorIds 直查;不暴露池过滤器,后端使用默认池配置) okx smartmoney signal-trend-by-trader --authorIds , --instCcy BTC --limit 7 ``` 档位枚举(Signal 家族): - `pnlTier`:`PNL_ANY` / `PNL_TOP50` / `PNL_TOP20` / `PNL_TOP5` - `winRateTier`:`WR_ANY` / `WR_GE_50` / `WR_GE_80` - `maxDrawdownTier`:`MR_ANY` / `MR_LE_20` / `MR_LE_50` - `aumTier`:`AUM_ANY` / `AUM_TOP50` / `AUM_TOP20` / `AUM_TOP5` > 需要交易员完整画像?把 `performance-by-trader` / `trader-positions` / `trader-orders-history` 并发调用即可——旧的 `smartmoney trader` 复合命令已删除。 --- ## config — 配置 ```bash okx config show okx config set default_profile live ``` --- ## setup — 配置 MCP 客户端 ```bash # 将 MCP Server 配置写入客户端配置文件 okx setup --client claude-desktop okx setup --client cursor okx setup --client windsurf okx setup --client vscode # 在当前目录写 .mcp.json okx setup --client claude-code # 调用 claude mcp add # 指定 profile 和模块 okx setup --client claude-desktop --profile live --modules market,spot,account ``` 支持的客户端:`claude-desktop` `cursor` `windsurf` `vscode` `claude-code` 不安装 CLI 也可以直接用 `okx-trade-mcp setup --client `。