htx-futures-market

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

HTX USDT-M Futures Market

HTX USDT本位永续期货市场

USDT-margined perpetual futures market data. Mostly public — a handful of reference endpoints require a read-permission API key. Agent may call all of these freely without user confirmation.
USDT本位永续期货市场数据。大部分为公开数据——少数参考接口需要具备只读权限的API密钥。Agent可无需用户确认自由调用所有这些接口。

When to use this skill

何时使用该技能

  • "BTC perpetual funding rate?"
  • "ETH futures OI?"
  • "Long/short ratio from top traders"
  • "BTC-USDT 4h kline on futures"
  • "How much liquidation volume today?"
  • "What are the tier margin requirements for BTC-USDT?"
  • "BTC永续合约资金费率是多少?"
  • "ETH期货持仓量(OI)?"
  • "顶级交易者多空比例"
  • "BTC-USDT期货4小时K线"
  • "今日清算量有多少?"
  • "BTC-USDT的层级保证金要求是什么?"

Underlying tool

底层工具

Drives
htx-cli
. Binary on
$PATH
or
$HTX_CLI_BIN
. Always
--json
.
For the 6 authenticated reference endpoints, configure credentials once (read permission is enough):
bash
htx-cli config set-key    <AccessKeyId>
htx-cli config set-secret <SecretKey>
驱动
htx-cli
。二进制文件位于
$PATH
$HTX_CLI_BIN
路径下。始终使用
--json
参数。
对于6个需要认证的参考接口,只需配置一次凭证(只读权限即可):
bash
htx-cli config set-key    <AccessKeyId>
htx-cli config set-secret <SecretKey>

Endpoint catalog (36)

接口目录(共36个)

Contract & system info — public (14)

合约与系统信息——公开(14个)

#MethodEndpointCLI invocationDescription
1GET
/linear-swap-api/v1/swap_contract_info
htx-cli futures market contract-info [--contract-code <code>] --json
Contract metadata
2GET
/linear-swap-api/v1/swap_index
htx-cli futures call GET /linear-swap-api/v1/swap_index --json
Index price
3GET
/linear-swap-api/v1/swap_price_limit
htx-cli futures call GET /linear-swap-api/v1/swap_price_limit --json
Price limit (circuit)
4GET
/linear-swap-api/v1/swap_open_interest
htx-cli futures call GET /linear-swap-api/v1/swap_open_interest --json
Open interest (OI)
5GET
/linear-swap-api/v1/swap_query_elements
htx-cli futures call GET /linear-swap-api/v1/swap_query_elements --json
Contract elements
6GET
/linear-swap-api/v1/swap_estimated_settlement_price
htx-cli futures call GET /linear-swap-api/v1/swap_estimated_settlement_price --json
Estimated settlement price
7GET
/linear-swap-api/v1/swap_system_status
htx-cli futures market system-status --json
System status (isolated)
8GET
/v1/insurance_fund_info
htx-cli futures call GET /v1/insurance_fund_info --json
Insurance fund balance
9GET
/v1/insurance_fund_history
htx-cli futures call GET /v1/insurance_fund_history --json
Insurance fund history
10GET
/linear-swap-api/v1/swap_timestamp
htx-cli futures call GET /linear-swap-api/v1/swap_timestamp --json
Server timestamp
11GET
/heartbeat/
htx-cli futures call GET /heartbeat/ --json
Heartbeat
12GET
/linear-swap-ex/market/swap_contract_constituents
htx-cli futures call GET /linear-swap-ex/market/swap_contract_constituents --json
Index constituents
13GET
/linear-swap-api/v1/swap_liquidation_orders
htx-cli futures market liquidation-orders --contract-code <code> --json
Liquidation orders
14GET
/linear-swap-api/v1/swap_settlement_records
htx-cli futures call GET /linear-swap-api/v1/swap_settlement_records --json
Settlement history
序号请求方法接口地址CLI调用命令描述
1GET
/linear-swap-api/v1/swap_contract_info
htx-cli futures market contract-info [--contract-code <code>] --json
合约元数据
2GET
/linear-swap-api/v1/swap_index
htx-cli futures call GET /linear-swap-api/v1/swap_index --json
指数价格
3GET
/linear-swap-api/v1/swap_price_limit
htx-cli futures call GET /linear-swap-api/v1/swap_price_limit --json
价格限制(熔断机制)
4GET
/linear-swap-api/v1/swap_open_interest
htx-cli futures call GET /linear-swap-api/v1/swap_open_interest --json
持仓量(OI)
5GET
/linear-swap-api/v1/swap_query_elements
htx-cli futures call GET /linear-swap-api/v1/swap_query_elements --json
合约要素
6GET
/linear-swap-api/v1/swap_estimated_settlement_price
htx-cli futures call GET /linear-swap-api/v1/swap_estimated_settlement_price --json
预估结算价格
7GET
/linear-swap-api/v1/swap_system_status
htx-cli futures market system-status --json
系统状态(逐仓)
8GET
/v1/insurance_fund_info
htx-cli futures call GET /v1/insurance_fund_info --json
保险基金余额
9GET
/v1/insurance_fund_history
htx-cli futures call GET /v1/insurance_fund_history --json
保险基金历史记录
10GET
/linear-swap-api/v1/swap_timestamp
htx-cli futures call GET /linear-swap-api/v1/swap_timestamp --json
服务器时间戳
11GET
/heartbeat/
htx-cli futures call GET /heartbeat/ --json
心跳检测
12GET
/linear-swap-ex/market/swap_contract_constituents
htx-cli futures call GET /linear-swap-ex/market/swap_contract_constituents --json
指数成分
13GET
/linear-swap-api/v1/swap_liquidation_orders
htx-cli futures market liquidation-orders --contract-code <code> --json
清算订单
14GET
/linear-swap-api/v1/swap_settlement_records
htx-cli futures call GET /linear-swap-api/v1/swap_settlement_records --json
结算历史记录

