htx-futures-account
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHTX USDT-M Futures Account
HTX USDT本位合约账户
USDT-M futures account / position query + internal transfers. Requires API key (read permission). Transfers are low risk — funds stay inside HTX.
USDT本位合约账户/持仓查询+内部划转。需要API密钥(读取权限)。划转风险极低——资金始终在HTX平台内流转。
When to use this skill
何时使用该技能
- "What BTC perp positions do I have? Entry price? PnL?"
- "How much available margin on my cross account?"
- "Show my sub-accounts' positions"
- "What's my max leverage for ETH-USDT?"
- "Move 500 USDT from main to sub-account"
- "我持有哪些BTC永续合约持仓?入场价是多少?盈亏如何?"
- "我的全仓账户可用保证金有多少?"
- "展示我的子账户持仓情况"
- "ETH-USDT合约的最大杠杆是多少?"
- "将500 USDT从主账户划转至子账户"
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>Read permission is enough for 26 of 30 endpoints. Transfers (4) need write.
基于驱动。可执行文件需在或路径下。始终使用参数。
htx-cli$PATH$HTX_CLI_BIN--jsonbash
htx-cli config set-key <AccessKeyId>
htx-cli config set-secret <SecretKey>30个接口中,26个仅需读取权限。划转相关的4个接口需要写入权限。
Endpoint catalog (30)
接口目录(共30个)
All paths in this skill have base unless noted. "Mode" column: = isolated (逐仓), = cross (全仓), = either.
/linear-swap-apiIC*本技能中所有接口路径的基础地址为,另有标注除外。“模式”列: = 逐仓, = 全仓, = 两者均可。
/linear-swap-apiIC*Account & position query — read (8)
账户与持仓查询——只读(8个)
| # | Method | Path | CLI invocation | Mode |
|---|---|---|---|---|
| 1 | POST | | | I |
| 2 | POST | | | C |
| 3 | POST | | | I |
| 4 | POST | | | C |
| 5 | POST | | | I |
| 6 | POST | | | C |
| 7 | POST | | | * |
| 8 | POST | | | * |
| # | 请求方法 | 路径 | CLI调用方式 | 模式 |
|---|---|---|---|---|
| 1 | POST | | | I |
| 2 | POST | | | C |
| 3 | POST | | | I |
| 4 | POST | | | C |
| 5 | POST | | | I |
| 6 | POST | | | C |
| 7 | POST | | | * |
| 8 | POST | | | * |
Leverage & limit query — read (10)
杠杆与限额查询——只读(10个)
| # | Method | Path | CLI invocation | Mode |
|---|---|---|---|---|
| 1 | POST | | | I |
| 2 | POST | | | C |
| 3 | POST | | | * |
| 4 | POST | | | * |
| 5 | POST | | | I |
| 6 | POST | | | C |
| 7 | POST | | | I |
| 8 | POST | | | C |
| 9 | POST | | | I |
| 10 | POST | | | C |
| # | 请求方法 | 路径 | CLI调用方式 | 模式 |
|---|---|---|---|---|
| 1 | POST | | | I |
| 2 | POST | | | C |
| 3 | POST | | | * |
| 4 | POST | | | * |
| 5 | POST | | | I |
| 6 | POST | | | C |
| 7 | POST | | | I |
| 8 | POST | | | C |
| 9 | POST | | | I |
| 10 | POST | | | C |
Sub-account management — read (8)
子账户管理——只读(8个)
| # | Method | Path | CLI invocation | Mode |
|---|---|---|---|---|
| 1 | POST | | | * |
| 2 | POST | | | I |
| 3 | POST | | | C |
| 4 | POST | | | I |
| 5 | POST | | | C |
| 6 | POST | | | I |
| 7 | POST | | | C |
| 8 | POST | | | * |
| # | 请求方法 | 路径 | CLI调用方式 | 模式 |
|---|---|---|---|---|
| 1 | POST | | | * |
| 2 | POST | | | I |
| 3 | POST | | | C |
| 4 | POST | | | I |
| 5 | POST | | | C |
| 6 | POST | | | I |
| 7 | POST | | | C |
| 8 | POST | | | * |
Transfer & misc (4)
划转及其他(4个)
| # | Method | Path | CLI invocation | RW |
|---|---|---|---|---|
| 1 | POST | | | W |
| 2 | POST | | | R |
| 3 | POST | | | W |
| 4 | GET | | | R |
| # | 请求方法 | 路径 | CLI调用方式 | 权限 |
|---|---|---|---|---|
| 1 | POST | | | 写入 |
| 2 | POST | | | 读取 |
| 3 | POST | | | 写入 |
| 4 | GET | | | 读取 |
Typical workflow
典型工作流程
Show position for a contract
查看某合约的持仓情况
bash
htx-cli futures account position-info --contract-code BTC-USDT --json
htx-cli futures account info --contract-code BTC-USDT --json # margin / balanceReport:
- Direction (long/short), size, entry price, mark price, unrealized PnL
- Leverage, position-margin, liquidation price
bash
htx-cli futures account position-info --contract-code BTC-USDT --json
htx-cli futures account info --contract-code BTC-USDT --json # 保证金/余额返回信息:
- 方向(多/空)、持仓量、入场价、标记价、未实现盈亏
- 杠杆、持仓保证金、强平价格
Master → sub transfer (write)
主账户→子账户划转(写入权限)
Before calling, confirm with user:
- From UID → To UID
- Currency ()
usdt - Amount
- Direction (/
master_to_sub)sub_to_master
调用前需与用户确认:
- 转出UID → 转入UID
- 币种()
usdt - 金额
- 方向(/
master_to_sub)sub_to_master
Safety
安全说明
- Read endpoints: free to call.
- Transfer endpoints (2 of 30): must present full transfer preview and wait for explicit user confirmation.
- Do not log secrets. Use once.
htx-cli config set-secret
- 只读接口:可自由调用。
- 划转接口(30个中的2个):必须展示完整划转预览并等待用户明确确认。
- 请勿记录密钥。只需调用一次完成配置。
htx-cli config set-secret
References
参考文档
references/authentication.md
references/authentication.md