用途:在 HTX 现货市场执行下单、撤单、订单查询与杠杆借币等操作,通过 htx-cli 命令行调用现货 API。
主要能力:共 11 个端点。写操作包括单个下单(限价/市价/止盈止损/IOC/FOK)、批量下单(最多 10 笔)、按订单 ID 或 client-order-id 撤单、批量撤单、按交易对撤销全部挂单,以及杠杆借币。读操作包括查询当前挂单、单笔订单详情、历史订单与历史成交明细。
使用方式:需 API Key,交易类操作需 trade 权限,部分查询仅需 read 权限,密钥仅在本地使用。下单核心参数含 account-id、symbol、type、amount、price、client-order-id、source。限价单必须带 price;市价买单 amount 为计价币(USDT)金额,市价卖单为基准币数量;IOC 未成交部分撤销,FOK 需全部成交。示例:htx-cli spot trading place --account-id <id> --symbol btcusdt --type buy-limit --price 65000 --amount 0.001 --json;撤单 htx-cli spot trading cancel <order-id> --json;查询挂单 htx-cli spot trading open-orders --symbol btcusdt --json。安装:curl -fsSL https://github.com/htx-exchange/htx-skills-hub/releases/latest/download/install.sh | bash -s -- spot-trading。
限制与安全:属高风险写技能,每次下单、撤单、借币前须展示完整参数(交易对、方向、类型、价格、数量、预估成交额、参考盘口价)并等待用户明确确认后才调用 API;撤单需展示订单 ID、剩余数量与价格,批量撤单需展示影响笔数与交易对;借币需展示币种、金额、当前利率与风险,并建议先查余额确认是否必要。常见错误:account-frozen 需停止操作;order-amountmin-error 需查 min-order-amt;order-pricemin-error 需查 price-precision;限速约 10 单/秒,失败可退避 1 秒重试。