Funding rate & sentiment — public (5)

资金费率与市场情绪——公开(5个)

#MethodEndpointCLI invocationDescription
1GET
/linear-swap-api/v1/swap_funding_rate
htx-cli futures market funding-rate <contract-code> --json
Current funding rate
2GET
/linear-swap-api/v1/swap_batch_funding_rate
htx-cli futures call GET /linear-swap-api/v1/swap_batch_funding_rate --json
Batch funding rates
3GET
/linear-swap-api/v1/swap_historical_funding_rate
htx-cli futures market historical-funding-rate --contract-code <code> --json
Historical funding rate
4GET
/linear-swap-api/v1/swap_elite_account_ratio
htx-cli futures call GET /linear-swap-api/v1/swap_elite_account_ratio --json
Top-account long/short ratio
5GET
/linear-swap-api/v1/swap_elite_position_ratio
htx-cli futures call GET /linear-swap-api/v1/swap_elite_position_ratio --json
Top-position long/short ratio
序号请求方法接口地址CLI调用命令描述
1GET
/linear-swap-api/v1/swap_funding_rate
htx-cli futures market funding-rate <contract-code> --json
当前资金费率
2GET
/linear-swap-api/v1/swap_batch_funding_rate
htx-cli futures call GET /linear-swap-api/v1/swap_batch_funding_rate --json
批量资金费率
3GET
/linear-swap-api/v1/swap_historical_funding_rate
htx-cli futures market historical-funding-rate --contract-code <code> --json
历史资金费率
4GET
/linear-swap-api/v1/swap_elite_account_ratio
htx-cli futures call GET /linear-swap-api/v1/swap_elite_account_ratio --json
顶级账户多空比例
5GET
/linear-swap-api/v1/swap_elite_position_ratio
htx-cli futures call GET /linear-swap-api/v1/swap_elite_position_ratio --json
顶级持仓多空比例

Market data — public (11)

市场数据——公开(11个)

