mcpField
U
usdt-m-futures

usdt-m-futures

github.com/htx-exchangeOther19132 installsUpdated 2d ago
Repository

About usdt-m-futures

A trading skill for HTX USDT-M Futures users, documenting public and authenticated APIs for market, account, position, and funding-rate data, along with some trading and account operations.

Key features

  1. 01Query futures market data
  2. 02View account and position details
  3. 03Retrieve funding rates and settlement records
  4. 04Check leverage, limits, and system status

Use cases

  1. 01Inspect contract depth and K-lines
  2. 02Query account assets and positions
  3. 03Review historical funding rates and liquidation data

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/htx-exchange/htx-skills-hub --skill usdt-m-futures

After installing, type/usdt-m-futuresin Claude Code to confirm it loaded.

Bundled filesLICENSE.mdreferences/authentication.md

Details

From the project README

HTX USDT-M Futures Skill

USDT-M Futures trading on HTX using authenticated and public API endpoints. Return the result in JSON format.

Base URLs

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).

Reference Data
EndpointDescriptionRequiredOptionalAuthentication
GET /linear-swap-api/v3/swap_unified_account_typeAccount type queryNoneNoneYes
POST /linear-swap-api/v3/swap_switch_account_typeAccount Type Changeaccount_typeNoneYes
GET /linear-swap-api/v1/swap_funding_rateQuery funding ratecontract_codeNoneNo
GET /linear-swap-api/v1/swap_batch_funding_rateQuery a Batch of Funding Ratecontract_codeNoneNo
GET /linear-swap-api/v1/swap_historical_funding_rateQuery historical funding ratecontract_codepage_index, page_sizeNo
GET /linear-swap-api/v1/swap_liquidation_ordersQuery Liquidation Orderscontract_codetrade_type, create_date, page_index, page_sizeNo
GET /linear-swap-api/v1/swap_settlement_recordsQuery historical settlement recordscontract_codepage_index, page_sizeNo
GET /linear-swap-api/v1/swap_elite_account_ratioQuery Top Trader Sentiment Index (Account)contract_codeperiodNo
GET /linear-swap-api/v1/swap_elite_position_ratioQuery Top Trader Sentiment Index (Position)contract_codeperiodNo
GET /linear-swap-api/v1/swap_system_statusQuery information on system status (Isolated)contract_codeNoneNo
POST /linear-swap-api/v1/swap_cross_tiered_margin_infoQuery information on Tiered Margin (Cross)NoneNoneYes
POST /linear-swap-api/v1/swap_tiered_margin_infoQuery information on Tiered Margin (Isolated)contract_codeNoneYes
GET /linear-swap-api/v1/swap_estimated_settlement_priceGet the estimated settlement pricecontract_codeNoneNo
POST /linear-swap-api/v1/swap_adjustment_factorQuery Tiered Adjustment Factor (Isolated)contract_codeNoneYes
POST /linear-swap-api/v1/swap_cross_adjustment_factorQuery Tiered Adjustment Factor (Cross)NoneNoneYes
GET /v1/insurance_fund_infoQuery risk reserve balance informationcontract_codeNoneNo
GET /v1/insurance_fund_historyQuery historical risk reservescontract_codepage_index, page_sizeNo
GET /linear-swap-api/v1/swap_price_limitQuery Swap Price Limitationcontract_codeNoneNo
GET /linear-swap-api/v1/swap_open_interestGet Swap Open Interest Informationcontract_codeNoneNo
GET /linear-swap-api/v1/swap_contract_infoQuery Contract Infocontract_codeNoneNo
GET /linear-swap-api/v1/swap_indexQuery Swap Index Price Informationcontract_codeNoneNo
GET /linear-swap-api/market/swap_contract_constituentsGet index componentsindex_codeNoneNo
GET /linear-swap-api/v1/swap_query_elementsContract Elementscontract_codeNoneNo
GET /linear-swap-api/v1/swap_timestampGet current system timestampNoneNoneNo
GET https://api.hbdm.com/heartbeat/Query whether the system is availableNoneNoneNo
Market Data
EndpointDescriptionRequiredOptionalAuthentication
GET /linear-swap-ex/market/depthGet Market Depthcontract_codetypeNo
GET /linear-swap-ex/market/bboGet Market BBO Datacontract_codeNoneNo
GET /linear-swap-ex/market/klineGet KLine Datacontract_code, periodsize, from, toNo
GET /linear-swap-ex/market/mark_price_klineGet Kline Data of Mark Pricecontract_code, periodsize, from, toNo
GET /linear-swap-ex/market/overviewGet Market Data Overviewcontract_codeNoneNo
GET /linear-swap-ex/market/batch_overviewGet a Batch of Market Data Overviewcontract_codeNoneNo
GET /linear-swap-ex/market/tradeQuery The Last Trade of a Contractcontract_codeNoneNo
GET /linear-swap-ex/market/tradesQuery a Batch of Trade Recordscontract_codesizeNo
GET /linear-swap-ex/market/open_interestQuery information on open interestcontract_codeNoneNo
GET /linear-swap-ex/market/premium_index_klineQuery Premium Index Kline Datacontract_code, periodsize, from, toNo
GET /linear-swap-ex/market/estimated_funding_rate_klineQuery Estimated Funding Rate Klinecontract_code, periodsize, from, toNo
Account Interface
EndpointDescriptionRequiredOptionalAuthentication
POST /linear-swap-api/v1/swap_account_infoQuery Asset ValuationNonevaluation_assetYes
POST /linear-swap-api/v1/swap_account_infoQuery Account Information (Isolated)contract_codeNoneYes
POST /linear-swap-api/v1/swap_cross_account_infoQuery Account Information (Cross)Nonevaluation_assetYes
POST /linear-swap-api/v1/swap_position_infoQuery Position Information (Isolated)contract_codeNoneYes
POST /linear-swap-api/v1/swap_cross_position_infoQuery Position Information (Cross)Nonecontract_codeYes
POST /linear-swap-api/v1/swap_account_position_infoQuery Assets And Positions (Isolated)contract_codeNoneYes
POST /linear-swap-api/v1/swap_cross_account_position_infoQuery Assets And Positions (Cross)Nonevaluation_assetYes
POST /linear-swap-api/v1/swap_sub_account_listSet Sub-Account Trading Permissionssub_uidtradesYes
POST /linear-swap-api/v1/swap_account_info_listQuery all sub-accounts (Isolated)NoneNoneYes
POST /linear-swap-api/v1/swap_cross_account_info_listQuery all sub-accounts (Cross)Nonevaluation_assetYes
POST /linear-swap-api/v1/swap_account_info_subQuery single sub-account (Isolated)contract_code, sub_uidNoneYes
POST /linear-swap-api/v1/swap_cross_account_info_subQuery sub-account (Cross)sub_uidvaluation_assetYes
POST /linear-swap-api/v1/swap_position_info_subQuery sub-account position (Isolated)contract_code, sub_uidNoneYes
POST /linear-swap-api/v1/swap_cross_position_info_subQuery sub-account position (Cross)sub_uidcontract_codeYes
POST /linear-swap-api/v3/swap_financial_recordQuery account financial recordsNonecontract_code, type, start_time, end_time, page_index, page_size, directYes
POST /linear-swap-api/v3/swap_financial_record_exactQuery financial records via fieldsNonecontract_code, type, start_time, end_time, page_index, page_size, directYes
POST /linear-swap-api/v1/swap_available_level_rateQuery available leverage (Isolated)contract_codeNoneYes
POST /linear-swap-api/v1/swap_cross_available_level_rateQuery available leverage (Cross)NoneNoneYes
POST /linear-swap-api/v1/swap_order_limitQuery order limitNonecontract_code, order_price_typeYes
POST /linear-swap-api/v1/swap_feeQuery swap trading feeNonecontract_codeYes
POST /linear-swap-api/v1/swap_transfer_limitQuery transfer limit (Isolated)contract_codeNoneYes
POST /linear-swap-api/v1/swap_cross_transfer_limitQuery transfer limit (Cross)NoneNoneYes
POST /linear-swap-api/v1/swap_position_limitQuery position limit (Isolated)contract_codeNoneYes
POST /linear-swap-api/v1/swap_cross_position_limitQuery position limit (Cross)NoneNoneYes
POST /linear-swap-api/v1/swap_lever_position_limitQuery position limit all leverages (Isolated)contract_codeNoneYes
POST /linear-swap-api/v1/swap_cross_lever_position_limitQuery position limit all leverages (Cross)NoneNoneYes
POST /linear-swap-api/v1/swap_master_sub_transferTransfer between master and subsub_uid, asset, amount, typeclient_order_idYes
POST /linear-swap-api/v1/swap_master_sub_transfer_recordQuery transfer recordsNonesub_uid, transfer_type, page_index, page_size, direct, sort_byYes
POST /linear-swap-api/v1/swap_transfer_innerTransfer between margin accountsasset, amount, from_margin_account, to_margin_accountclient_order_idYes
GET /linear-swap-api/v1/swap_api_trading_statusQuery API indicator disable infoNoneNoneYes
POST /linear-swap-api/v1/linear-cancel-afterAutomatic Order Cancellationtimeoutcontract_codeYes
Trade Interface
EndpointDescriptionRequiredOptionalAuthentication
POST /linear-swap-api/v1/swap_cross_query_trade_stateQuery Trade State (Cross)NoneNoneYes
POST /linear-swap-api/v1/swap_switch_position_modeSwitch Position Mode (Isolated)contract_code, modeNoneYes
POST /linear-swap-api/v1/swap_cross_switch_position_modeSwitch Position Mode (Cross)modecontract_codeYes
POST /linear-swap-api/v1/swap_orderPlace 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_orderPlace 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_cross_batch_ordersPlace A Batch Of Orders (Cross)orders_dataNoneYes
POST /linear-swap-api/v1/swap_cancelCancel an Order (Isolated)contract_code, order_idclient_order_idYes
POST /linear-swap-api/v1/swap_cross_cancelCancel An Order (Cross)order_idcontract_code, client_order_idYes
POST /linear-swap-api/v1/swap_cancelallCancel All Orders (Isolated)contract_codedirection, offsetYes
POST /linear-swap-api/v1/swap_cross_cancelallCancel All Orders (Cross)Nonecontract_code, direction, offsetYes
POST /linear-swap-api/v1/swap_switch_lever_rateSwitch Leverage (Isolated)contract_code, lever_rateNoneYes
POST /linear-swap-api/v1/swap_cross_switch_lever_rateSwitch Leverage (Cross)lever_ratecontract_codeYes
POST /linear-swap-api/v1/swap_order_infoGet Information of an Order (Isolated)contract_code, order_idclient_order_idYes
POST /linear-swap-api/v1/swap_cross_order_infoGet Information of order (Cross)order_idcontract_code, client_order_idYes
POST /linear-swap-api/v1/swap_order_detailOrder details acquisition (Isolated)contract_code, order_idcreated_at, page_index, page_size, client_order_idYes
POST /linear-swap-api/v1/swap_cross_order_detailGet Detail Information (Cross)order_idcontract_code, created_at, page_index, page_size, client_order_idYes
POST /linear-swap-api/v1/swap_openordersCurrent unfilled orders (Isolated)contract_codepage_index, page_sizeYes
POST /linear-swap-api/v1/swap_cross_openordersCurrent unfilled orders (Cross)Nonecontract_code, page_index, page_sizeYes
POST /linear-swap-api/v3/swap_hisordersGet 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_hisordersGet 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_exactHistory 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_exactHistory 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_matchresultsHistory Match Results (Isolated)contract_code, trade_typestart_time, end_time, page_index, page_size, directYes
POST /linear-swap-api/v3/swap_cross_matchresultsHistory Match Results (Cross)trade_typecontract_code, start_time, end_time, page_index, page_size, directYes
POST /linear-swap-api/v3/swap_matchresults_exactMatch Results via Fields (Isolated)contract_code, trade_typestart_time, end_time, page_index, page_size, directYes
POST /linear-swap-api/v3/swap_cross_matchresults_exactMatch Results via Fields (Cross)trade_typecontract_code, start_time, end_time, page_index, page_size, directYes
POST /linear-swap-api/v1/swap_lightning_close_positionLightning Close Order (Isolated)contract_code, volume, directionclient_order_id, order_price_typeYes
POST /linear-swap-api/v1/swap_cross_lightning_close_positionLightning Close Position (Cross)contract_code, volume, directionclient_order_id, order_price_typeYes
GET /linear-swap-api/v1/swap_position_sideQuery position mode (Isolated)contract_codeNoneYes
GET /linear-swap-api/v1/swap_cross_position_sideQuery position mode (Cross)Nonecontract_codeYes
Strategy Order Interface
EndpointDescriptionRequiredOptionalAuthentication
POST /linear-swap-api/v1/swap_trigger_orderPlace 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_orderPlace 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_cancelCancel Trigger Order (Isolated)contract_code, order_idclient_order_idYes
POST /linear-swap-api/v1/swap_cross_trigger_cancelCancel Trigger Order (Cross)order_idcontract_code, client_order_idYes
POST /linear-swap-api/v1/swap_trigger_cancelallCancel All Trigger Orders (Isolated)contract_codedirection, offsetYes
POST /linear-swap-api/v1/swap_cross_trigger_cancelallCancel All Trigger Orders (Cross)Nonecontract_code, direction, offsetYes
POST /linear-swap-api/v1/swap_trigger_openordersQuery Trigger Order Open Orders (Isolated)contract_codepage_index, page_sizeYes
POST /linear-swap-api/v1/swap_cross_trigger_openordersQuery Trigger Order Open Orders (Cross)Nonecontract_code, page_index, page_sizeYes
POST /linear-swap-api/v1/swap_trigger_hisordersQuery Trigger Order History (Isolated)contract_codetrigger_type, status, page_index, page_size, sort_by, directYes
POST /linear-swap-api/v1/swap_cross_trigger_hisordersQuery Trigger Order History (Cross)Nonecontract_code, trigger_type, status, page_index, page_size, sort_by, directYes
POST /linear-swap-api/v1/swap_tpsl_orderSet 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_orderSet 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_cancelCancel TP/SL Order (Isolated)contract_code, order_idclient_order_idYes
POST /linear-swap-api/v1/swap_cross_tpsl_cancelCancel TP/SL Order (Cross)order_idcontract_code, client_order_idYes
POST /linear-swap-api/v1/swap_tpsl_cancelallCancel all TP/SL Orders (Isolated)contract_codeNoneYes
POST /linear-swap-api/v1/swap_cross_tpsl_cancelallCancel all TP/SL Orders (Cross)Nonecontract_codeYes
POST /linear-swap-api/v1/swap_tpsl_openordersQuery Open TP/SL Orders (Isolated)contract_codepage_index, page_sizeYes
POST /linear-swap-api/v1/swap_cross_tpsl_openordersQuery Open TP/SL Orders (Cross)Nonecontract_code, page_index, page_sizeYes
POST /linear-swap-api/v1/swap_tpsl_hisordersQuery TP/SL History Orders (Isolated)contract_codestatus, page_index, page_size, sort_by, directYes
POST /linear-swap-api/v1/swap_cross_tpsl_hisordersQuery TP/SL History Orders (Cross)Nonecontract_code, status, page_index, page_size, sort_by, directYes
Transferring Interface
EndpointDescriptionRequiredOptionalAuthentication
POST /linear-swap-api/v1/swap_cross_transfer_stateQuery Transfer State (Cross)NoneNoneYes

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)
Account & Margin
  • margin_account: Margin account identifier
  • margin_mode: Margin mode (cross, isolated)
  • margin_asset: Margin asset (e.g., USDT)
  • account_type: 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)
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
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)
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
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)
Sub-account Parameters
  • sub_uid: Sub-account UID
  • sub_auth: Sub-account authorization (0: disable, 1: enable)
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
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
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
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 States
  • 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
