htx-futures-account

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

HTX 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
htx-cli
. Binary on
$PATH
or
$HTX_CLI_BIN
. Always
--json
.
bash
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
路径下。始终使用
--json
参数。
bash
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
/linear-swap-api
unless noted. "Mode" column:
I
= isolated (逐仓),
C
= cross (全仓),
*
= either.
本技能中所有接口路径的基础地址为
/linear-swap-api
,另有标注除外。“模式”列:
I
= 逐仓,
C
= 全仓,
*
= 两者均可。

Account & position query — read (8)

账户与持仓查询——只读(8个)

#MethodPathCLI invocationMode
1POST
/v1/swap_account_info
htx-cli futures account info [--contract-code <c>] --json
I
2POST
/v1/swap_cross_account_info
htx-cli futures call POST /linear-swap-api/v1/swap_cross_account_info --json
C
3POST
/v1/swap_position_info
htx-cli futures account position-info [--contract-code <c>] --json
I
4POST
/v1/swap_cross_position_info
htx-cli futures call POST /linear-swap-api/v1/swap_cross_position_info --json
C
5POST
/v1/swap_account_position_info
htx-cli futures call POST /linear-swap-api/v1/swap_account_position_info --json
I
6POST
/v1/swap_cross_account_position_info
htx-cli futures call POST /linear-swap-api/v1/swap_cross_account_position_info --json
C
7POST
/v3/swap_financial_record
htx-cli futures call POST /linear-swap-api/v3/swap_financial_record --json
*
8POST
/v3/swap_financial_record_exact
htx-cli futures call POST /linear-swap-api/v3/swap_financial_record_exact --json
*
#请求方法路径CLI调用方式模式
1POST
/v1/swap_account_info
htx-cli futures account info [--contract-code <c>] --json
I
2POST
/v1/swap_cross_account_info
htx-cli futures call POST /linear-swap-api/v1/swap_cross_account_info --json
C
3POST
/v1/swap_position_info
htx-cli futures account position-info [--contract-code <c>] --json
I
4POST
/v1/swap_cross_position_info
htx-cli futures call POST /linear-swap-api/v1/swap_cross_position_info --json
C
5POST
/v1/swap_account_position_info
htx-cli futures call POST /linear-swap-api/v1/swap_account_position_info --json
I
6POST
/v1/swap_cross_account_position_info
htx-cli futures call POST /linear-swap-api/v1/swap_cross_account_position_info --json
C
7POST
/v3/swap_financial_record
htx-cli futures call POST /linear-swap-api/v3/swap_financial_record --json
*
8POST
/v3/swap_financial_record_exact
htx-cli futures call POST /linear-swap-api/v3/swap_financial_record_exact --json
*

Leverage & limit query — read (10)

杠杆与限额查询——只读(10个)

#MethodPathCLI invocationMode
1POST
/v1/swap_available_level_rate
htx-cli futures call POST /linear-swap-api/v1/swap_available_level_rate --json
I
2POST
/v1/swap_cross_available_level_rate
htx-cli futures call POST /linear-swap-api/v1/swap_cross_available_level_rate --json
C
3POST
/v1/swap_order_limit
htx-cli futures call POST /linear-swap-api/v1/swap_order_limit --json
*
4POST
/v1/swap_fee
htx-cli futures call POST /linear-swap-api/v1/swap_fee --json
*
5POST
/v1/swap_transfer_limit
htx-cli futures call POST /linear-swap-api/v1/swap_transfer_limit --json
I
6POST
/v1/swap_cross_transfer_limit
htx-cli futures call POST /linear-swap-api/v1/swap_cross_transfer_limit --json
C
7POST
/v1/swap_position_limit
htx-cli futures call POST /linear-swap-api/v1/swap_position_limit --json
I
8POST
/v1/swap_cross_position_limit
htx-cli futures call POST /linear-swap-api/v1/swap_cross_position_limit --json
C
9POST
/v1/swap_lever_position_limit
htx-cli futures call POST /linear-swap-api/v1/swap_lever_position_limit --json
I
10POST
/v1/swap_cross_lever_position_limit
htx-cli futures call POST /linear-swap-api/v1/swap_cross_lever_position_limit --json
C
#请求方法路径CLI调用方式模式
1POST
/v1/swap_available_level_rate
htx-cli futures call POST /linear-swap-api/v1/swap_available_level_rate --json
I
2POST
/v1/swap_cross_available_level_rate
htx-cli futures call POST /linear-swap-api/v1/swap_cross_available_level_rate --json
C
3POST
/v1/swap_order_limit
htx-cli futures call POST /linear-swap-api/v1/swap_order_limit --json
*
4POST
/v1/swap_fee
htx-cli futures call POST /linear-swap-api/v1/swap_fee --json
*
5POST
/v1/swap_transfer_limit
htx-cli futures call POST /linear-swap-api/v1/swap_transfer_limit --json
I
6POST
/v1/swap_cross_transfer_limit
htx-cli futures call POST /linear-swap-api/v1/swap_cross_transfer_limit --json
C
7POST
/v1/swap_position_limit
htx-cli futures call POST /linear-swap-api/v1/swap_position_limit --json
I
8POST
/v1/swap_cross_position_limit
htx-cli futures call POST /linear-swap-api/v1/swap_cross_position_limit --json
C
9POST
/v1/swap_lever_position_limit
htx-cli futures call POST /linear-swap-api/v1/swap_lever_position_limit --json
I
10POST
/v1/swap_cross_lever_position_limit
htx-cli futures call POST /linear-swap-api/v1/swap_cross_lever_position_limit --json
C