#MethodEndpointCLI invocationDescription
1GET
/linear-swap-ex/market/depth
htx-cli futures call GET /linear-swap-ex/market/depth --json
Order book depth
2GET
/linear-swap-ex/market/bbo
htx-cli futures call GET /linear-swap-ex/market/bbo --json
Best bid / offer
3GET
/linear-swap-ex/market/history/kline
htx-cli futures call GET /linear-swap-ex/market/history/kline --json
K-line
4GET
/linear-swap-ex/market/history/mark_price_kline
htx-cli futures call GET /linear-swap-ex/market/history/mark_price_kline --json
Mark-price kline
5GET
/linear-swap-ex/market/detail/merged
htx-cli futures call GET /linear-swap-ex/market/detail/merged --json
Single-contract overview
6GET
/linear-swap-ex/market/detail/batch_merged
htx-cli futures market tickers --json
All-contracts overview
7GET
/linear-swap-ex/market/trade
htx-cli futures call GET /linear-swap-ex/market/trade --json
Latest trade
8GET
/linear-swap-ex/market/history/trade
htx-cli futures call GET /linear-swap-ex/market/history/trade --json
Recent trades
9GET
/linear-swap-ex/market/his_open_interest
htx-cli futures call GET /linear-swap-ex/market/his_open_interest --json
Historical OI
10GET
/linear-swap-ex/market/history/premium_index_kline
htx-cli futures call GET /linear-swap-ex/market/history/premium_index_kline --json
Premium index kline
11GET
/linear-swap-ex/market/history/estimated_rate_kline
htx-cli futures call GET /linear-swap-ex/market/history/estimated_rate_kline --json
Estimated funding rate kline
序号请求方法接口地址CLI调用命令描述
1GET
/linear-swap-ex/market/depth
htx-cli futures call GET /linear-swap-ex/market/depth --json
订单簿深度
2GET
/linear-swap-ex/market/bbo
htx-cli futures call GET /linear-swap-ex/market/bbo --json
最优买卖报价(BBO)
3GET
/linear-swap-ex/market/history/kline
htx-cli futures call GET /linear-swap-ex/market/history/kline --json
K线数据
4GET
/linear-swap-ex/market/history/mark_price_kline
htx-cli futures call GET /linear-swap-ex/market/history/mark_price_kline --json
标记价格K线
5GET
/linear-swap-ex/market/detail/merged
htx-cli futures call GET /linear-swap-ex/market/detail/merged --json
单个合约概览
6GET
/linear-swap-ex/market/detail/batch_merged
htx-cli futures market tickers --json
所有合约概览
7GET
/linear-swap-ex/market/trade
htx-cli futures call GET /linear-swap-ex/market/trade --json
最新成交
8GET
/linear-swap-ex/market/history/trade
htx-cli futures call GET /linear-swap-ex/market/history/trade --json
近期成交记录
9GET
/linear-swap-ex/market/his_open_interest
htx-cli futures call GET /linear-swap-ex/market/his_open_interest --json
历史持仓量
10GET
/linear-swap-ex/market/history/premium_index_kline
htx-cli futures call GET /linear-swap-ex/market/history/premium_index_kline --json
溢价指数K线
11GET
/linear-swap-ex/market/history/estimated_rate_kline
htx-cli futures call GET /linear-swap-ex/market/history/estimated_rate_kline --json
预估资金费率K线

Reference data — requires read permission (6)

参考数据——需要只读权限(6个)

