bithumb-trade
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBithumb CEX Trading CLI
Bithumb CEX 交易CLI
Place, cancel, and monitor single or batch spot orders; run TWAP (Time-Weighted Average Price) orders for large positions. Requires API credentials. All orders are real funds — Bithumb has no demo/simulated mode.
下单、取消及监控单笔或批量现货订单;针对大额仓位执行TWAP(时间加权平均价格)订单。需要API凭证。所有订单均使用真实资金——Bithumb无演示/模拟模式。
Tool Routing
工具路由
Writes are CLI-first: prefer the documented CLI; fall back to MCP only when the CLI is unavailable/fails or the user asks for MCP. The CLI carries safety mechanisms MCP lacks (per-profile read-only gating, account isolation, terminal reproducibility). Read-only queries: either path is fine.
bithumb ...写入操作优先使用CLI:优先使用文档中记录的 CLI;仅当CLI不可用/失败或用户要求使用MCP时,才退而使用MCP。CLI具备MCP所没有的安全机制(基于配置文件的只读限制、账户隔离、终端可复现性)。只读查询:两种方式均可。
bithumb ...Prerequisites
前置条件
- Install:
npm install -g @bithumb-official/bithumb-cli - Credentials: /
BITHUMB_ACCESS_KEYenv vars, orBITHUMB_SECRET_KEY.~/.bithumb/config.toml
- 安装:
npm install -g @bithumb-official/bithumb-cli - 凭证:设置环境变量/
BITHUMB_ACCESS_KEY,或配置文件BITHUMB_SECRET_KEY。~/.bithumb/config.toml
Skill Routing
技能路由
Market data → ; assets/wallet/API keys → ; deposits → ; withdrawals → ; audit logs/diagnostics → ; orders → this skill.
bithumb-marketbithumb-accountbithumb-depositbithumb-withdrawbithumb-system市场数据 → ;资产/钱包/API密钥 → ;充值 → ;提现 → ;审计日志/诊断 → ;订单操作 → 本技能。
bithumb-marketbithumb-accountbithumb-depositbithumb-withdrawbithumb-systemCredential Check (before any authenticated command)
凭证检查(执行任何认证命令前)
- Run . If it fails, STOP — do not retry. Inform the user (in Korean):
bithumb system diagnoseand guide them to set"인증 실패. API 키가 유효하지 않거나 만료되었을 수 있습니다."/BITHUMB_ACCESS_KEYor checkBITHUMB_SECRET_KEY. Re-run~/.bithumb/config.tomlafter they update, then retry the original operation.bithumb system diagnose - If OK, verify trading permissions for the target market with (also confirms balance, fee rates, order limits).
bithumb account order-chance --market <m>
- 运行。如果失败,立即停止——不要重试。用韩语告知用户:
bithumb system diagnose并引导他们设置"인증 실패. API 키가 유효하지 않거나 만료되었을 수 있습니다."/BITHUMB_ACCESS_KEY或检查BITHUMB_SECRET_KEY。用户更新后重新运行~/.bithumb/config.toml,然后重试原操作。bithumb system diagnose - 如果检查通过,使用验证目标市场的交易权限(同时确认余额、手续费率、订单限额)。
bithumb account order-chance --market <m>
Command Index
命令索引
| # | Command | Type | Description |
|---|---|---|---|
| 1 | | WRITE | Place spot order (limit / price / market) |
| 2 | | WRITE | Cancel order by order-id or client-order-id |
| 3 | | READ | Get a SINGLE order by one order-id / client-order-id |
| 4 | | READ | Query MULTIPLE orders or list by filters |
| 5 | | WRITE | Place multiple orders at once (max 20) |
| 6 | | WRITE | Cancel multiple orders at once (max 30) |
| 7 | | WRITE | Place TWAP order (time-weighted execution) |
| 8 | | READ | Get TWAP order history |
| 9 | | WRITE | Cancel active TWAP order |
Querying multiple orders: When the user asks for two or more order numbers at once, useortrade list --order-ids id1,id2(MCP--client-order-ids id1,id2with thetrade_get_orders/order_idsarray) — a single call (up to 100 ids; for more, split into batches of 100). Do NOT callclient_order_idsrepeatedly per id. The server defaults totrade get; to include done/cancelled addstate=wait.--states wait,done,cancelcannot be mixed withwatch/wait/done(query separately withcancel);--state watch/--statecannot be used together.--states
For full parameter details load the reference files in Step 1 below.
| # | 命令 | 类型 | 描述 |
|---|---|---|---|
| 1 | | 写入 | 创建现货订单(限价/定价/市价) |
| 2 | | 写入 | 通过order-id或client-order-id取消订单 |
| 3 | | 读取 | 通过单个order-id/client-order-id查询订单 |
| 4 | | 读取 | 查询多个订单或按筛选条件列出订单 |
| 5 | | 写入 | 批量创建订单(最多20笔) |
| 6 | | 写入 | 批量取消订单(最多30笔) |
| 7 | | 写入 | 创建TWAP订单(时间加权执行) |
| 8 | | 读取 | 查询TWAP订单历史 |
| 9 | | 写入 | 取消活跃的TWAP订单 |
查询多个订单: 当用户要求同时查询两个或多个订单号时,使用或trade list --order-ids id1,id2(MCP的--client-order-ids id1,id2接口,传入trade_get_orders/order_ids数组)——单次调用最多支持100个ID;如需查询更多,拆分为100个ID一批次。请勿针对每个ID重复调用client_order_ids。服务器默认trade get;如需包含已完成/已取消订单,添加state=wait。--states wait,done,cancel状态不能与watch/wait/done混合查询(需单独使用cancel查询);--state watch/--state不能同时使用。--states
如需完整参数详情,请加载下方步骤1中的参考文件。
Operation Flow
操作流程
Step 0 — Credential Check
步骤0 — 凭证检查
See Credential Check above before any authenticated command.
🛑 Mandatory Pre-flight Checklist —
/trade place/batch-placetwap placeBefore any write order, run all of the following in order. Do not skip even if the user says "just buy it". Stop and ask for explicit user confirmation between step 3 and step 4.
# Command Purpose 0 bithumb config show --jsonRead-only gate (run first). Read the effective profile's . Ifread_only, stop here — do not run steps 1–2. List write-capable profiles and ask the user to re-run withtrue(never bypass read-only — do not auto-select a profile, switch profiles, or disable--profile <name>yourself). Once-per-session: skip if already checked. See read-only-gate.md.read_only1 bithumb account order-chance --market <m>Confirm available balance, fee rate, min/max order size 2 bithumb market ticker <m>Confirm current price (vs. user's intended price) 3 (for batch) read the JSON file aloud back to the user; (for TWAP) compute slice count = and check against minimum order size from step 1duration/frequency3b For every order, check the price against the price tick — regardless of whether it was calculated, derived by percentage, or stated directly by the user (e.g. "buy at 123,456"). If not tick-aligned, round to the nearest valid tick using the order-commands.md price tick table, and display both original and adjusted values in step 4. Skip only when already tick-aligned.limit4 🤚 Stop. Ask user to confirm: market, side, order_type, price, volume, total notional 5 (orbithumb trade place --order-type .../batch-place)twap placeExecute 6 (orbithumb trade get --order-id <id>,trade list)twap listVerify state Mirrored in bithumb-account Cross-Skill Workflows.
执行任何认证命令前,请先参考上方的凭证检查部分。
🛑 强制前置检查清单 —
/trade place/batch-placetwap place在执行任何写入订单操作前,请按顺序运行以下所有步骤。即使用户说“直接买”也请勿跳过。在步骤3和步骤4之间停止并请求用户明确确认。
# 命令 目的 0 bithumb config show --json只读限制检查(首先运行)。读取当前生效配置文件的 参数。如果为read_only,在此停止——不要运行步骤1–2。列出具备写入权限的配置文件,并要求用户使用true重新运行(绝不绕过只读限制——请勿自动选择配置文件、切换配置文件或自行禁用--profile <name>)。每个会话只需检查一次:如果已检查过则跳过。参考read-only-gate.md。read_only1 bithumb account order-chance --market <m>确认可用余额、手续费率、订单最小/最大规模 2 bithumb market ticker <m>确认当前价格(与用户预期价格对比) 3 (批量订单)向用户大声读出JSON文件内容;(TWAP订单)计算切片数量 = ,并与步骤1中的最小订单规模进行核对duration/frequency3b 对于所有 订单,无论价格是计算得出、按百分比推导还是用户直接指定的,都必须检查价格是否符合价格最小变动单位(例如“以123,456价格买入”)。如果不符合,使用order-commands.md价格最小变动单位表四舍五入至最近的有效单位,并在步骤4中显示原始值和调整后的值。仅当已符合时跳过此步骤。limit4 🤚 停止操作,请求用户确认:市场、方向、订单类型、价格、数量、总金额 5 (或bithumb trade place --order-type .../batch-place)twap place执行订单 6 (或bithumb trade get --order-id <id>,trade list)twap list验证订单状态 此流程也在bithumb-account跨技能工作流中有镜像说明。
Step 1 — Identify order type and load reference
步骤1 — 确定订单类型并加载参考文件
| User intent | Reference to load |
|---|---|
| Single order: place, cancel, query | |
| Batch orders: place or cancel multiple | |
| TWAP orders: time-weighted execution | |
| 用户意图 | 需加载的参考文件 |
|---|---|
| 单笔订单:创建、取消、查询 | |
| 批量订单:创建或取消多笔订单 | |
| TWAP订单:时间加权执行 | |
Step 2 — Confirm write parameters
步骤2 — 确认写入参数
Reads (/, ): run immediately, no confirmation.
trade getlisttwap listWrites (place, cancel, batch, TWAP): first apply the read-only gate (skip if already checked this session), then confirm key details once:
- Place: ,
--market,--side(canonical;--order-typeis a deprecated alias),--ord-type/--volume--price - Cancel: or
--order-id--client-order-id - Batch place / cancel: all orders / order IDs in the batch
- TWAP place: ,
--market,--side,--duration, total amount--frequency
读取操作(/, ):立即执行,无需确认。
trade getlisttwap list写入操作(创建、取消、批量、TWAP):首先应用只读限制(如果本次会话已检查过则跳过),然后确认关键信息:
- 创建订单:、
--market、--side(标准参数;--order-type为已弃用别名)、--ord-type/--volume--price - 取消订单:或
--order-id--client-order-id - 批量创建/取消:批量中的所有订单/订单ID
- 创建TWAP订单:、
--market、--side、--duration、总金额--frequency
Step 3 — Verify after writes
步骤3 — 写入操作后验证
- After :
trade placeto confirm statusbithumb trade get --order-id <id> - After :
trade cancelto confirm cancellationbithumb trade list - After :
batch-placeto confirm all ordersbithumb trade list - After :
twap placeto confirm TWAP is activebithumb twap list
- 执行后:运行
trade place确认状态bithumb trade get --order-id <id> - 执行后:运行
trade cancel确认已取消bithumb trade list - 执行后:运行
batch-place确认所有订单状态bithumb trade list - 执行后:运行
twap place确认TWAP订单已激活bithumb twap list
Step 4 — Handling order_not_found
order_not_found步骤4 — 处理order_not_found
错误
order_not_foundWhen or returns , always confirm state with a direct single lookup , not a query — can miss the order by exceeding the limit or omitting the market filter.
trade cancelbatch-cancelorder_not_foundtrade get --order-id <id>trade listtrade list --state done/cancel --limit NOn a failed single cancel, run :
bithumb trade get --order-id <id>- → tell the user (in Korean):
state: done"이미 체결된 주문입니다. 취소 불가합니다." - → tell the user (in Korean):
state: cancel"이미 취소된 주문입니다." - lookup itself fails () → apply Step 5 (ID routing fallback).
order_not_found
On partial batch-cancel failures, run per failed id, or look them up together with .
trade get --order-id <id>bithumb trade list --order-ids id1,id2,... --states wait,done,cancel当或返回时,始终通过直接单次查询确认状态,而非查询——可能因超出限制或未设置市场筛选条件而遗漏订单。
trade cancelbatch-cancelorder_not_foundtrade get --order-id <id>trade listtrade list --state done/cancel --limit N如果单笔取消失败,运行:
bithumb trade get --order-id <id>- → 用韩语告知用户:
state: done"이미 체결된 주문입니다. 취소 불가합니다." - → 用韩语告知用户:
state: cancel"이미 취소된 주문입니다." - 查询本身失败()→ 执行步骤5(ID路由回退)。
order_not_found
如果批量取消部分失败,针对每个失败的ID运行,或使用批量查询。
trade get --order-id <id>bithumb trade list --order-ids id1,id2,... --states wait,done,cancelStep 5 — order_id
↔ client_order_id
routing fallback
order_idclient_order_id步骤5 — order_id
↔ client_order_id
路由回退
order_idclient_order_idA Bithumb has a format constraint (1–36 chars; letters, digits, hyphens, underscores only), but within that constraint a user can make one identical to a Bithumb pattern ( prefix + digits, e.g. ) — uses the same character set. You cannot tell the two identifiers apart from the input string alone, so do not guess.
client_order_idorder_idCC0101000000002157190order_idFor single-order or :
trade gettrade cancel- If the user explicitly names a → run with
client-order-idimmediately. No fallback.--client-order-id - Otherwise (user just says "order ID" / "order number", or gives an id alone):
- (1st) run with first.
--order-id <value> - (2nd) if no result (/ 404), retry the same value with
order_not_found.--client-order-id <value> - (both fail) tell the user (in Korean):
"이 ID가 현재 계정의 주문이 아니거나, 잘못된 ID이거나, client-order-id 형식이지만 등록되지 않은 값일 수 있습니다."
- (1st) run with
- If the 2nd attempt matches, add a one-line note above the result (in Korean): , so the user knows their input was actually a client_order_id.
"client-order-id로 매칭됨"
The CLI core does not auto-fallback. The fallback is this guide's (the agent's) responsibility, done as two explicit calls. A direct CLI user who passesruns as-is and gets the 404 verbatim.--order-id
Bithumb的有格式限制(1–36字符;仅允许字母、数字、连字符、下划线),但用户可以设置与Bithumb格式相同的(以开头+数字,例如)——使用相同字符集。无法仅通过输入字符串区分这两种标识符,因此请勿猜测。
client_order_idorder_idclient_order_idCC0101000000002157190order_id针对单笔订单的或操作:
trade gettrade cancel- 如果用户明确指定为→ 立即使用
client-order-id参数执行。无回退逻辑。--client-order-id - 其他情况(用户仅说“订单ID”/“订单号”,或仅提供一个ID):
- (第一次尝试) 首先使用执行。
--order-id <value> - (第二次尝试) 如果无结果(/ 404),使用同一值以
order_not_found重试。--client-order-id <value> - (两次均失败) 用韩语告知用户:
"이 ID가 현재 계정의 주문이 아니거나, 잘못된 ID이거나, client-order-id 형식이지만 등록되지 않은 값일 수 있습니다."
- (第一次尝试) 首先使用
- 如果第二次尝试匹配成功,在结果上方添加一行韩语说明:,让用户知道他们输入的实际上是client_order_id。
"client-order-id로 매칭됨"
CLI核心不支持自动回退。 回退逻辑是本指南(Agent)的责任,需通过两次显式调用实现。直接使用CLI的用户如果传入参数,将按原参数执行并直接返回404错误。--order-id
Edge Cases
边缘情况
- Order types: requires
limit+--price;--volume= market buy,priceis the total KRW to spend (no volume);--price= market sell,marketis the coin quantity (no price).--volume - Side: = buy,
bid= sell.ask - Market code: (quote-base), not
KRW-BTC.BTC-KRW - Batch limits: max 20 per , max 30 per
batch-place.batch-cancel - TWAP: duration 300–43200 s (5 min–12 h); frequency one of ,
15,20,30,60s.120 - Client order ID: optional . Constraint (server-enforced): 1–36 chars; letters, digits, hyphens (
--client-order-id), underscores (-) only. Over-length or other characters →_; surface this before calling.invalid_parameter - Order states: (open),
wait(reserved),watch(filled),done(cancelled).cancel - Spot-only: no leverage, margin, futures, or options.
- 订单类型:订单需要
limit+--price;--volume为市价买入,price是要花费的总韩元金额(无需数量);--price为市价卖出,market是加密货币数量(无需价格)。--volume - 方向:= 买入,
bid= 卖出。ask - 市场代码:(计价货币-基础货币),而非
KRW-BTC。BTC-KRW - 批量限制:最多20笔,
batch-place最多30笔。batch-cancel - TWAP:持续时间300–43200秒(5分钟–12小时);频率可选、
15、20、30、60秒。120 - 客户端订单ID:可选参数。服务器强制格式限制:1–36字符;仅允许字母、数字、连字符(
--client-order-id)、下划线(-)。超出长度或包含其他字符→_;调用前需向用户说明此限制。invalid_parameter - 订单状态:(待成交)、
wait(预留)、watch(已成交)、done(已取消)。cancel - 仅支持现货:不支持杠杆、保证金、期货或期权。
Global Notes
全局说明
- When you query orders (/
trade list) and present the result to the user, always include each order'strade get— they need it to look up or cancel the order later.order_id - All write commands require valid API credentials. Bithumb has no demo mode — every order is real funds, so always verify details before placing.
- Add to any command for the raw Bithumb API response.
--json - Review past operations with (in
bithumb system audit).bithumb-system
- 当您查询订单(/
trade list)并向用户展示结果时,务必包含每个订单的trade get——用户后续需要用它来查询或取消订单。order_id - 所有写入命令都需要有效的API凭证。Bithumb无演示模式——所有订单均使用真实资金,因此创建订单前务必验证所有细节。
- 在任何命令后添加参数可获取Bithumb API的原始响应。
--json - 使用(属于
bithumb system audit技能)查看过往操作记录。bithumb-system