Margin Mode
  • margin_mode: isolated, cross
Contract Type
  • contract_type: swap (perpetual), this_week, next_week, quarter (current quarter), next_quarter
Position Mode
  • position_mode: dual_side (hedge mode), single_side (one-way mode)

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

Security

Share Credentials

Users can provide HTX API credentials by sending a file where the content is in the following format:

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
Listing Accounts

When listing accounts, show names and environment only — never keys:

HTX Accounts:
* main (Mainnet)
* trading (Mainnet - AWS)
Transactions in Mainnet

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


HTX Accounts

main
  • API Key: your_mainnet_api_key
  • Secret: your_mainnet_secret
  • Environment: https://api.hbdm.com
  • Description: Primary USDT-M Futures trading account
trading
  • API Key: your_aws_api_key
  • Secret: your_aws_secret
  • Environment: https://api.hbdm.vn
  • Description: AWS optimized USDT-M Futures trading
TOOLS.md Structure
## HTX Accounts

### main
- API Key: fe45419a...xyz
- Secret: secretabc...key
- Environment: https://api.hbdm.com
- Description: Primary USDT-M Futures trading account

### trading
- API Key: test456...abc
- Secret: testsecret...xyz
- Environment: https://api.hbdm.vn
- Description: AWS optimized USDT-M Futures trading

Agent Behavior

  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

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

User Agent Header

Include User-Agent header with the following string: 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.

Comments

Markdown supported