Sub-account management — read (8)

子账户管理——只读(8个)

#MethodPathCLI invocationMode
1POST
/v1/swap_sub_account_list
htx-cli futures call POST /linear-swap-api/v1/swap_sub_account_list --json
*
2POST
/v1/swap_account_info_list
htx-cli futures call POST /linear-swap-api/v1/swap_account_info_list --json
I
3POST
/v1/swap_cross_account_info_list
htx-cli futures call POST /linear-swap-api/v1/swap_cross_account_info_list --json
C
4POST
/v1/swap_account_info_sub
htx-cli futures call POST /linear-swap-api/v1/swap_account_info_sub --json
I
5POST
/v1/swap_cross_account_info_sub
htx-cli futures call POST /linear-swap-api/v1/swap_cross_account_info_sub --json
C
6POST
/v1/swap_position_info_sub
htx-cli futures call POST /linear-swap-api/v1/swap_position_info_sub --json
I
7POST
/v1/swap_cross_position_info_sub
htx-cli futures call POST /linear-swap-api/v1/swap_cross_position_info_sub --json
C
8POST
/v3/swap_financial_record_exact
(sub)
htx-cli futures call POST /linear-swap-api/v3/swap_financial_record_exact --body '{"sub_uid":...}' --json
*
#请求方法路径CLI调用方式模式
1POST
/v1/swap_sub_account_list
htx-cli futures call POST /linear-swap-api/v1/swap_sub_account_list --json
*
2POST
/v1/swap_account_info_list
htx-cli futures call POST /linear-swap-api/v1/swap_account_info_list --json
I
3POST
/v1/swap_cross_account_info_list
htx-cli futures call POST /linear-swap-api/v1/swap_cross_account_info_list --json
C
4POST
/v1/swap_account_info_sub
htx-cli futures call POST /linear-swap-api/v1/swap_account_info_sub --json
I
5POST
/v1/swap_cross_account_info_sub
htx-cli futures call POST /linear-swap-api/v1/swap_cross_account_info_sub --json
C
6POST
/v1/swap_position_info_sub
htx-cli futures call POST /linear-swap-api/v1/swap_position_info_sub --json
I
7POST
/v1/swap_cross_position_info_sub
htx-cli futures call POST /linear-swap-api/v1/swap_cross_position_info_sub --json
C
8POST
/v3/swap_financial_record_exact
(子账户)
htx-cli futures call POST /linear-swap-api/v3/swap_financial_record_exact --body '{"sub_uid":...}' --json
*

Transfer & misc (4)

划转及其他(4个)

#MethodPathCLI invocationRW
1POST
/v1/swap_master_sub_transfer
htx-cli futures call POST /linear-swap-api/v1/swap_master_sub_transfer --body '{...}' --json
W
2POST
/v1/swap_master_sub_transfer_record
htx-cli futures call POST /linear-swap-api/v1/swap_master_sub_transfer_record --json
R
3POST
/v1/swap_transfer_inner
htx-cli futures call POST /linear-swap-api/v1/swap_transfer_inner --body '{...}' --json
W
4GET
/v1/swap_api_trading_status
htx-cli futures call GET /linear-swap-api/v1/swap_api_trading_status --json
R
#请求方法路径CLI调用方式权限
1POST
/v1/swap_master_sub_transfer
htx-cli futures call POST /linear-swap-api/v1/swap_master_sub_transfer --body '{...}' --json
写入
2POST
/v1/swap_master_sub_transfer_record
htx-cli futures call POST /linear-swap-api/v1/swap_master_sub_transfer_record --json
读取
3POST
/v1/swap_transfer_inner
htx-cli futures call POST /linear-swap-api/v1/swap_transfer_inner --body '{...}' --json
写入
4GET
/v1/swap_api_trading_status
htx-cli futures call GET /linear-swap-api/v1/swap_api_trading_status --json
读取

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 / balance
Report:
  • 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
    htx-cli config set-secret
    once.
  • 只读接口:可自由调用。
  • 划转接口(30个中的2个):必须展示完整划转预览并等待用户明确确认。
  • 请勿记录密钥。只需调用一次
    htx-cli config set-secret
    完成配置。

References

参考文档

  • references/authentication.md
  • references/authentication.md