一键导入
htx-futures-trading
HTX USDT-M perpetual futures order management — open / close / TP/SL / trigger orders / modify / cancel.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
HTX USDT-M perpetual futures order management — open / close / TP/SL / trigger orders / modify / cancel.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Multi-signal pressure analysis on HTX USDT-M perpetuals — combines funding rate, OI, elite long/short ratio, recent liquidations, and basis into a unified pressure score with squeeze-risk verdict. Public, no API key required.
Top-trader long/short ratio on HTX USDT-M perpetuals — both account-based and position-based ratios, the core sentiment signal that distinguishes "smart money" from retail. Public, no API key.
HTX USDT-M perpetual funding rate — current / market-wide batch / history / estimated next-period klines.
HTX USDT-M perpetual futures account — balance / positions / leverage tiers / adjustment factors / unified account type switching.
HTX USDT-M perpetual futures core market data — contract info / klines / ticker / order book / index price / system status.
Query HTX USDT-M perpetual liquidation orders — recent forced-liquidation events for long/short squeeze monitoring and cluster detection. Public, no API key required.
| name | htx/futures-trading |
| version | 2.0.0 |
| description | HTX USDT-M perpetual futures order management — open / close / TP/SL / trigger orders / modify / cancel. |
| auth | true |
| risk | high |
Place, cancel, modify orders, set TP/SL and trigger orders, and close positions on USDT-M perpetual futures.
WARNING: Extremely high-risk write skill. Perpetual futures use leverage; an erroneous order can cause rapid loss or liquidation. Every action must require manual confirmation before execution.
Path base
/linear-swap-api.cross_prefix = cross-margin; no prefix = isolated.
| Method | Path | Description |
|---|---|---|
| POST | /v1/swap_order | Isolated single order |
| POST | /v1/swap_cross_order | Cross-margin single order |
| POST | /v1/swap_batchorder | Isolated batch orders (max 10) |
| POST | /v1/swap_cross_batchorder | Cross-margin batch orders |
| Method | Path | Description |
|---|---|---|
| POST | /v1/swap_cancel | Isolated single cancel |
| POST | /v1/swap_cross_cancel | Cross-margin single cancel |
| POST | /v1/swap_cancelall | Isolated cancel all |
| POST | /v1/swap_cross_cancelall | Cross-margin cancel all |
| Method | Path |
|---|---|
| POST | /v1/swap_switch_lever_rate (change leverage) |
| POST | /v1/swap_cross_switch_lever_rate |
| Method | Path | Description |
|---|---|---|
| POST | /v1/swap_tpsl_order | Isolated TP/SL |
| POST | /v1/swap_cross_tpsl_order | Cross-margin TP/SL |
| POST | /v1/swap_tpsl_cancel | Cancel TP/SL |
| POST | /v1/swap_cross_tpsl_cancel | Cancel cross-margin TP/SL |
| POST | /v1/swap_track_order | Trailing stop order |
| POST | /v1/swap_cross_track_order | Cross-margin trailing stop |
| Method | Path |
|---|---|
| POST | /v1/swap_trigger_order |
| POST | /v1/swap_cross_trigger_order |
| POST | /v1/swap_trigger_cancel |
| POST | /v1/swap_cross_trigger_cancel |
| POST | /v1/swap_trigger_cancelall |
| POST | /v1/swap_cross_trigger_cancelall |
| Method | Path | Description |
|---|---|---|
| POST | /v1/swap_lightning_close_position | Isolated lightning close |
| POST | /v1/swap_cross_lightning_close_position | Cross-margin lightning close |
| Method | Path |
|---|---|
| POST | /v1/swap_openorders (isolated open orders) |
| POST | /v1/swap_cross_openorders (cross-margin open orders) |
| POST | /v1/swap_order_info (single order info) |
| POST | /v1/swap_cross_order_info |
| POST | /v1/swap_order_detail (order detail) |
| POST | /v1/swap_cross_order_detail |
| POST | /v1/swap_hisorders (historical orders) |
| POST | /v1/swap_cross_hisorders |
| POST | /v1/swap_matchresults (trade detail) |
| POST | /v1/swap_cross_matchresults |
| POST | /v1/swap_hisorders_exact (exact query) |
| POST | /v1/swap_cross_hisorders_exact |
| POST | /v3/swap_hisorders_exact |
| POST | /v3/swap_cross_hisorders_exact |
| POST | /v3/swap_matchresults_exact |
| POST | /v3/swap_cross_matchresults_exact |
| POST | /v1/swap_tpsl_openorders |
| POST | /v1/swap_cross_tpsl_openorders |
| POST | /v1/swap_tpsl_hisorders |
| POST | /v1/swap_cross_tpsl_hisorders |
| POST | /v1/swap_relation_tpsl_order |
{
"contract_code": "BTC-USDT",
"direction": "buy | sell",
"offset": "open | close",
"lever_rate": 10,
"order_price_type": "limit | post_only | optimal_5 | optimal_10 | optimal_20 | ioc | fok | opponent | lightning",
"price": "65000",
"volume": 1,
"client_order_id": <int64 optional>,
"tp_trigger_price": "70000",
"tp_order_price": "70100",
"sl_trigger_price": "62000",
"sl_order_price": "61900"
}
direction + offset combinations:
buy + open = open longsell + open = open shortbuy + close = close shortsell + close = close longvolume unit: contracts (BTC-USDT 1 contract = 0.001 BTC; check contract_size)# 1. First check contract_size: BTC-USDT = 0.001 BTC per contract
htx-cli futures-market contract-info -p contract_code=BTC-USDT
# 0.1 BTC = 100 contracts
# 2. Place order (open long)
htx-cli futures call /v1/swap_cross_order --auth \
--body '{
"contract_code": "BTC-USDT",
"direction": "buy",
"offset": "open",
"lever_rate": 10,
"order_price_type": "optimal_5",
"volume": 100
}' --json
htx-cli futures call /v1/swap_cross_tpsl_order --auth \
--body '{
"contract_code": "BTC-USDT",
"direction": "sell",
"tp_trigger_price": "70000",
"tp_order_price": "70100",
"tp_order_price_type": "limit",
"sl_trigger_price": "62000",
"sl_order_price": "61900",
"sl_order_price_type": "limit",
"volume": 100
}' --json
# Lightning close (market order)
htx-cli futures call /v1/swap_cross_lightning_close_position --auth \
--body '{
"contract_code": "SOL-USDT",
"direction": "sell"
}' --json
htx-cli futures call /v1/swap_cross_cancelall --auth \
--body '{"contract_code":"BTC-USDT"}' --json
Before every order, the AI Agent MUST:
For every close / lightning close:
For every leverage change:
position-empty — no position, cannot closevolume-precision-error — contracts must be integerlever-rate-too-high — exceeds the contract's leverage tier capavailable-margin-insufficient — insufficient margin; transfer in more USDT or lower leveragecurl -fsSL https://github.com/htx-exchange/htx-skills-hub/releases/latest/download/install.sh | bash -s -- futures-trading