usdt-m-futures

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

HTX USDT-M Futures Skill

HTX USDT-M Futures Skill

USDT-M Futures trading on HTX using authenticated and public API endpoints. Return the result in JSON format.
通过身份验证接口和公开API接口实现HTX平台的USDT本位合约交易,结果将以JSON格式返回。

Base URLs

基础URL

Quick Reference

快速参考

Complete API endpoints for HTX USDT-M Futures. All endpoints use base URL
https://api.hbdm.com
(or
https://api.hbdm.vn
for AWS).
HTX USDT本位合约的完整API接口列表,所有接口的基础URL为
https://api.hbdm.com
(AWS节点使用
https://api.hbdm.vn
)。

Reference Data

参考数据

EndpointDescriptionRequiredOptionalAuthentication
GET
/linear-swap-api/v3/swap_unified_account_type
Account type queryNoneNoneYes
POST
/linear-swap-api/v3/swap_switch_account_type
Account Type Changeaccount_typeNoneYes
GET
/linear-swap-api/v1/swap_funding_rate
Query funding ratecontract_codeNoneNo
GET
/linear-swap-api/v1/swap_batch_funding_rate
Query a Batch of Funding Ratecontract_codeNoneNo
GET
/linear-swap-api/v1/swap_historical_funding_rate
Query historical funding ratecontract_codepage_index, page_sizeNo
GET
/linear-swap-api/v1/swap_liquidation_orders
Query Liquidation Orderscontract_codetrade_type, create_date, page_index, page_sizeNo
GET
/linear-swap-api/v1/swap_settlement_records
Query historical settlement recordscontract_codepage_index, page_sizeNo
GET
/linear-swap-api/v1/swap_elite_account_ratio
Query Top Trader Sentiment Index (Account)contract_codeperiodNo
GET
/linear-swap-api/v1/swap_elite_position_ratio
Query Top Trader Sentiment Index (Position)contract_codeperiodNo
GET
/linear-swap-api/v1/swap_system_status
Query information on system status (Isolated)contract_codeNoneNo
POST
/linear-swap-api/v1/swap_cross_tiered_margin_info
Query information on Tiered Margin (Cross)NoneNoneYes
POST
/linear-swap-api/v1/swap_tiered_margin_info
Query information on Tiered Margin (Isolated)contract_codeNoneYes
GET
/linear-swap-api/v1/swap_estimated_settlement_price
Get the estimated settlement pricecontract_codeNoneNo
POST
/linear-swap-api/v1/swap_adjustment_factor
Query Tiered Adjustment Factor (Isolated)contract_codeNoneYes
POST
/linear-swap-api/v1/swap_cross_adjustment_factor
Query Tiered Adjustment Factor (Cross)NoneNoneYes
GET
/v1/insurance_fund_info
Query risk reserve balance informationcontract_codeNoneNo
GET
/v1/insurance_fund_history
Query historical risk reservescontract_codepage_index, page_sizeNo
GET
/linear-swap-api/v1/swap_price_limit
Query Swap Price Limitationcontract_codeNoneNo
GET
/linear-swap-api/v1/swap_open_interest
Get Swap Open Interest Informationcontract_codeNoneNo
GET
/linear-swap-api/v1/swap_contract_info
Query Contract Infocontract_codeNoneNo
GET
/linear-swap-api/v1/swap_index
Query Swap Index Price Informationcontract_codeNoneNo
GET
/linear-swap-api/market/swap_contract_constituents
Get index componentsindex_codeNoneNo
GET
/linear-swap-api/v1/swap_query_elements
Contract Elementscontract_codeNoneNo
GET
/linear-swap-api/v1/swap_timestamp
Get current system timestampNoneNoneNo
GET
https://api.hbdm.com/heartbeat/
Query whether the system is availableNoneNoneNo
Endpoint描述必填参数可选参数身份验证
GET
/linear-swap-api/v3/swap_unified_account_type
账户类型查询
POST
/linear-swap-api/v3/swap_switch_account_type
账户类型切换account_type
GET
/linear-swap-api/v1/swap_funding_rate
资金费率查询contract_code
GET
/linear-swap-api/v1/swap_batch_funding_rate
批量资金费率查询contract_code
GET
/linear-swap-api/v1/swap_historical_funding_rate
历史资金费率查询contract_codepage_index, page_size
GET
/linear-swap-api/v1/swap_liquidation_orders
爆仓订单查询contract_codetrade_type, create_date, page_index, page_size
GET
/linear-swap-api/v1/swap_settlement_records
历史结算记录查询contract_codepage_index, page_size
GET
/linear-swap-api/v1/swap_elite_account_ratio
顶级交易员情绪指数查询(账户维度)contract_codeperiod
GET
/linear-swap-api/v1/swap_elite_position_ratio
顶级交易员情绪指数查询(持仓维度)contract_codeperiod
GET
/linear-swap-api/v1/swap_system_status
系统状态信息查询(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_tiered_margin_info
阶梯保证金信息查询(全仓)
POST
/linear-swap-api/v1/swap_tiered_margin_info
阶梯保证金信息查询(逐仓)contract_code
GET
/linear-swap-api/v1/swap_estimated_settlement_price
获取预估结算价格contract_code
POST
/linear-swap-api/v1/swap_adjustment_factor
阶梯调整系数查询(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_adjustment_factor
阶梯调整系数查询(全仓)
GET
/v1/insurance_fund_info
风险准备金余额查询contract_code
GET
/v1/insurance_fund_history
历史风险准备金查询contract_codepage_index, page_size
GET
/linear-swap-api/v1/swap_price_limit
合约价格限制查询contract_code
GET
/linear-swap-api/v1/swap_open_interest
获取合约持仓量信息contract_code
GET
/linear-swap-api/v1/swap_contract_info
合约信息查询contract_code
GET
/linear-swap-api/v1/swap_index
合约指数价格信息查询contract_code
GET
/linear-swap-api/market/swap_contract_constituents
获取指数成分index_code
GET
/linear-swap-api/v1/swap_query_elements
合约要素查询contract_code
GET
/linear-swap-api/v1/swap_timestamp
获取当前系统时间戳
GET
https://api.hbdm.com/heartbeat/
查询系统可用性

Market Data

市场数据

EndpointDescriptionRequiredOptionalAuthentication
GET
/linear-swap-ex/market/depth
Get Market Depthcontract_codetypeNo
GET
/linear-swap-ex/market/bbo
Get Market BBO Datacontract_codeNoneNo
GET
/linear-swap-ex/market/kline
Get KLine Datacontract_code, periodsize, from, toNo
GET
/linear-swap-ex/market/mark_price_kline
Get Kline Data of Mark Pricecontract_code, periodsize, from, toNo
GET
/linear-swap-ex/market/overview
Get Market Data Overviewcontract_codeNoneNo
GET
/linear-swap-ex/market/batch_overview
Get a Batch of Market Data Overviewcontract_codeNoneNo
GET
/linear-swap-ex/market/trade
Query The Last Trade of a Contractcontract_codeNoneNo
GET
/linear-swap-ex/market/trades
Query a Batch of Trade Recordscontract_codesizeNo
GET
/linear-swap-ex/market/open_interest
Query information on open interestcontract_codeNoneNo
GET
/linear-swap-ex/market/premium_index_kline
Query Premium Index Kline Datacontract_code, periodsize, from, toNo
GET
/linear-swap-ex/market/estimated_funding_rate_kline
Query Estimated Funding Rate Klinecontract_code, periodsize, from, toNo
GET
/linear-swap-ex/market/basis
Query Basis Datacontract_code, periodsize, from, to, basis_price_typeNo
Endpoint描述必填参数可选参数身份验证
GET
/linear-swap-ex/market/depth
获取市场深度contract_codetype
GET
/linear-swap-ex/market/bbo
获取市场最优挂单数据contract_code
GET
/linear-swap-ex/market/kline
获取K线数据contract_code, periodsize, from, to
GET
/linear-swap-ex/market/mark_price_kline
获取标记价格K线数据contract_code, periodsize, from, to
GET
/linear-swap-ex/market/overview
获取市场数据概览contract_code
GET
/linear-swap-ex/market/batch_overview
批量获取市场数据概览contract_code
GET
/linear-swap-ex/market/trade
查询合约最新成交记录contract_code
GET
/linear-swap-ex/market/trades
批量查询成交记录contract_codesize
GET
/linear-swap-ex/market/open_interest
查询持仓量信息contract_code
GET
/linear-swap-ex/market/premium_index_kline
查询溢价指数K线数据contract_code, periodsize, from, to
GET
/linear-swap-ex/market/estimated_funding_rate_kline
查询预估资金费率K线contract_code, periodsize, from, to
GET
/linear-swap-ex/market/basis
查询基差数据contract_code, periodsize, from, to, basis_price_type

Account Interface

账户接口

EndpointDescriptionRequiredOptionalAuthentication
POST
/linear-swap-api/v1/swap_account_info
Query Asset ValuationNonevaluation_assetYes
POST
/linear-swap-api/v1/swap_account_info
Query Account Information (Isolated)contract_codeNoneYes
POST
/linear-swap-api/v1/swap_cross_account_info
Query Account Information (Cross)Nonevaluation_assetYes
POST
/linear-swap-api/v1/swap_position_info
Query Position Information (Isolated)contract_codeNoneYes
POST
/linear-swap-api/v1/swap_cross_position_info
Query Position Information (Cross)Nonecontract_codeYes
POST
/linear-swap-api/v1/swap_account_position_info
Query Assets And Positions (Isolated)contract_codeNoneYes
POST
/linear-swap-api/v1/swap_cross_account_position_info
Query Assets And Positions (Cross)Nonevaluation_assetYes
POST
/linear-swap-api/v1/swap_sub_account_list
Set Sub-Account Trading Permissionssub_uidtradesYes
POST
/linear-swap-api/v1/swap_sub_account_trading_permission
Query sub-account permissionssub_uidNoneYes
POST
/linear-swap-api/v1/swap_account_info_list
Query all sub-accounts (Isolated)NoneNoneYes
POST
/linear-swap-api/v1/swap_cross_account_info_list
Query all sub-accounts (Cross)Nonevaluation_assetYes
POST
/linear-swap-api/v1/swap_account_info_batch
Query batch sub-accounts (Isolated)sub_uidNoneYes
POST
/linear-swap-api/v1/swap_cross_account_info_batch
Query batch sub-accounts (Cross)sub_uidvaluation_assetYes
POST
/linear-swap-api/v1/swap_account_info_sub
Query single sub-account (Isolated)contract_code, sub_uidNoneYes
POST
/linear-swap-api/v1/swap_cross_account_info_sub
Query sub-account (Cross)sub_uidvaluation_assetYes
POST
/linear-swap-api/v1/swap_position_info_sub
Query sub-account position (Isolated)contract_code, sub_uidNoneYes
POST
/linear-swap-api/v1/swap_cross_position_info_sub
Query sub-account position (Cross)sub_uidcontract_codeYes
POST
/linear-swap-api/v3/swap_financial_record
Query account financial recordsNonecontract_code, type, start_time, end_time, page_index, page_size, directYes
POST
/linear-swap-api/v3/swap_financial_record_exact
Query financial records via fieldsNonecontract_code, type, start_time, end_time, page_index, page_size, directYes
POST
/linear-swap-api/v1/swap_available_level_rate
Query available leverage (Isolated)contract_codeNoneYes
POST
/linear-swap-api/v1/swap_cross_available_level_rate
Query available leverage (Cross)NoneNoneYes
POST
/linear-swap-api/v1/swap_order_limit
Query order limitNonecontract_code, order_price_typeYes
POST
/linear-swap-api/v1/swap_fee
Query swap trading feeNonecontract_codeYes
POST
/linear-swap-api/v1/swap_transfer_limit
Query transfer limit (Isolated)contract_codeNoneYes
POST
/linear-swap-api/v1/swap_cross_transfer_limit
Query transfer limit (Cross)NoneNoneYes
POST
/linear-swap-api/v1/swap_position_limit
Query position limit (Isolated)contract_codeNoneYes
POST
/linear-swap-api/v1/swap_cross_position_limit
Query position limit (Cross)NoneNoneYes
POST
/linear-swap-api/v1/swap_lever_position_limit
Query position limit all leverages (Isolated)contract_codeNoneYes
POST
/linear-swap-api/v1/swap_cross_lever_position_limit
Query position limit all leverages (Cross)NoneNoneYes
POST
/linear-swap-api/v1/swap_master_sub_transfer
Transfer between master and subsub_uid, asset, amount, typeclient_order_idYes
POST
/linear-swap-api/v1/swap_master_sub_transfer_record
Query transfer recordsNonesub_uid, transfer_type, page_index, page_size, direct, sort_byYes
POST
/linear-swap-api/v1/swap_transfer_inner
Transfer between margin accountsasset, amount, from_margin_account, to_margin_accountclient_order_idYes
GET
/linear-swap-api/v1/swap_api_trading_status
Query API indicator disable infoNoneNoneYes
POST
/linear-swap-api/v1/linear-cancel-after
Automatic Order Cancellationtimeoutcontract_codeYes
Endpoint描述必填参数可选参数身份验证
POST
/linear-swap-api/v1/swap_account_info
资产估值查询valuation_asset
POST
/linear-swap-api/v1/swap_account_info
账户信息查询(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_account_info
账户信息查询(全仓)valuation_asset
POST
/linear-swap-api/v1/swap_position_info
持仓信息查询(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_position_info
持仓信息查询(全仓)contract_code
POST
/linear-swap-api/v1/swap_account_position_info
资产与持仓查询(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_account_position_info
资产与持仓查询(全仓)valuation_asset
POST
/linear-swap-api/v1/swap_sub_account_list
设置子账户交易权限sub_uidtrades
POST
/linear-swap-api/v1/swap_sub_account_trading_permission
查询子账户权限sub_uid
POST
/linear-swap-api/v1/swap_account_info_list
查询所有子账户(逐仓)
POST
/linear-swap-api/v1/swap_cross_account_info_list
查询所有子账户(全仓)valuation_asset
POST
/linear-swap-api/v1/swap_account_info_batch
批量查询子账户(逐仓)sub_uid
POST
/linear-swap-api/v1/swap_cross_account_info_batch
批量查询子账户(全仓)sub_uidvaluation_asset
POST
/linear-swap-api/v1/swap_account_info_sub
查询单个子账户(逐仓)contract_code, sub_uid
POST
/linear-swap-api/v1/swap_cross_account_info_sub
查询子账户(全仓)sub_uidvaluation_asset
POST
/linear-swap-api/v1/swap_position_info_sub
查询子账户持仓(逐仓)contract_code, sub_uid
POST
/linear-swap-api/v1/swap_cross_position_info_sub
查询子账户持仓(全仓)sub_uidcontract_code
POST
/linear-swap-api/v3/swap_financial_record
查询账户财务记录contract_code, type, start_time, end_time, page_index, page_size, direct
POST
/linear-swap-api/v3/swap_financial_record_exact
按字段查询财务记录contract_code, type, start_time, end_time, page_index, page_size, direct
POST
/linear-swap-api/v1/swap_available_level_rate
查询可用杠杆倍数(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_available_level_rate
查询可用杠杆倍数(全仓)
POST
/linear-swap-api/v1/swap_order_limit
查询下单限额contract_code, order_price_type
POST
/linear-swap-api/v1/swap_fee
查询合约交易手续费contract_code
POST
/linear-swap-api/v1/swap_transfer_limit
查询划转限额(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_transfer_limit
查询划转限额(全仓)
POST
/linear-swap-api/v1/swap_position_limit
查询持仓限额(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_position_limit
查询持仓限额(全仓)
POST
/linear-swap-api/v1/swap_lever_position_limit
查询所有杠杆档位持仓限额(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_lever_position_limit
查询所有杠杆档位持仓限额(全仓)
POST
/linear-swap-api/v1/swap_master_sub_transfer
母子账户划转sub_uid, asset, amount, typeclient_order_id
POST
/linear-swap-api/v1/swap_master_sub_transfer_record
查询划转记录sub_uid, transfer_type, page_index, page_size, direct, sort_by
POST
/linear-swap-api/v1/swap_transfer_inner
保证金账户间划转asset, amount, from_margin_account, to_margin_accountclient_order_id
GET
/linear-swap-api/v1/swap_api_trading_status
查询API指标禁用信息
POST
/linear-swap-api/v1/linear-cancel-after
自动撤单设置timeoutcontract_code

Trade Interface

交易接口

EndpointDescriptionRequiredOptionalAuthentication
POST
/linear-swap-api/v1/swap_cross_query_trade_state
Query Trade State (Cross)NoneNoneYes
POST
/linear-swap-api/v1/swap_switch_position_mode
Switch Position Mode (Isolated)contract_code, modeNoneYes
POST
/linear-swap-api/v1/swap_cross_switch_position_mode
Switch Position Mode (Cross)modecontract_codeYes
POST
/linear-swap-api/v1/swap_order
Place an Order (Isolated)contract_code, client_order_id, price, volume, direction, offset, lever_rate, order_price_typetp_trigger_price, tp_order_price, tp_order_price_type, sl_trigger_price, sl_order_price, sl_order_price_type, reduce_only, hf_order_typeYes
POST
/linear-swap-api/v1/swap_cross_order
Place An Order (Cross)contract_code, client_order_id, price, volume, direction, offset, lever_rate, order_price_typetp_trigger_price, tp_order_price, tp_order_price_type, sl_trigger_price, sl_order_price, sl_order_price_type, reduce_only, hf_order_typeYes
POST
/linear-swap-api/v1/swap_batch_orders
Place a Batch of Orders (Isolated)orders_dataNoneYes
POST
/linear-swap-api/v1/swap_cross_batch_orders
Place A Batch Of Orders (Cross)orders_dataNoneYes
POST
/linear-swap-api/v1/swap_cancel
Cancel an Order (Isolated)contract_code, order_idclient_order_idYes
POST
/linear-swap-api/v1/swap_cross_cancel
Cancel An Order (Cross)order_idcontract_code, client_order_idYes
POST
/linear-swap-api/v1/swap_cancelall
Cancel All Orders (Isolated)contract_codedirection, offsetYes
POST
/linear-swap-api/v1/swap_cross_cancelall
Cancel All Orders (Cross)Nonecontract_code, direction, offsetYes
POST
/linear-swap-api/v1/swap_switch_lever_rate
Switch Leverage (Isolated)contract_code, lever_rateNoneYes
POST
/linear-swap-api/v1/swap_cross_switch_lever_rate
Switch Leverage (Cross)lever_ratecontract_codeYes
POST
/linear-swap-api/v1/swap_order_info
Get Information of an Order (Isolated)contract_code, order_idclient_order_idYes
POST
/linear-swap-api/v1/swap_cross_order_info
Get Information of order (Cross)order_idcontract_code, client_order_idYes
POST
/linear-swap-api/v1/swap_order_detail
Order details acquisition (Isolated)contract_code, order_idcreated_at, page_index, page_size, client_order_idYes
POST
/linear-swap-api/v1/swap_cross_order_detail
Get Detail Information (Cross)order_idcontract_code, created_at, page_index, page_size, client_order_idYes
POST
/linear-swap-api/v1/swap_openorders
Current unfilled orders (Isolated)contract_codepage_index, page_sizeYes
POST
/linear-swap-api/v1/swap_cross_openorders
Current unfilled orders (Cross)Nonecontract_code, page_index, page_sizeYes
POST
/linear-swap-api/v3/swap_hisorders
Get History Orders (Isolated)contract_code, trade_typetype, start_time, end_time, direct, page_index, page_size, sort_byYes
POST
/linear-swap-api/v3/swap_cross_hisorders
Get History Orders (Cross)trade_typecontract_code, type, start_time, end_time, direct, page_index, page_size, sort_byYes
POST
/linear-swap-api/v3/swap_hisorders_exact
History Orders via Fields (Isolated)contract_code, trade_typetype, start_time, end_time, direct, page_index, page_size, sort_byYes
POST
/linear-swap-api/v3/swap_cross_hisorders_exact
History Orders via Fields (Cross)trade_typecontract_code, type, start_time, end_time, direct, page_index, page_size, sort_byYes
POST
/linear-swap-api/v3/swap_matchresults
History Match Results (Isolated)contract_code, trade_typestart_time, end_time, page_index, page_size, directYes
POST
/linear-swap-api/v3/swap_cross_matchresults
History Match Results (Cross)trade_typecontract_code, start_time, end_time, page_index, page_size, directYes
POST
/linear-swap-api/v3/swap_matchresults_exact
Match Results via Fields (Isolated)contract_code, trade_typestart_time, end_time, page_index, page_size, directYes
POST
/linear-swap-api/v3/swap_cross_matchresults_exact
Match Results via Fields (Cross)trade_typecontract_code, start_time, end_time, page_index, page_size, directYes
POST
/linear-swap-api/v1/swap_lightning_close_position
Lightning Close Order (Isolated)contract_code, volume, directionclient_order_id, order_price_typeYes
POST
/linear-swap-api/v1/swap_cross_lightning_close_position
Lightning Close Position (Cross)contract_code, volume, directionclient_order_id, order_price_typeYes
GET
/linear-swap-api/v1/swap_position_side
Query position mode (Isolated)contract_codeNoneYes
GET
/linear-swap-api/v1/swap_cross_position_side
Query position mode (Cross)Nonecontract_codeYes
Endpoint描述必填参数可选参数身份验证
POST
/linear-swap-api/v1/swap_cross_query_trade_state
查询交易状态(全仓)
POST
/linear-swap-api/v1/swap_switch_position_mode
切换持仓模式(逐仓)contract_code, mode
POST
/linear-swap-api/v1/swap_cross_switch_position_mode
切换持仓模式(全仓)modecontract_code
POST
/linear-swap-api/v1/swap_order
下单(逐仓)contract_code, client_order_id, price, volume, direction, offset, lever_rate, order_price_typetp_trigger_price, tp_order_price, tp_order_price_type, sl_trigger_price, sl_order_price, sl_order_price_type, reduce_only, hf_order_type
POST
/linear-swap-api/v1/swap_cross_order
下单(全仓)contract_code, client_order_id, price, volume, direction, offset, lever_rate, order_price_typetp_trigger_price, tp_order_price, tp_order_price_type, sl_trigger_price, sl_order_price, sl_order_price_type, reduce_only, hf_order_type
POST
/linear-swap-api/v1/swap_batch_orders
批量下单(逐仓)orders_data
POST
/linear-swap-api/v1/swap_cross_batch_orders
批量下单(全仓)orders_data
POST
/linear-swap-api/v1/swap_cancel
撤单(逐仓)contract_code, order_idclient_order_id
POST
/linear-swap-api/v1/swap_cross_cancel
撤单(全仓)order_idcontract_code, client_order_id
POST
/linear-swap-api/v1/swap_cancelall
撤销所有订单(逐仓)contract_codedirection, offset
POST
/linear-swap-api/v1/swap_cross_cancelall
撤销所有订单(全仓)contract_code, direction, offset
POST
/linear-swap-api/v1/swap_switch_lever_rate
切换杠杆倍数(逐仓)contract_code, lever_rate
POST
/linear-swap-api/v1/swap_cross_switch_lever_rate
切换杠杆倍数(全仓)lever_ratecontract_code
POST
/linear-swap-api/v1/swap_order_info
获取订单信息(逐仓)contract_code, order_idclient_order_id
POST
/linear-swap-api/v1/swap_cross_order_info
获取订单信息(全仓)order_idcontract_code, client_order_id
POST
/linear-swap-api/v1/swap_order_detail
获取订单详情(逐仓)contract_code, order_idcreated_at, page_index, page_size, client_order_id
POST
/linear-swap-api/v1/swap_cross_order_detail
获取订单详情(全仓)order_idcontract_code, created_at, page_index, page_size, client_order_id
POST
/linear-swap-api/v1/swap_openorders
当前未成交订单查询(逐仓)contract_codepage_index, page_size
POST
/linear-swap-api/v1/swap_cross_openorders
当前未成交订单查询(全仓)contract_code, page_index, page_size
POST
/linear-swap-api/v3/swap_hisorders
获取历史订单(逐仓)contract_code, trade_typetype, start_time, end_time, direct, page_index, page_size, sort_by
POST
/linear-swap-api/v3/swap_cross_hisorders
获取历史订单(全仓)trade_typecontract_code, type, start_time, end_time, direct, page_index, page_size, sort_by
POST
/linear-swap-api/v3/swap_hisorders_exact
按字段查询历史订单(逐仓)contract_code, trade_typetype, start_time, end_time, direct, page_index, page_size, sort_by
POST
/linear-swap-api/v3/swap_cross_hisorders_exact
按字段查询历史订单(全仓)trade_typecontract_code, type, start_time, end_time, direct, page_index, page_size, sort_by
POST
/linear-swap-api/v3/swap_matchresults
历史成交记录查询(逐仓)contract_code, trade_typestart_time, end_time, page_index, page_size, direct
POST
/linear-swap-api/v3/swap_cross_matchresults
历史成交记录查询(全仓)trade_typecontract_code, start_time, end_time, page_index, page_size, direct
POST
/linear-swap-api/v3/swap_matchresults_exact
按字段查询成交记录(逐仓)contract_code, trade_typestart_time, end_time, page_index, page_size, direct
POST
/linear-swap-api/v3/swap_cross_matchresults_exact
按字段查询成交记录(全仓)trade_typecontract_code, start_time, end_time, page_index, page_size, direct
POST
/linear-swap-api/v1/swap_lightning_close_position
闪电平仓(逐仓)contract_code, volume, directionclient_order_id, order_price_type
POST
/linear-swap-api/v1/swap_cross_lightning_close_position
闪电平仓(全仓)contract_code, volume, directionclient_order_id, order_price_type
GET
/linear-swap-api/v1/swap_position_side
查询持仓模式(逐仓)contract_code
GET
/linear-swap-api/v1/swap_cross_position_side
查询持仓模式(全仓)contract_code

Strategy Order Interface

策略订单接口

EndpointDescriptionRequiredOptionalAuthentication
POST
/linear-swap-api/v1/swap_trigger_order
Place Trigger Order (Isolated)contract_code, trigger_type, trigger_price, order_price, volume, direction, offset, lever_rate, order_price_typeclient_order_idYes
POST
/linear-swap-api/v1/swap_cross_trigger_order
Place Trigger Order (Cross)contract_code, trigger_type, trigger_price, order_price, volume, direction, offset, lever_rate, order_price_typeclient_order_idYes
POST
/linear-swap-api/v1/swap_trigger_cancel
Cancel Trigger Order (Isolated)contract_code, order_idclient_order_idYes
POST
/linear-swap-api/v1/swap_cross_trigger_cancel
Cancel Trigger Order (Cross)order_idcontract_code, client_order_idYes
POST
/linear-swap-api/v1/swap_trigger_cancelall
Cancel All Trigger Orders (Isolated)contract_codedirection, offsetYes
POST
/linear-swap-api/v1/swap_cross_trigger_cancelall
Cancel All Trigger Orders (Cross)Nonecontract_code, direction, offsetYes
POST
/linear-swap-api/v1/swap_trigger_openorders
Query Trigger Order Open Orders (Isolated)contract_codepage_index, page_sizeYes
POST
/linear-swap-api/v1/swap_cross_trigger_openorders
Query Trigger Order Open Orders (Cross)Nonecontract_code, page_index, page_sizeYes
POST
/linear-swap-api/v1/swap_trigger_hisorders
Query Trigger Order History (Isolated)contract_codetrigger_type, status, page_index, page_size, sort_by, directYes
POST
/linear-swap-api/v1/swap_cross_trigger_hisorders
Query Trigger Order History (Cross)Nonecontract_code, trigger_type, status, page_index, page_size, sort_by, directYes
POST
/linear-swap-api/v1/swap_tpsl_order
Set TP/SL Order (Isolated)contract_code, volume, tp_trigger_price, tp_order_price, sl_trigger_price, sl_order_price, directiontp_order_price_type, sl_order_price_type, client_order_idYes
POST
/linear-swap-api/v1/swap_cross_tpsl_order
Set TP/SL Order (Cross)contract_code, volume, tp_trigger_price, tp_order_price, sl_trigger_price, sl_order_price, directiontp_order_price_type, sl_order_price_type, client_order_idYes
POST
/linear-swap-api/v1/swap_tpsl_cancel
Cancel TP/SL Order (Isolated)contract_code, order_idclient_order_idYes
POST
/linear-swap-api/v1/swap_cross_tpsl_cancel
Cancel TP/SL Order (Cross)order_idcontract_code, client_order_idYes
POST
/linear-swap-api/v1/swap_tpsl_cancelall
Cancel all TP/SL Orders (Isolated)contract_codeNoneYes
POST
/linear-swap-api/v1/swap_cross_tpsl_cancelall
Cancel all TP/SL Orders (Cross)Nonecontract_codeYes
POST
/linear-swap-api/v1/swap_tpsl_openorders
Query Open TP/SL Orders (Isolated)contract_codepage_index, page_sizeYes
POST
/linear-swap-api/v1/swap_cross_tpsl_openorders
Query Open TP/SL Orders (Cross)Nonecontract_code, page_index, page_sizeYes
POST
/linear-swap-api/v1/swap_tpsl_hisorders
Query TP/SL History Orders (Isolated)contract_codestatus, page_index, page_size, sort_by, directYes
POST
/linear-swap-api/v1/swap_cross_tpsl_hisorders
Query TP/SL History Orders (Cross)Nonecontract_code, status, page_index, page_size, sort_by, directYes
POST
/linear-swap-api/v1/swap_tpsl_relation_order_info
Query TP/SL Order Info (Isolated)contract_code, order_idclient_order_idYes
POST
/linear-swap-api/v1/swap_cross_tpsl_relation_order_info
Query TP/SL Order Info (Cross)order_idcontract_code, client_order_idYes
POST
/linear-swap-api/v1/swap_trailing_order
Place Trailing Order (Isolated)contract_code, volume, direction, offset, lever_rate, trailing_amount, trailing_percent, order_price_typeclient_order_idYes
POST
/linear-swap-api/v1/swap_cross_trailing_order
Place Trailing Order (Cross)contract_code, volume, direction, offset, lever_rate, trailing_amount, trailing_percent, order_price_typeclient_order_idYes
POST
/linear-swap-api/v1/swap_trailing_cancel
Cancel Trailing Order (Isolated)contract_code, order_idclient_order_idYes
POST
/linear-swap-api/v1/swap_cross_trailing_cancel
Cancel Trailing Order (Cross)order_idcontract_code, client_order_idYes
POST
/linear-swap-api/v1/swap_trailing_cancelall
Cancel All Trailing Orders (Isolated)contract_codedirection, offsetYes
POST
/linear-swap-api/v1/swap_cross_trailing_cancelall
Cancel All Trailing Orders (Cross)Nonecontract_code, direction, offsetYes
POST
/linear-swap-api/v1/swap_trailing_openorders
Unfilled trailing orders (Isolated)contract_codepage_index, page_sizeYes
POST
/linear-swap-api/v1/swap_cross_trailing_openorders
Unfilled trailing orders (Cross)Nonecontract_code, page_index, page_sizeYes
POST
/linear-swap-api/v1/swap_trailing_hisorders
History Trailing Orders (Isolated)contract_codestatus, page_index, page_size, sort_by, directYes
POST
/linear-swap-api/v1/swap_cross_trailing_hisorders
History Trailing Orders (Cross)Nonecontract_code, status, page_index, page_size, sort_by, directYes
Endpoint描述必填参数可选参数身份验证
POST
/linear-swap-api/v1/swap_trigger_order
下计划委托单(逐仓)contract_code, trigger_type, trigger_price, order_price, volume, direction, offset, lever_rate, order_price_typeclient_order_id
POST
/linear-swap-api/v1/swap_cross_trigger_order
下计划委托单(全仓)contract_code, trigger_type, trigger_price, order_price, volume, direction, offset, lever_rate, order_price_typeclient_order_id
POST
/linear-swap-api/v1/swap_trigger_cancel
撤销计划委托单(逐仓)contract_code, order_idclient_order_id
POST
/linear-swap-api/v1/swap_cross_trigger_cancel
撤销计划委托单(全仓)order_idcontract_code, client_order_id
POST
/linear-swap-api/v1/swap_trigger_cancelall
撤销所有计划委托单(逐仓)contract_codedirection, offset
POST
/linear-swap-api/v1/swap_cross_trigger_cancelall
撤销所有计划委托单(全仓)contract_code, direction, offset
POST
/linear-swap-api/v1/swap_trigger_openorders
查询当前未成交计划委托单(逐仓)contract_codepage_index, page_size
POST
/linear-swap-api/v1/swap_cross_trigger_openorders
查询当前未成交计划委托单(全仓)contract_code, page_index, page_size
POST
/linear-swap-api/v1/swap_trigger_hisorders
查询历史计划委托单(逐仓)contract_codetrigger_type, status, page_index, page_size, sort_by, direct
POST
/linear-swap-api/v1/swap_cross_trigger_hisorders
查询历史计划委托单(全仓)contract_code, trigger_type, status, page_index, page_size, sort_by, direct
POST
/linear-swap-api/v1/swap_tpsl_order
设置止盈止损单(逐仓)contract_code, volume, tp_trigger_price, tp_order_price, sl_trigger_price, sl_order_price, directiontp_order_price_type, sl_order_price_type, client_order_id
POST
/linear-swap-api/v1/swap_cross_tpsl_order
设置止盈止损单(全仓)contract_code, volume, tp_trigger_price, tp_order_price, sl_trigger_price, sl_order_price, directiontp_order_price_type, sl_order_price_type, client_order_id
POST
/linear-swap-api/v1/swap_tpsl_cancel
撤销止盈止损单(逐仓)contract_code, order_idclient_order_id
POST
/linear-swap-api/v1/swap_cross_tpsl_cancel
撤销止盈止损单(全仓)order_idcontract_code, client_order_id
POST
/linear-swap-api/v1/swap_tpsl_cancelall
撤销所有止盈止损单(逐仓)contract_code
POST
/linear-swap-api/v1/swap_cross_tpsl_cancelall
撤销所有止盈止损单(全仓)contract_code
POST
/linear-swap-api/v1/swap_tpsl_openorders
查询当前未成交止盈止损单(逐仓)contract_codepage_index, page_size
POST
/linear-swap-api/v1/swap_cross_tpsl_openorders
查询当前未成交止盈止损单(全仓)contract_code, page_index, page_size
POST
/linear-swap-api/v1/swap_tpsl_hisorders
查询历史止盈止损单(逐仓)contract_codestatus, page_index, page_size, sort_by, direct
POST
/linear-swap-api/v1/swap_cross_tpsl_hisorders
查询历史止盈止损单(全仓)contract_code, status, page_index, page_size, sort_by, direct
POST
/linear-swap-api/v1/swap_tpsl_relation_order_info
查询止盈止损关联订单信息(逐仓)contract_code, order_idclient_order_id
POST
/linear-swap-api/v1/swap_cross_tpsl_relation_order_info
查询止盈止损关联订单信息(全仓)order_idcontract_code, client_order_id
POST
/linear-swap-api/v1/swap_trailing_order
下跟踪委托单(逐仓)contract_code, volume, direction, offset, lever_rate, trailing_amount, trailing_percent, order_price_typeclient_order_id
POST
/linear-swap-api/v1/swap_cross_trailing_order
下跟踪委托单(全仓)contract_code, volume, direction, offset, lever_rate, trailing_amount, trailing_percent, order_price_typeclient_order_id
POST
/linear-swap-api/v1/swap_trailing_cancel
撤销跟踪委托单(逐仓)contract_code, order_idclient_order_id
POST
/linear-swap-api/v1/swap_cross_trailing_cancel
撤销跟踪委托单(全仓)order_idcontract_code, client_order_id
POST
/linear-swap-api/v1/swap_trailing_cancelall
撤销所有跟踪委托单(逐仓)contract_codedirection, offset
POST
/linear-swap-api/v1/swap_cross_trailing_cancelall
撤销所有跟踪委托单(全仓)contract_code, direction, offset
POST
/linear-swap-api/v1/swap_trailing_openorders
查询当前未成交跟踪委托单(逐仓)contract_codepage_index, page_size
POST
/linear-swap-api/v1/swap_cross_trailing_openorders
查询当前未成交跟踪委托单(全仓)contract_code, page_index, page_size
POST
/linear-swap-api/v1/swap_trailing_hisorders
查询历史跟踪委托单(逐仓)contract_codestatus, page_index, page_size, sort_by, direct
POST
/linear-swap-api/v1/swap_cross_trailing_hisorders
查询历史跟踪委托单(全仓)contract_code, status, page_index, page_size, sort_by, direct

Transferring Interface

划转接口

EndpointDescriptionRequiredOptionalAuthentication
POST
/linear-swap-api/v1/swap_cross_transfer_state
Query Transfer State (Cross)NoneNoneYes
POST
/linear-swap-api/v1/swap_transfer
Transfer between Spot and Futuresasset, amount, typeclient_order_idYes

Endpoint描述必填参数可选参数身份验证
POST
/linear-swap-api/v1/swap_cross_transfer_state
查询划转状态(全仓)
POST
/linear-swap-api/v1/swap_transfer
币币与合约账户划转asset, amount, typeclient_order_id

Parameters

参数说明

Common Parameters

通用参数

Contract & Symbol

合约与交易对

  • contract_code: Contract code (e.g., BTC-USDT, ETH-USDT)
  • symbol: Symbol name
  • pair: Trading pair (e.g., BTC-USDT)
  • contract_type: Contract type (swap, this_week, next_week, quarter, next_quarter)
  • business_type: Business type (futures, swap, all)
  • contract_code: 合约代码(例如:BTC-USDT, ETH-USDT)
  • symbol: 币种名称
  • pair: 交易对(例如:BTC-USDT)
  • contract_type: 合约类型(swap, this_week, next_week, quarter, next_quarter)
  • business_type: 业务类型(futures, swap, all)

Account & Margin

账户与保证金

  • margin_account: Margin account identifier
  • margin_mode: Margin mode (cross, isolated)
  • margin_asset: Margin asset (e.g., USDT)
  • account_type: Account type
  • margin_account: 保证金账户标识
  • margin_mode: 保证金模式(cross, isolated)
  • margin_asset: 保证金币种(例如:USDT)
  • account_type: 账户类型

Order Parameters

订单参数

  • order_id: Order ID (can be comma-separated for multiple orders)
  • client_order_id: Client-defined order ID
  • order_source: Order source
  • order_type: Order type
  • order_price_type: Order price type (limit, optimal_5, optimal_10, optimal_20, post_only, fok, ioc, etc.)
  • direction: Transaction direction (buy, sell)
  • offset: Offset direction (open, close, both)
  • volume: Order volume (quantity in contracts)
  • price: Order price
  • lever_rate: Leverage rate
  • reduce_only: Reduce only flag (0: no, 1: yes)
  • order_id: 订单ID(多个订单可用逗号分隔)
  • client_order_id: 客户端自定义订单ID
  • order_source: 订单来源
  • order_type: 订单类型
  • order_price_type: 订单价格类型(limit, optimal_5, optimal_10, optimal_20, post_only, fok, ioc等)
  • direction: 交易方向(buy, sell)
  • offset: 开平方向(open, close, both)
  • volume: 下单数量(合约张数)
  • price: 下单价格
  • lever_rate: 杠杆倍数
  • reduce_only: 只减仓标记(0: 否, 1: 是)

Trigger Order Parameters

计划委托参数

  • trigger_type: Trigger type (ge: greater than or equal, le: less than or equal)
  • trigger_price: Trigger price
  • triggered_price: The price when trigger order was executed
  • trigger_type: 触发类型(ge: 大于等于, le: 小于等于)
  • trigger_price: 触发价格
  • triggered_price: 计划委托触发时的价格

Take-Profit & Stop-Loss Parameters

止盈止损参数

  • tp_trigger_price: Trigger price of take-profit order
  • tp_order_price: Order price of take-profit order
  • tp_order_price_type: Order type of take-profit order
  • sl_trigger_price: Trigger price of stop-loss order
  • sl_order_price: Order price of stop-loss order
  • sl_order_price_type: Order type of stop-loss order
  • price_protect: Price protection (boolean)
  • tp_trigger_price: 止盈单触发价格
  • tp_order_price: 止盈单委托价格
  • tp_order_price_type: 止盈单订单类型
  • sl_trigger_price: 止损单触发价格
  • sl_order_price: 止损单委托价格
  • sl_order_price_type: 止损单订单类型
  • price_protect: 价格保护(布尔值)

Trailing Order Parameters

跟踪委托参数

  • callback_rate: Callback rate for trailing orders
  • active_price: Active price for trailing orders
  • is_active: Whether the active price is activated
  • callback_rate: 跟踪委托回调幅度
  • active_price: 跟踪委托激活价格
  • is_active: 激活价格是否已触发

Query Parameters

查询参数

  • page_index: Page number (default: 1)
  • page_size: Page size (default: 20, max: 50)
  • start_time: Start time (Unix timestamp in milliseconds)
  • end_time: End time (Unix timestamp in milliseconds)
  • create_date: Number of days
  • direct: Search direction (NEXT: ascending, PREV: descending)
  • from_id: Starting ID for pagination
  • sort_by: Sort field (descending order)
  • page_index: 页码(默认:1)
  • page_size: 每页数量(默认:20,最大值:50)
  • start_time: 开始时间(毫秒级Unix时间戳)
  • end_time: 结束时间(毫秒级Unix时间戳)
  • create_date: 天数
  • direct: 查询方向(NEXT: 升序, PREV: 降序)
  • from_id: 分页起始ID
  • sort_by: 排序字段(降序)

Sub-account Parameters

子账户参数

  • sub_uid: Sub-account UID
  • sub_auth: Sub-account authorization (0: disable, 1: enable)
  • sub_uid: 子账户UID
  • sub_auth: 子账户授权(0: 禁用, 1: 启用)

Transfer Parameters

划转参数

  • from: Source account (e.g., spot, linear-swap)
  • to: Destination account (e.g., spot, linear-swap)
  • currency: Currency to transfer
  • amount: Transfer amount
  • from_margin_account: Source margin account
  • to_margin_account: Destination margin account
  • from: 转出账户(例如:spot, linear-swap)
  • to: 转入账户(例如:spot, linear-swap)
  • currency: 划转币种
  • amount: 划转数量
  • from_margin_account: 转出保证金账户
  • to_margin_account: 转入保证金账户

Market Data Parameters

市场数据参数

  • period: K-line period (1min, 5min, 15min, 30min, 60min, 4hour, 1day, 1mon, 1week, 1year)
  • type: Depth type (step0-step19)
  • size: Number of records to return
  • period: K线周期(1min, 5min, 15min, 30min, 60min, 4hour, 1day, 1mon, 1week, 1year)
  • type: 深度类型(step0-step19)
  • size: 返回记录数量

Other Parameters

其他参数

  • trade_type: Trade type (0: all, 1: open long, 2: open short, 3: close short, 4: close long)
  • status: Order status (multiple statuses can be comma-separated)
  • self_match_prevent: Self-match prevention flag
  • self_match_prevent_new: Prevent self-trading
  • trade_type: 交易类型(0: 全部, 1: 开多, 2: 开空, 3: 平空, 4: 平多)
  • status: 订单状态(多个状态可用逗号分隔)
  • self_match_prevent: 自成交预防标记
  • self_match_prevent_new: 预防自交易

Enums

枚举值

Order Types

订单类型

  • order_price_type: limit, optimal_5, optimal_10, optimal_20, post_only, fok, ioc, opponent, lightning, optimal_5_fok, optimal_5_ioc, optimal_10_fok, optimal_10_ioc, optimal_20_fok, optimal_20_ioc, opponent_ioc, opponent_fok
  • order_price_type: limit, optimal_5, optimal_10, optimal_20, post_only, fok, ioc, opponent, lightning, optimal_5_fok, optimal_5_ioc, optimal_10_fok, optimal_10_ioc, optimal_20_fok, optimal_20_ioc, opponent_ioc, opponent_fok

Order States

订单状态

  • status: submitted (3), partial-filled (4), partial-canceled (5), filled (6), canceled (7), ready to submit (1), accepted (2)
  • status: submitted (3), partial-filled (4), partial-canceled (5), filled (6), canceled (7), ready to submit (1), accepted (2)

Direction & Offset

方向与开平

  • direction: buy, sell
  • offset: open, close, both
  • direction: buy, sell
  • offset: open, close, both

Margin Mode

保证金模式

  • margin_mode: isolated, cross
  • margin_mode: isolated, cross

Contract Type

合约类型

  • contract_type: swap (perpetual), this_week, next_week, quarter (current quarter), next_quarter
  • contract_type: swap(永续), this_week(当周), next_week(次周), quarter(当季), next_quarter(次季)

Position Mode

持仓模式

  • position_mode: dual_side (hedge mode), single_side (one-way mode)

  • position_mode: dual_side(双向持仓/对冲模式), single_side(单向持仓/模式)

Authentication

身份验证

For endpoints that require authentication, you will need to provide HTX API credentials.
Required credentials:
  • apiKey: Your HTX API key
  • secretKey: Your HTX API secret (for signing)
All authenticated endpoints require HMAC SHA256 signature:
  1. Create the pre-sign string in the following order:
    • HTTP method (GET/POST) + "\n"
    • API host (e.g., api.hbdm.com) + "\n"
    • API path (e.g., /linear-swap-api/v1/swap_order) + "\n"
    • Sorted query string parameters
  2. Append required parameters to all authenticated requests:
    • AccessKeyId: Your API key
    • SignatureMethod: HmacSHA256
    • SignatureVersion: 2
    • Timestamp: UTC timestamp in format yyyy-MM-ddTHH:mm:ss
  3. Sign the pre-sign string with secretKey using HMAC SHA256
  4. Append signature to query string as Signature parameter
  5. For POST requests, also include signature in the URL query string
Example pre-sign string:
POST\\n
api.hbdm.com\\n
/linear-swap-api/v1/swap_order\\n
AccessKeyId=xxx&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2017-05-11T15:19:30
需要身份验证的接口必须提供HTX API凭证。
所需凭证:
  • apiKey: 你的HTX API密钥
  • secretKey: 你的HTX API秘密密钥(用于签名)
所有需要身份验证的接口都要求HMAC SHA256签名:
  1. 按照以下顺序构造预签名字符串:
    • HTTP方法(GET/POST) + "\n"
    • API域名(例如:api.hbdm.com) + "\n"
    • API路径(例如:/linear-swap-api/v1/swap_order) + "\n"
    • 排序后的查询字符串参数
  2. 向所有身份验证请求追加必填参数:
    • AccessKeyId: 你的API密钥
    • SignatureMethod: HmacSHA256
    • SignatureVersion: 2
    • Timestamp: UTC时间戳,格式为yyyy-MM-ddTHH:mm:ss
  3. 使用secretKey通过HMAC SHA256算法对预签名字符串进行签名
  4. 将签名结果作为Signature参数追加到查询字符串中
  5. 对于POST请求,同样需要将签名放在URL查询字符串中
预签名字符串示例:
POST\\n
api.hbdm.com\\n
/linear-swap-api/v1/swap_order\\n
AccessKeyId=xxx&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2017-05-11T15:19:30

Security

安全规范

Share Credentials

凭证共享

Users can provide HTX API credentials by sending a file where the content is in the following format:
bash
fe45419a...xyz
secretabc...key
用户可以通过发送包含以下格式内容的文件提供HTX API凭证:
bash
fe45419a...xyz
secretabc...key

Never Display Full Secrets

禁止展示完整密钥

When showing credentials to users:
  • API Key: Show first 5 + last 4 characters:
    fe45419a...xyz
  • Secret Key: Always mask, show only last 5:
    ***...key1
Example response when asked for credentials:
Account: main
API Key: fe45419a...xyz
Secret: ***...key1
Environment: Mainnet
向用户展示凭证时:
  • API Key: 展示前5位 + 后4位:
    fe45419a...xyz
  • Secret Key: 始终掩码处理,仅展示最后5位:
    ***...key1
查询凭证时的响应示例:
账户:main
API Key: fe45419a...xyz
Secret: ***...key1
环境:主网

Listing Accounts

账户列表展示

When listing accounts, show names and environment only — never keys:
HTX Accounts:
* main (Mainnet)
* trading (Mainnet - AWS)
列出账户时,仅展示名称和环境,绝对不展示密钥:
HTX账户列表:
* main(主网)
* trading(主网 - AWS)

Transactions in Mainnet

主网交易确认

When performing transactions in mainnet, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.

在主网执行交易操作前,必须向用户确认,要求用户输入"CONFIRM"后再继续操作。

HTX Accounts

HTX账户配置

main

main

  • API Key: your_mainnet_api_key
  • Secret: your_mainnet_secret
  • Environment: https://api.hbdm.com
  • Description: Primary USDT-M Futures trading account
  • API Key: your_mainnet_api_key
  • Secret: your_mainnet_secret
  • 环境:https://api.hbdm.com
  • 描述:主要USDT本位合约交易账户

trading

trading

  • API Key: your_aws_api_key
  • Secret: your_aws_secret
  • Environment: https://api.hbdm.vn
  • Description: AWS optimized USDT-M Futures trading
  • API Key: your_aws_api_key
  • Secret: your_aws_secret
  • 环境:https://api.hbdm.vn
  • 描述:AWS节点优化的USDT本位合约交易账户

TOOLS.md Structure

TOOLS.md结构示例

bash
undefined
bash
undefined

HTX Accounts

HTX账户列表

main

main

  • API Key: fe45419a...xyz
  • Secret: secretabc...key
  • Environment: https://api.hbdm.com
  • Description: Primary USDT-M Futures trading account
  • API Key: fe45419a...xyz
  • Secret: secretabc...key
  • 环境:https://api.hbdm.com
  • 描述:主要USDT本位合约交易账户

trading

trading

  • API Key: test456...abc
  • Secret: testsecret...xyz
  • Environment: https://api.hbdm.vn
  • Description: AWS optimized USDT-M Futures trading
undefined
  • API Key: test456...abc
  • Secret: testsecret...xyz
  • 环境:https://api.hbdm.vn
  • 描述:AWS节点优化的USDT本位合约交易账户
undefined

Agent Behavior

Agent行为规范

  1. Credentials requested: Mask secrets (show last 5 chars only)
  2. Listing accounts: Show names and environment, never keys
  3. Account selection: Ask if ambiguous, default to main
  4. When doing a transaction in mainnet, confirm with user before by asking to write "CONFIRM" to proceed
  5. New credentials: Prompt for name, environment
  1. 凭证查询请求:掩码处理密钥(仅展示最后5位)
  2. 账户列表展示:仅展示名称和环境,绝对不展示密钥
  3. 账户选择:存在歧义时询问用户,默认使用main账户
  4. 主网交易操作:执行前要求用户输入"CONFIRM"确认后再继续
  5. 新增凭证:提示用户输入账户名称、选择环境

Adding New Accounts

新增账户流程

When user provides new credentials:
  • Ask for account name
  • Ask: Which environment (Mainnet or Mainnet-AWS)
  • Store in
    TOOLS.md
    with masked display confirmation
当用户提供新的凭证时:
  • 询问账户名称
  • 询问:选择哪个环境(主网 或 主网-AWS)
  • 存储到
    TOOLS.md
    文件中,并返回掩码后的凭证确认信息

User Agent Header

User-Agent请求头

Include
User-Agent
header with the following string:
htx-usdt-m-futures/1.0.0 (Skill)
请求中需包含
User-Agent
头,值为:
htx-usdt-m-futures/1.0.0 (Skill)

Important Notes

重要注意事项

  • All timestamps are in Unix milliseconds unless specified otherwise
  • Contract codes should use uppercase (e.g., BTC-USDT, not btc-usdt)
  • For market buy orders, the
    volume
    parameter represents the number of contracts
  • Account ID must be obtained from appropriate endpoints before trading
  • Rate limits apply - see HTX API documentation for details
  • Signature must be calculated for every authenticated request
  • Timestamp in signature must be within 1 minute of server time
  • Both isolated margin and cross margin modes are supported
  • Position modes: single_side (one-way) and dual_side (hedge)
  • Always use the correct margin mode and margin account for operations
  • For cross margin operations, use endpoints with "cross" in their path
  • For isolated margin operations, use endpoints without "cross" in their path
  • All request endpoints must match the endpoints specified in the documentation.
  • 除非特别说明,所有时间戳均为毫秒级Unix时间戳
  • 合约代码需使用大写(例如:BTC-USDT,不要使用btc-usdt)
  • 市价买单的
    volume
    参数代表合约张数
  • 交易前必须通过对应接口获取账户ID
  • 存在接口频率限制,详情请参考HTX官方API文档
  • 每个身份验证请求都必须计算签名
  • 签名中的时间戳与服务器时间的偏差不能超过1分钟
  • 同时支持逐仓保证金和全仓保证金模式
  • 持仓模式:single_side(单向持仓)和dual_side(双向持仓/对冲)
  • 操作时请使用正确的保证金模式和保证金账户
  • 全仓保证金操作请使用路径中包含"cross"的接口
  • 逐仓保证金操作请使用路径中不包含"cross"的接口
  • 所有请求端点必须与文档中指定的端点完全匹配。