htx-futures-trading
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHTX USDT-M Futures Trading
HTX USDT本位永续合约交易
USDT-margined perpetual futures trading. HIGH RISK. Leverage amplifies losses — liquidation can wipe a position. Every write operation must be confirmed by the user before execution.
USDT保证金永续合约交易。高风险提示。杠杆会放大亏损——强制平仓可能导致持仓全部清零。所有写入操作执行前必须经用户确认。
When to use this skill
何时使用该技能
- "Open a 10x long on BTC-USDT cross at 85000"
- "Close all my ETH perp positions"
- "Flash-close my BTC position"
- "Set TP 90000 / SL 82000 on my BTC long"
- "Place a trigger order to open short if BTC drops to 80000"
- "Change my leverage from 10x to 20x"
- "Cancel all my open orders and strategy orders"
- "在BTC-USDT全仓模式下开10倍多单,价格85000"
- "平仓我所有的ETH永续合约持仓"
- "闪电平仓我的BTC持仓"
- "为我的BTC多单设置止盈90000 / 止损82000"
- "设置触发单,当BTC跌至80000时开空单"
- "将我的杠杆从10倍调整为20倍"
- "撤销我所有的挂单和策略单"
Underlying tool
底层工具
Drives . Binary on or . Always .
htx-cli$PATH$HTX_CLI_BIN--jsonbash
htx-cli config set-key <AccessKeyId>
htx-cli config set-secret <SecretKey>Key must have trade permission. Futures base URL defaults to .
https://api.hbdm.com基于驱动。二进制文件需在或路径下。始终使用参数。
htx-cli$PATH$HTX_CLI_BIN--jsonbash
htx-cli config set-key <AccessKeyId>
htx-cli config set-secret <SecretKey>密钥必须拥有交易权限。期货基础URL默认值为。
https://api.hbdm.comMandatory confirmation flow
强制确认流程
Before any write, present to the user:
| Field | Value |
|---|---|
| Action | place / cancel / cancel-all / flash-close / leverage-change / position-mode / trigger / TP-SL |
| Contract | e.g. |
| Mode | isolated / cross |
| Direction | buy (long) / sell (short); open / close |
| Quantity | contracts |
| Order type | limit / market / post-only / FOK / IOC |
| Price | limit price, omit for market |
| Leverage | current and new (when changing) |
| Estimated liquidation price | critical for user to see before confirming |
Require an explicit "yes" / "confirm". For batch cancels, list IDs first. For flash-close, show current unrealized PnL.
在任何写入操作执行前,需向用户展示以下信息:
| 字段 | 内容 |
|---|---|
| 操作类型 | 下单/撤单/全部撤单/闪电平仓/调整杠杆/切换持仓模式/触发单/止盈止损单 |
| 合约 | 例如: |
| 模式 | 逐仓/全仓 |
| 方向 | 买入(多)/卖出(空);开仓/平仓 |
| 数量 | 合约张数 |
| 订单类型 | 限价/市价/只做maker/立即成交剩余撤销/立即全部成交否则撤销 |
| 价格 | 限价价格,市价单可省略 |
| 杠杆 | 当前杠杆与新杠杆(调整杠杆时) |
| 预估强平价格 | 用户确认前必须查看的关键信息 |
需用户明确回复"yes"或"confirm"确认。批量撤单时,需先列出订单ID。闪电平仓时,需展示当前未实现盈亏。
Endpoint catalog (50)
端点目录(50个)
All paths base at . Mode column: = isolated, = cross, = both / general.
/linear-swap-apiIC*所有路径均基于。模式列:=逐仓,=全仓,=通用/两者皆可。
/linear-swap-apiIC*Base orders & position controls (14)
基础订单与持仓控制(14个)
| # | Method | Path | CLI | Mode | RW |
|---|---|---|---|---|---|
| 1 | POST | | | I | W |
| 2 | POST | | | C | W |
| 3 | POST | | | C | W |
| 4 | POST | | | I | W |
| 5 | POST | | | C | W |
| 6 | POST | | | I | W |
| 7 | POST | | | C | W |
| 8 | POST | | | I | W |
| 9 | POST | | | C | W |
| 10 | POST | | | I | W |
| 11 | POST | | | C | W |
| 12 | POST | | | I | W |
| 13 | POST | | | C | W |
| 14 | POST | | | * | W |
| # | 请求方法 | 路径 | CLI命令 | 模式 | 读写 |
|---|---|---|---|---|---|
| 1 | POST | | | I | W |
| 2 | POST | | | C | W |
| 3 | POST | | | C | W |
| 4 | POST | | | I | W |
| 5 | POST | | | C | W |
| 6 | POST | | | I | W |
| 7 | POST | | | C | W |
| 8 | POST | | | I | W |
| 9 | POST | | | C | W |
| 10 | POST | | | I | W |
| 11 | POST | | | C | W |
| 12 | POST | | | I | W |
| 13 | POST | | | C | W |
| 14 | POST | | | * | W |
Order queries — read (16)
订单查询——只读(16个)
| # | Method | Path | CLI | Mode |
|---|---|---|---|---|
| 1 | POST | | | C |
| 2 | POST | | | I |
| 3 | POST | | | C |
| 4 | POST | | | I |
| 5 | POST | | | C |
| 6 | POST | | | I |
| 7 | POST | | | C |
| 8 | POST | | | I |
| 9 | POST | | | C |
| 10 | POST | | | I |
| 11 | POST | | | C |
| 12 | POST | | | I |
| 13 | POST | | | C |
| 14 | POST | | | I |
| 15 | POST | | | C |
| 16 | GET | | | * |
| # | 请求方法 | 路径 | CLI命令 | 模式 |
|---|---|---|---|---|
| 1 | POST | | | C |
| 2 | POST | | | I |
| 3 | POST | | | C |
| 4 | POST | | | I |
| 5 | POST | | | C |
| 6 | POST | | | I |
| 7 | POST | | | C |
| 8 | POST | | | I |
| 9 | POST | | | C |
| 10 | POST | | | I |
| 11 | POST | | | C |
| 12 | POST | | | I |
| 13 | POST | | | C |
| 14 | POST | | | I |
| 15 | POST | | | C |
| 16 | GET | | | * |
Trigger orders (10)
触发单(10个)
| # | Method | Path | CLI | Mode | RW |
|---|---|---|---|---|---|
| 1 | POST | | | I | W |
| 2 | POST | | | C | W |
| 3 | POST | | | I | W |
| 4 | POST | | | C | W |
| 5 | POST | | | I | W |
| 6 | POST | | | C | W |
| 7 | POST | | | I | R |
| 8 | POST | | | C | R |
| 9 | POST | | | I | R |
| 10 | POST | | | C | R |
| # | 请求方法 | 路径 | CLI命令 | 模式 | 读写 |
|---|---|---|---|---|---|
| 1 | POST | | | I | W |
| 2 | POST | | | C | W |
| 3 | POST | | | I | W |
| 4 | POST | | | C | W |
| 5 | POST | | | I | W |
| 6 | POST | | | C | W |
| 7 | POST | | | I | R |
| 8 | POST | | | C | R |
| 9 | POST | | | I | R |
| 10 | POST | | | C | R |
TP / SL orders (10)
止盈止损单(10个)
| # | Method | Path | CLI | Mode | RW |
|---|---|---|---|---|---|
| 1 | POST | | | I | W |
| 2 | POST | | | C | W |
| 3 | POST | | | I | W |
| 4 | POST | | | C | W |
| 5 | POST | | | I | W |
| 6 | POST | | | C | W |
| 7 | POST | | | I | R |
| 8 | POST | | | C | R |
| 9 | POST | | | I | R |
| 10 | POST | | | C | R |
| # | 请求方法 | 路径 | CLI命令 | 模式 | 读写 |
|---|---|---|---|---|---|
| 1 | POST | | | I | W |
| 2 | POST | | | C | W |
| 3 | POST | | | I | W |
| 4 | POST | | | C | W |
| 5 | POST | | | I | W |
| 6 | POST | | | C | W |
| 7 | POST | | | I | R |
| 8 | POST | | | C | R |
| 9 | POST | | | I | R |
| 10 | POST | | | C | R |
Safety checklist
安全检查清单
Before every write:
- Fetch current mark price from skill.
futures-market - Show: contract, direction, offset (open/close), volume, price, leverage.
- Compute and show the estimated liquidation price for the resulting position.
- For leverage changes: show old → new and the new liquidation price.
- For flash-close: show current position size and unrealized PnL.
- For batch / cancel-all: list the order IDs first.
- For TP/SL: show the trigger price and its distance from current mark.
- Wait for explicit user confirmation ("yes" / "confirm").
- Execute and report the JSON response.
每次写入操作前:
- 从技能获取当前标记价格。
futures-market - 展示:合约、方向、开平、数量、价格、杠杆。
- 计算并展示持仓后的预估强平价格。
- 调整杠杆时:展示旧杠杆→新杠杆以及新的强平价格。
- 闪电平仓时:展示当前持仓量和未实现盈亏。
- 批量/全部撤单时:先列出订单ID。
- 止盈止损单:展示触发价格及其与当前标记价格的差值。
- 等待用户明确确认("yes" / "confirm")。
- 执行操作并返回JSON响应。
Typical session — open long
典型会话——开多单
bash
undefinedbash
undefined1. Price check
1. 价格查询
htx-cli futures market funding-rate BTC-USDT --json
htx-cli futures market funding-rate BTC-USDT --json
2. Current position / available
2. 当前持仓/可用资金
htx-cli futures account info --contract-code BTC-USDT --json
htx-cli futures account info --contract-code BTC-USDT --json
3. User confirms preview, then:
3. 用户确认预览后,执行:
htx-cli futures order place
--contract-code BTC-USDT --direction buy --offset open
--lever-rate 10 --volume 1 --price 85000
--order-price-type limit --json
--contract-code BTC-USDT --direction buy --offset open
--lever-rate 10 --volume 1 --price 85000
--order-price-type limit --json
htx-cli futures order place
--contract-code BTC-USDT --direction buy --offset open
--lever-rate 10 --volume 1 --price 85000
--order-price-type limit --json
--contract-code BTC-USDT --direction buy --offset open
--lever-rate 10 --volume 1 --price 85000
--order-price-type limit --json
4. Monitor
4. 监控订单
htx-cli futures order list --contract-code BTC-USDT --json
undefinedhtx-cli futures order list --contract-code BTC-USDT --json
undefinedReferences
参考资料
references/authentication.md- — order types, trigger/TPSL field layout
references/order-types.md
references/authentication.md- — 订单类型、触发单/止盈止损单字段布局
references/order-types.md