#MethodEndpointCLI invocationDescription
1GET
/linear-swap-api/v3/swap_unified_account_type
htx-cli futures account unified-type --json
Unified account type
2POST
/linear-swap-api/v1/swap_cross_tiered_margin_info
htx-cli futures call POST /linear-swap-api/v1/swap_cross_tiered_margin_info --json
Cross tier margin
3POST
/linear-swap-api/v1/swap_tiered_margin_info
htx-cli futures call POST /linear-swap-api/v1/swap_tiered_margin_info --json
Isolated tier margin
4POST
/linear-swap-api/v1/swap_adjustment_factor
htx-cli futures call POST /linear-swap-api/v1/swap_adjustment_factor --json
Isolated adjustment factor
5POST
/linear-swap-api/v1/swap_cross_adjustment_factor
htx-cli futures call POST /linear-swap-api/v1/swap_cross_adjustment_factor --json
Cross adjustment factor
6POST
/linear-swap-api/v3/swap_switch_account_type
htx-cli futures call POST /linear-swap-api/v3/swap_switch_account_type --body '{"account_type":1}' --json
Switch account type (write, keep in market skill per plan)
Endpoint #6 is a write but the HTX plan groups it with reference-data configuration. Agent should still display the target account type to the user before calling it.
序号请求方法接口地址CLI调用命令描述
1GET
/linear-swap-api/v3/swap_unified_account_type
htx-cli futures account unified-type --json
统一账户类型
2POST
/linear-swap-api/v1/swap_cross_tiered_margin_info
htx-cli futures call POST /linear-swap-api/v1/swap_cross_tiered_margin_info --json
跨仓层级保证金
3POST
/linear-swap-api/v1/swap_tiered_margin_info
htx-cli futures call POST /linear-swap-api/v1/swap_tiered_margin_info --json
逐仓层级保证金
4POST
/linear-swap-api/v1/swap_adjustment_factor
htx-cli futures call POST /linear-swap-api/v1/swap_adjustment_factor --json
逐仓调整系数
5POST
/linear-swap-api/v1/swap_cross_adjustment_factor
htx-cli futures call POST /linear-swap-api/v1/swap_cross_adjustment_factor --json
跨仓调整系数
6POST
/linear-swap-api/v3/swap_switch_account_type
htx-cli futures call POST /linear-swap-api/v3/swap_switch_account_type --body '{"account_type":1}' --json
切换账户类型(写操作,按规划归入市场技能)
接口#6为写操作,但HTX规划中将其归入参考数据配置类。Agent在调用前仍需向用户展示目标账户类型。

Contract code format

合约代码格式

USDT-M perpetual codes are
<BASE>-USDT
:
BTC-USDT, ETH-USDT, SOL-USDT, ...
Not all endpoints accept a
contract_code
filter — some return the whole universe.
USDT本位永续合约代码格式为
<BASE>-USDT
BTC-USDT, ETH-USDT, SOL-USDT, ...
并非所有接口都支持
contract_code
过滤——部分接口会返回全市场数据。

Typical queries

典型查询示例

  • "BTC funding rate?" →
    htx-cli futures market funding-rate BTC-USDT --json
  • "ETH 1-hour futures klines" →
    htx-cli futures call GET /linear-swap-ex/market/history/kline --query contract_code=ETH-USDT&period=60min&size=200 --json
  • "Total liquidations today for BTC" →
    htx-cli futures market liquidation-orders --contract-code BTC-USDT --json
  • "Top traders long/short ratio" →
    htx-cli futures call GET /linear-swap-api/v1/swap_elite_position_ratio --query contract_code=BTC-USDT --json
  • "BTC资金费率?" →
    htx-cli futures market funding-rate BTC-USDT --json
  • "ETH期货1小时K线" →
    htx-cli futures call GET /linear-swap-ex/market/history/kline --query contract_code=ETH-USDT&period=60min&size=200 --json
  • "BTC今日总清算量" →
    htx-cli futures market liquidation-orders --contract-code BTC-USDT --json
  • "顶级交易者多空比例" →
    htx-cli futures call GET /linear-swap-api/v1/swap_elite_position_ratio --query contract_code=BTC-USDT --json

References

参考文档

  • references/contract-info.md
    — contract code & tier margin quick reference
  • references/funding-rate.md
    — funding mechanics
  • references/contract-info.md
    — 合约代码与层级速查手册
  • references/funding-rate.md
    — 资金费率机制说明