History of HTX Coin-margined Futures API Version

API Access:https://huobiglobal.zendesk.com/hc/en-us/articles/360000188382

1.2.3 2021-1-29 【Added:Get a Batch of Market Data Overview. 2-14 Added fields to modify interface. The order_id of submitted trigger order response has been changed from the original natural number self-incrementing ID to a unique identification ID with a length of 18 digits. It is recommended to use the order_id_str (order_id in string type) of submitted order response to avoid the occurrence of truncation by the system because excessive length.】

  1. Added Get a Batch of Market Data Overview
  • Interface Name: Get a Batch of Market Data Overview
  • Interface Type: public
  • Interface URL: /market/detail/batch_merged
  1. Modified Cancel All Orders(Added two optional parameters in request: direction, “buy”/“sell”, if not filled in means all; offset, “open”/“close”, if not filled in means all.)
  • Interface Name: Cancel All Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_cancelall
  1. Modified Get Information of an Order(Added "real_profit" in return parameter "data" to represent real profit)
  • Interface Name: Get Information of an Order
  • Interface Type: private
  • Interface URL: /api/v1/contract_order_info
  1. Modified Order details acquisition(Added one field in return parameters both "data" and "trades": real_profit(real profit). And added one filed in "trades" to indicates each trade profit:profit (profit when close position))
  • Interface Name: Order details acquisition
  • Interface Type: private
  • Interface URL: /api/v1/contract_order_detail
  1. Modified Query Open Orders(Added two optional parameters in request: sort_by, is sort field, if not filled in means order by create_at descending, with available values: “created_at”(descending order), “update_time”(descending order); trade_type, indicates trade type, if not filled in means all, with available values: 0:all, 1:open long, 2:open short, 3:close sell, 4:close buy. Added two fields in return parameter "orders": update_time(order updated time, in milliseconds), real_profit(real profit when close position).)
  • Interface Name: Query Open Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_openorders
  1. Modified Get History Orders(Added one field in return parameter "orders": real_profit(real profit when close position).)
  • Interface Name: Get History Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_hisorders
  1. Modified Query history orders via multiple fields(Added one field in return parameter "orders": real_profit(real profit when close position).)
  • Interface Name: Query history orders via multiple fields
  • Interface Type: private
  • Interface URL: /api/v1/contract_hisorders_exact
  1. Modified Get History Match Results(Added one field in return parameter "trades": real_profit(real profit when close position).)
  • Interface Name: Get History Match Results
  • Interface Type: private
  • Interface URL: /api/v1/contract_matchresults
  1. Modified Query history transactions via multiple fields(Added one field in return parameter "trades": real_profit(real profit when close position).)
  • Interface Name: Query history transactions via multiple fields
  • Interface Type: private
  • Interface URL: /api/v1/contract_matchresults_exact
  1. Modified Subscribe Order Data(sub)(Added one field in return: real_profit(real profit when close position).added field in return parameter "trade": profit(profit when close position), real_profit(real profit when close position))
  • Interface Name: Subscribe Order Data(sub)
  • Interface Type: private
  • Subscription topic: orders.$symbol
  1. Modified Cancel All Trigger Orders(Added two parameters in request: direction, indicates order direction, if not filled in means both, with available values: “buy”, “sell”; offset, indicates order offset, if not filled in means both, with available values: "open”, “close”.)
  • Interface Name: Cancel All Trigger Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_trigger_cancelall
  1. Modified Cancel all Take-profit and Stop-loss Orders(Added one parameter in request: direction, indicates order direction, if not filled in means both, with available values: "buy", "sell".)
  • Interface Name: Cancel all Take-profit and Stop-loss Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_tpsl_cancelall
  1. Modified Query Trigger Order Open Orders(Added one parameter in request: trade_type, indicates order trade type, if not filled in means all, with available values: 0:all,1:open long, 2:open short, 3:close short, 4:close long.)
  • Interface Name: Query Trigger Order Open Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_trigger_openorders
  1. Modified Query Open Take-profit and Stop-loss Orders(Added one parameter in request: trade_type, indicates order trade type, if not filled in means all, with available values: 0:all, 3:close short, 4:close long.)
  • Interface Name: Query Open Take-profit and Stop-loss Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_tpsl_openorders

 

 

 

1.2.2 2021-01-12 【1 Added Get the estimated settlement price. 2-7 Added ”Set a Take-profit and Stop-loss Order“ interfaces. 8-23 Added fields to modify interface. Added the first-level menu of [Contract Trigger Order], and add take-profit and stop-loss related interfaces and move the original contract trigger order related interfaces to this menu】

  1. Added Get The Estimated Settlement Price
  • Interface Name: Get the estimated settlement price
  • Interface Type: public
  • Interface URL: /api/v1/contract_estimated_settlement_price
  1. Added Set a Take-profit and Stop-loss Order for an Existing Position
  • Interface Name: Set a Take-profit and Stop-loss Order for an Existing Position
  • Interface Type: private
  • Interface URL: /api/v1/contract_tpsl_order
  1. Added Cancel a Take-profit and Stop-loss Order
  • Interface Name: Cancel a Take-profit and Stop-loss Order
  • Interface Type: private
  • Interface URL: /api/v1/contract_tpsl_cancel
  1. Added Cancel all Take-profit and Stop-loss Orders
  • Interface Name: Cancel all Take-profit and Stop-loss Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_tpsl_cancelall
  1. Added Query Open Take-profit and Stop-loss Orders
  • Interface Name: Query Open Take-profit and Stop-loss Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_tpsl_openorders
  1. Added Query Take-profit and Stop-loss History Orders
  • Interface Name: Query Take-profit and Stop-loss History Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_tpsl_hisorders
  1. Added Query Info Of Take-profit and Stop-loss Order That Related To Position Opening Order
  • Interface Name: Query Info Of Take-profit and Stop-loss Order That Related To Position Opening Order
  • Interface Type: private
  • Interface URL: /api/v1/contract_relation_tpsl_order
  1. Modifed "Place an order" Interface(added optional 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))
  • Interface Name: Place an order
  • Interface Type: private
  • Interface URL: /api/v1/contract_order
  1. Modified "Place a batch of orders" Interface (added optional parameters in parameters "orders_data": tp_trigger_price (Trigger price of take-profit order),tp_order_price (Order price of take-profit order), tp_order_price_typeOrder 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))
  • Interface Name: Place a batch of orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_batchorder
  1. Modified "Get Information of an Order" Interface(Added return parameter "is_tpsl" to indicate whether to set take-profit and stop-loss order, 1: yes, 0: no); added "enumerated values" in return parameter "order_source"(“tpsl” indicates triggered by take-profit and stop-loss))
  • Interface Name: Get Information of an Order
  • Interface Type: private
  • Interface URL: /api/v1/contract_order_info
  1. Modified "Order details acquisition" Interface(Added return parameter "is_tpsl" to indicate whether to set take-profit and stop-loss order, 1: yes, 0: no); added "enumerated values" in return parameter "order_source"(“tpsl” indicates triggered by take-profit and stop-loss))
  • Interface Name: Order details acquisition
  • Interface Type: private
  • Interface URL: /api/v1/contract_order_detail
  1. Modified "Query Open Orders" Interface(Added return parameter "is_tpsl" to indicate whether to set take-profit and stop-loss order, 1: yes, 0: no); added "enumerated values"in return parameter "order_source"(“tpsl” indicates triggered by take-profit and stop-loss))
  • Interface Name: Query Open Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_openorders
  1. Modified "Get History Orders" Interface(Added paprameter "sort_by" to represent "sort fields" with optional value“create_date” and “update_time"; added return parameter "is_tpsl" to indicate whether to set take-profit and stop-loss order, 1: yes, 0: no), and "update_time" to indicate order's update time); and "enumerated values" in return parameter "order_source"(“tpsl” indicates triggered by take-profit and stop-loss))
  • Interface Name: Get History Orders
  • Interface Type: private
  • Interface URL: /api/v1/contract_hisorders
  1. Modified "Query history orders via multiple fields" Interface(Added return parameter "is_tpsl" to indicate whether to set take-profit and stop-loss order, 1: yes, 0: no); added "enumerated values"in return parameter "order_source"(“tpsl” indicates triggered by take-profit and stop-loss))
  • Interface Name: Query history orders via multiple fields
  • Interface Type: private
  • Interface URL: /api/v1/contract_hisorders_exact
  1. Modified "Subscribe Order Data(sub)" Interface(Added return parameter "is_tpsl" to indicate whether to set take-profit and stop-loss order, 1: yes, 0: no); added "enumerated values" in return parameter "order_source"(“tpsl” indicates triggered by take-profit and stop-loss))
  • Interface Name: Subscribe Order Data(sub)
  • Interface Type: private
  • Subscription Topic: orders.$symbol
  1. Modified "Subscribe Match Order Data(sub)" Interface(Added return parameter "is_tpsl" to indicate whether to set take-profit and stop-loss order, 1: yes, 0: no); added "enumerated values" in return parameter "order_source"(“tpsl” indicates triggered by take-profit and stop-loss))
  • Interface Name: Subscribe Match Order Data(sub)
  • Interface Type: private
  • Subscription Topic: matchOrders.$symbol
  1. Modified "Query Trigger Order History" Interface(Added paprameter "sort_by" to represent "sort fields" with optional values “created_at” and “update_time”). added "update_time" to indicate order's update time))
  • Interface Name: Query Trigger Order History
  • Interface Type: private
  • Interface URL: /api/v1/contract_trigger_hisorders
  1. Modified "Get Kline Data" Interface(Support to query K-line data of contracts that have been delisted in the last four weeks; Users can enter the contract code to query data of contracts delisted in the last four weeks.)
  • Interface Name: Get Kline Data
  • Interface Type: public
  • Interface URL: market/history/kline
  1. Modified "Subscribe Kline data" Interface(Support to query K-line data of contracts which have been delisted in the last four weeks; User can enter contract code to query data of contracts delisted in the last four weeks.)
  • Interface Name: Subscribe Kline data
  • Interface Type: public
  • Subscription Topic: market.$symbol.kline.$period
  1. Modified "Get Contract Open Interest Information" Interface(Added "trade_volume" in return parameter "data" to indicate trading volume within the last 24 hours (cont), and "trade_amount" to indicate trading volume within the last 24 hours (coin), and "trade_turnover" to represent trading amount within the last 24 hours.
  • Interface Name: Get Contract Open Interest Information
  • Interface Type: public
  • Interface URL: /api/v1/contract_open_interest
  1. Modified "Subscribe Market Detail Data" Interface(Added "ask" in return parameter “tick” to represent “sell one” and “bid” to represent "buy one".)
  • Interface Name: Subscribe Market Detail Data
  • Interface Type: public
  • Subscription Topic: market.$symbol.detail
  1. Modified "Get Contract Info" Interface(Added "settlement_time" in return parameter to represent next settlement time(millisecond timestamp)and "delivery_time" to represent delivery time(millesecond timestamp))
  • Interface Name: Get Contract Info
  • Interface Type: public
  • Interface URL: /api/v1/contract_contract_info
  1. Modified "Subscribe Contract Info Changes" Interface(Added "settlement_time" in return parameter to represent next settlement time(millisecond timestamp)and "delivery_time" to represent delivery time(millesecond timestamp))
  • Interface Name: Subscribe Contract Info (no authentication)(sub)
  • Interface Type: public
  • Subscription Topic: public.$symbol.contract_info

 

 

1.2.1 2020-12-02 【 Modified “Order details acquisition” interface (When querying cancelation data of orders that have not been partially filled, if “created_at” and “order_type” parameters are not uploaded, the data that can be queried reduced from last 12 hours to last 2 hours.); modified “Query history orders” interface (When querying cancelation data of orders that have not been partially filled, the data that can be retained reduced from last 24 hours to last 2 hours.); modified “Query history orders via multiple fields” interface (When querying cancelation data of orders that have not been partially filled, the data that can be retained reduced from last 24 hours to last 2 hours.)】

1、Modified “Order details acquisition” interface (When querying cancelation data of orders that have not been partially filled, if “created_at” and “order_type” parameters are not uploaded, the data that can be queried reduced from last 12 hours to last 2 hours.)

  • Interface Name:Order details acquisition
  • Interface Type:private
  • Interface URL:api/v1/contract_order_detail

2、modified “Query history orders” interface (When querying cancelation data of orders that have not been partially filled, the data that can be retained reduced from last 24 hours to last 2 hours.)

  • Interface Name:Get History Orders
  • Interface Type:private
  • Interface URL:api/v1/contract_hisorders

3、modified “Query history orders via multiple fields” interface (When querying cancelation data of orders that have not been partially filled, the data that can be retained reduced from last 24 hours to last 2 hours.)

  • Interface Name:Query history orders via multiple fields
  • Interface Type:private
  • Interface URL:api/v1/contract_hisorders_exact

 

1.2.0 2020-11-24 【 Added: Query historical settlement records of the platform interface. Modified: Added fields of return parameter for "Query Liquidation Orders" interface and "Subscribe Liquidation Order Data" interface】

1、Added “Query historical settlement records of the platform” interface

  • Interface Name: Query historical settlement records of the platform
  • Interface Type: public
  • Interface URL: api/v1/contract_settlement_records

2、Added fields of return parameter for "Query Liquidation Orders" interface(“amount” are added for return parameter “data". "amount" represents the liquidation amount (token);)

  • Interface Name: Query Liquidation Orders
  • Interface Type: public
  • Interface URL: api/v1/contract_liquidation_orders

3、Added fields of return parameter for "Subscribe Liquidation Order Data" interface(“amount” are added for return parameter “data". "amount" represents the liquidation amount (token);)

  • Interface Name: Subscribe Liquidation Order Data
  • Interface Type: public
  • Subscription topic: public.$symbol.liquidation_orders

 

1.1.9 2020-10-28 【Newly added:Query financial records via multiple fields, Query history orders via multiple fields, Query history transactions via multiple fields.】

1、Query history transactions via multiple fields

  • Interface Name:Query history transactions via multiple fields
  • Interface Type:private
  • Interface URL:api/v1/contract_matchresults_exact

2、Query history orders via multiple fields

  • Interface Name:Query history orders via multiple fields
  • Interface Type:private
  • Interface URL:api/v1/contract_hisorders_exact

3、Query financial records via multiple fields

  • Interface Name:Query financial records via multiple fields
  • Interface Type:private
  • Interface URL:api/v1/contract_financial_record_exact

 

1.1.8 2020-10-15 【Newly added:Added switch leverage interface; Updated: websocket messages of account topic will be pushed when leverage switch succeeds; websocket messages of position topic will be pushed when leverage switch succeeds; new response fields are added on websocket topic of match orders; the interface(contract_order_info) supports query of 4-hour order cancellation data (previously only support to query 24-hour data).】

1、Added switch leverage interface

  • Interface Name:Switch Leverage
  • Interface Type:private
  • Interface URL:api/v1/contract_switch_lever_rate

2、Subscribe Account Equity Updates Data(Return parameters added “switch_lever_rate” event type to represent switching leverages. When the leverage is successfully switched, a latest information on assets will be pushed with event“switch_lever_rate".)

  • Interface Name:Subscribe Account Equity Updates Data
  • Interface Type:private
  • Subscribe topic:$symbol

3、Subscribe Position Updates(Return parameters added “switch_lever_rate” event type to represent switching leverages. When the leverage is successfully switched, a latest information on positions will be pushed with event“switch_lever_rate" (the information will not be pushed when the user's position is 0).)

  • Interface Name:Subscribe Position Updates
  • Interface Type:private
  • Subscribe topic:$symbol

4、Subscribe Match Order Data(Added the following fields in return parameters: direction (buy/sell direction), offset (open/close direction), lever_rate (leverages), price (order price), created_at (creation time), order_source (order source), order_price_type (order quotation type).)

  • Interface Name:Subscribe Match Order Data
  • Interface Type:private
  • Subscribe topic:$symbol

5、The interface(contract_order_info) supports query of 4-hour order cancellation data (previously only support to query 24-hour data).

  • Interface Name:Get Information of an Order
  • Interface Type:private
  • Interface URL:api/v1/contract_order_info

 

1.1.7 2020-10-10【Newly added: Added WS interface for subscribing system status updates push】

1、Added WS interface for subscribing system status updates push

  • Interface name: subscribe system status updates
  • Interface type: public
  • Subscription topic:public.$service.heartbeat

 

1.1.6 2020-09-22 【Updated: Future Market Data Interfaces (including rest and ws interfaces) already support calls according to the contract code. Modified “symbol” field in request parameter: added contract code type, the format of which is fixed at “symbol-year-month-date”, for example, BTC200925. Only listing contracts can be queried currently if query according to the contract code. 】

1、Get Market Depth

  • Interface Name:Get Market Depth
  • Interface type: public interface
  • Interface URL:/market/depth

2、Get Kline Data

  • Interface Name:Get Kline Data
  • Interface type: public interface
  • Interface URL:/market/history/kline

3、Get Market Data Overview

  • Interface Name:Get Market Data Overview
  • Interface type: public interface
  • Interface URL:/market/detail/merged

4、Query The Last Trade of a Contract

  • Interface Name:Query The Last Trade of a Contract
  • Interface type: public interface
  • Interface URL:/market/trade

5、Query a Batch of Trade Records of a Contract

  • Interface Name:Query a Batch of Trade Records of a Contract
  • Interface type: public interface
  • Interface URL:/market/history/trade

6、Subscribe Kline data

  • Interface Name:Subscribe Kline data
  • Interface type: public interface
  • Subscribe topic:$symbol.kline.$period

7、Request Kline data

  • Interface Name:Request Kline data
  • Interface type: public interface
  • Subscribe topic:$symbol.kline.$period

8、Subscribe Market Depth Data

  • Interface Name:Subscribe Market Depth Data
  • Interface type: public interface
  • Subscribe topic:$symbol.depth.$type

9、Subscribe Market Detail Data

  • Interface Name:Subscribe Market Detail Data
  • Interface type: public interface
  • Subscribe topic:$symbol.detail

10、Subscribe Trade Detail Data

  • Interface Name:Subscribe Trade Detail Data
  • Interface type: public interface
  • Subscribe topic:$symbol.trade.detail

11、Request Trade Detail Data

  • Interface Name:Request Trade Detail Data
  • Interface type: public interface
  • Subscribe topic:$symbol.trade.detail

12、Subscribe Incremental Market Depth Data

  • Interface Name:Subscribe Incremental Market Depth Data
  • Interface type: public interface
  • Subscribe topic:$symbol.depth.size_${size}.high_freq

13、Subscribe Market BBO Data

  • Interface Name:Subscribe Market BBO Data
  • Interface type: public interface
  • Subscribe topic:$symbol.bbo

 

 

1.1.5 2020-08-06 【Added interfaces:Query user’s settlement records;Subscribe trigger orders updates】

1、、Query user’s settlement records

  • Interface Name:Query user’s settlement records
  • Interface Type:private
  • Interface URL:api/v1/contract_user_settlement_records

2、Subscribe trigger orders updates

  • Interface Name:Subscribe trigger orders updates
  • Interface Type:private
  • Subscribe topic:trigger_order.$symbol

 

1.1.4 2020-6-19 【Updated: added the return field ”client_order_id” of websocket subscription of Match Order】

1、Modified futures subscribe match order data interface: added client_order_id in outer return parameter.

  • Interface name: Subscribe Match Order
  • Interface type: Private Interface
  • Subscription topic: matchOrders.$symbol

 

1.1.3 2020-06-12 【Added interfaces: websocket subscription of contract info event; websocket subscription of Market BBO; Restful Interface of querying available leverage rate; Modified Interfaces: added four depth level of websocket subscription of Market Depth; added periodical push of websocket subscription of accout event and position event; added response fields of querying orders related; added uid fields of websocket subscription of private event; added fields of websocket subscription of match orders; added high leverage; added next quarter contract;】

1、Added websocket subscription of contract info

  • Interface name: Subscribe Contract Info
  • Interface type: public interface
  • Subscribe topic: public.$symbol.contract_info

2、Added websocket subscription of Market BBO

  • Interface name: Subscribe Market BBO
  • Interface type: public interface
  • Subscribe topic: market.$symbol.bbo

3、Added four depth level of websocket subscription of market depth: step12、step13、step14、step15

  • Interface name: Subscribe Market Depth
  • Interface type: public interface
  • Subscribe topic: market.$symbol.depth.$type

4、Added the interface of querying available leverage rate

  • Interface name: Query Available leverage Rate
  • Interface type: private interface
  • Interface URL: /api/v1/contract_available_level_rate

5、Added periodical push of websocket subscription of account: push every 5 seconds

  • Interface name: Subscribe Account Update
  • Interface type: private interface
  • Subscribe topic: accounts.$symbol

6、Added periodical push of websocket subscription of position: push every 5 seconds

  • Interface name: Subscribe Position Update
  • Interface type: private interface
  • Subscribe topic: positions.$symbol

7、Added high leverage support of placing orders

7.1

  • Interface name: Place an Order
  • Interface type: private interface
  • Interface URL: api/v1/contract_order

7.2

  • Interface name: Place Orders
  • Interface type: private interface
  • Interface URL: api/v1/contract_batchorder

7.3

  • Interface name: Place Trigger Order
  • Interface type: private interface
  • Interface URL: api/v1/contract_trigger_order

8、Added 9 fields of querying order detail interface: fee、order_id、order_id_str、client_order_id、order_type、status、trade_avg_price、trade_turnover、trade_volume.

  • Interface name: Query order detail
  • Interface type: Private Interface
  • Interface URL: api/v1/contract_order_detail

9、Added 2 fields of querying order info interface: liquidation_type、canceled_at.

  • Interface name: Query Order Info
  • Interface type: Private interface
  • Interface URL: api/v1/contract_order_info

10、Added 2 fields of websocket subscription of orders: canceled_at、fee_asset.

  • Interface name: Subscribe Orders
  • Interface type: Private interface
  • Subscribe topic: orders.$symbol

11、Added uid field of websocket subscription of private events.

11.1

  • Interface name: Subscribe Orders
  • Interface type: Private Interface
  • Subscribe topic: orders.$symbol 

11.2

  • Interface name: Subscribe Accounts
  • Interface type: Private Interface
  • Subscribe topic: accounts.$symbol 

11.3

  • Interface name: Subscribe Positions
  • Interface type: Private Interface
  • Subscribe topic: positions.$symbol 

11.4

  • Interface name: Subscribe Match Orders
  • Interface type: Private Interface
  • Subscribe topic: matchOrders.$symbol

12、Added 2 fields of websocket subscription of match orders: trade_volume(total filled volume of the order)、volume(total volume of the order)

  • Interface Name: Subscribe Match Orders
  • Interface Type: Private Interface
  • Subscribe Topic: matchOrders.$symbol

13、Added next quarter contract type,such as BTC_NQ

  • Interface Name: Market、Account and Trade Related(Restful and websocket)
  • Interface Type: Public/Private

 

1.1.2 2020-04-09【Add an interface: Futures liquidation order WS push without authentication】

  • Interface name: WebSocket liquidation order push
  • Subscribe topic: public.$symbol.liquidation_orders
  • Interface type: public interface

1.1.1 2020-03-12 【upgrade:added websocket subscription of index kline data;added websocket subscription of basis data; added restful interface of querying index kline data; added restful interface of querying basis data】

1、Added websocket subscription of index kline data

  • Interface name:Subscribe Index Kline Data
  • Interface type:public interface
  • Subscribe Topic:market.$symbol.index.$period

2、Added websocket subscription of basis data

  • Interface name:Subscribe Basis Data
  • Interface type: public interface
  • Subscribe Topic:market.$symbol.basis.$period.$basis_price_type

3、Added restful interface of querying index kline data

  • Interface name: Get Index Kline Data
  • Interface type: public interface
  • Interface URL:/index/market/history/index

4、Added restful interface of querying basis data

  • Interface name:Get Basis Data
  • Interface type:public interface
  • Interface URL:/index/market/history/basis

1.1.0 【upgrade:add transfer between master account and sub-account; add more order types; add websocket subscription of match orders】

1、Added asset transfer function between master account and sub-account on Web and API. When using Web, only master account has transfer authority, including transfer master account assets to sub-account and vice versa, but transfers between sub-accounts are not supported; When using API, only API Key of master account has authority for the transfer operations between master and sub account.

1.1、Added an interface: transfer between master account and sub-accounts, the rate limit between the master account and each subaccount is 10 times/ minute.Interface name: Transfer between master account and sub-accounts.

Interface type: User private interface
URL:api/v1/contract_master_sub_transfer

1.2、Added a parameter: transfer permission between master account and sub-accounts. Added strings: "master_transfer_sub" and "sub_transfer_master" in returning parameter data array.

Interface name: Query information on system status
Interface type: Public
URL:api/v1/contract_api_state

1.3、Added an interface: query transfer records of master account and sub-accounts.

Interface name: Query transfer records of master account and sub-accounts.
Interface type: User private interface
URL: api/v1/contract_master_sub_transfer_record

1.4、Added 4 kinds transfer statements of master account and sub-accounts in query contract financial record interface.

Interface name: Query contract financial record
Interface type: User private interface
URL: api/v1/contract_financial_record

2、Modifications details of contract asset interface and contract trade interface are laid out as following:

2.1、Modified query contract information on order limit: added 10 order price types including opponent_ioc, lightning_ioc, optimal_5_ioc, optimal_10_ioc,optimal_20_ioc,opponent_fok,lightning_fok,optimal_5_fok,optimal_10_fok,optimal_20_fok

Interface name: Query contract information on order limit
Interface type: User private interface
URL: POST api/v1/contract_order_limit

2.2、Modified place an order interface: added 8 order price types, including opponent_ioc, optimal_5_ioc, optimal_10_ioc, optimal_20_ioc, opponent_fok,optimal_5_fok, optimal_10_fok, optimal_20_fok.

Interface name: Place an order
Interface type: User private interface
URL: api/v1/contract_order

2.3、Modified place a batch of orders interface: added 8 order price types, including opponent_ioc, optimal_5_ioc, optimal_10_ioc, optimal_20_ioc, opponent_fok, optimal_5_fok, optimal_10_fok, optimal_20_fok.

Interface name: Place a batch of orders
Interface type: User private interface
URL: api/v1/contract_batchorder

2.4、Modified get trade details of an order interface: added string "liquidation_type".

Interface name: Get trade details of an order
Interface type: User private interface
URL: POST api/v1/contract_order_detail

2.5、Modified "trade_type" and "orders" in query history orders interface. Added "reduce positions to close long" and "reduce positions to close short" types in request parameter "trade_type"; Added string "liquidation_type" in orders array of returning parameter.

Interface name: Query history orders interface.
Interface type: User private interface
URL: POST api/v1/contract_hisorders

2.6、Modified place flash close order interface: added string "order_price_type", including values:lightning_ioc, lightning_fok, lightning

Interface name: Place flash close order
Interface type: User private interface
URL: api/v1/lightning_close_position

2.7、Added string "liquidation_type" in order transaction push in WebSocket Subscription.

Interface name: Match result on order push in WebSocket subscription
Interface type: User private interface
Subscribe Topic: orders.$symbol

2.8、Added matching order transaction push interface in WebSocket Subscription.

Interface name: WebSocket matching order transaction push
Interface type: User private interface
Subscribe Topic: matchOrders.$symbol

2.9、Queried if system interface is available, added strings on perpetual swap related status, added strings "swap_heartbeat"、"swap_estimated_recovery_time"in the array "data" with the returned parameters

Interface name: Queried if system interface is available
Interface type: public
URL: https://www.hbdm.com/heartbeat

2.10、Added API interface of getting user's API indicator disable information
Interface name: get user's API indicator disable information

Interface type: User private interface
Interface type: public
URL: api/v1/contract_api_trading_status

 

1.0.11 API Uprade

  1.  Interface URL: api/v1/contract_batchorder
  • the maximum number of batch order cancellation each time in request parameter “orders_data” will be changed from 20 to 10.

     2.  Interface URL: api/v1/contract_cancel

  • the maximum number of order cancellation each time in request parameter “order_id” and “client_order_id” will be changed from 20 to 10. Multiple order IDs are separated by “,”.

 

1.0.10 API Upgrade

  1. modify get Kline data interface:Added two request parameters “from” and “to”. Request parameter “from” stands for starting time and request parameter “to” stands for ending time. Data can be obtained for up to two consecutive years. Request parameter “size” was changed to non-mandatory.
  • /market/history/kline Get K-line data
  1. When getting information on order cancellation via get contracts Information interface, users can only query last 24-hour data.
  • /api/v1/contract_order_info Get Contracts Information
  1. When getting information on order cancellation via query history orders interface, users can only query last 24-hour data.
  • /api/v1/contract_hisorders
  1. When getting information on order cancellation via query order detail interface, users who type in parameters “created_at” and “order_type” can query last 90-day data, while users who don’t type in parameters “created_at” and “order_type” can only query last 24-hour data.
  • /api/v1/contract_order_detail

 

1.0.9【changelog: Added API interface with trigger order function.】

  1. Added API interface with query assets and positions function.
  • rest uri: api/v1/contract_account_position_info Added to get the current assets and positions.
  1. Added API interface with trigger order function.
  • api/v1/contract_trigger_order` Added API interface with place trigger order function
  • api/v1/contract_ trigger_cancel` Added API interface with cancel trigger order funcion
  • api/v1/contract_trigger_cancelall` Added API interface with cancal all trigger orders function
  • api/v1/contract_trigger_openorders` Added API interface with get trigger orders function
  • api/v1/contract_trigger_hisorders` Added API interface with get history trigger orders function
  1. Updated API interfaces with fee coin type field added corresponding to the given fee.

         Interfaces are as follows:

  • api/v1/contract_fee` query current fee rate
  • api/v1/contract_order_info`query order information
  • api/v1/contract_order_detail`query order detail
  • api/v1/contract_openorders`query current open orders
  • api/v1/contract_hisorders`query history orders
  • api/v1/contract_matchresults`query history transactions
  • add fee coin type push in websocket transactions subcription
  1. Updated API interfaces with the 'create_date' field to support any positive interger

         Please note that the system will return with the last 90-day data by default if the 'create_date' field             exceed 90.

  • api/v1/contract_hisorders`query history orders
  • api/v1/contract_trigger_hisorders`query history trigger orders
  • api/v1/contract_matchresults`query history transactions
  • api/v1/contract_financial_record`query financial records

 

1.0.8 API Upgrade:Added the order_id_str field

  1. To solve the problem that the return order_id of node.js and javascript users is over 18 bits,, the order_id_str field will be added to the following interface, the type is String, which is expected to go online today:
  • api/v1/contract_order
  • api/v1/contract_batchorder
  • api/v1/contract_matchresults
  • api/v1/contract_hisorders
  • api/v1/contract_openorders
  • api/v1/lightning_close_position
  • api/v1/contract_order_info
  1. Added order_id_str in WS subscription

 

1.0.7 API Upgrade: Added FOK

The return order_id is 18 bits, it will make mistakes when nodejs and JavaScript analysed 18 bits. Because the JSON.parse in nodejs and JavaScript is int by default, the number over 18 bits needs to be parsed by json-bigint package. Please check the demo of nodejs for details.

  1. Modified rest interface: Order details acquisition
  •  The request parameter“created_at”in rest interface “Order details acquisition” (URL: api/v1/contract_order_detail) was changed from “true” to “false”under Mandatory.
  1. Modified rest interface: User’s Account Information
  • Added return string “margin_static”in rest interface User’s Account Information (URL: api/v1/contract_account_info). The newly added return string “margin_static” in data array means account static equity.
  1. Added string “ID “in three interfaces;
  • Added string “id” in rest interface Order details acquisition (URL: api/v1/contract_order_detail) ,rest interface Acquire History Match Results (URL: api/v1/contract_matchresults) as well as the match result on Order Push in WebSocket Subscription.  You can use match_id and the new field "id" to combine a unique trade ID.
  1. Added “FOK“ order types for order placement
  • Added order_price_type “fok”under Request Parameter  in rest interface Place an Order(URL: api/v1/contract_order) and rest interface Place a Batch of Orders(URL: api/v1/contract_batchorder)
  1. Modified interface: Query contract information on order limit
  • Added “fok”:FOK Order, into string of“ order_price_type” in Returning Parameter under rest interface Query contract information on order limit (URL: api/v1/contract_order_limit)
  • The“ order_price_type” means Order Type here.
  1. Added rest API interface: Query information on system status
  • Interface URL: api/v1/contract_api_state
  1. Added rest interface: Top Trader Sentiment Index Function-Account
  • Interface URL: api/v1/contract_elite_account_ratio
  1. Added rest interface: Top Trader Sentiment Index Function-Position
  •  Interface URL: api/v1/contract_elite_position_ratio
  1. Added Liquidation order query function in API and WS subscription.
  • Added rest interface: Request Liquidation Order Information Interface URL: rest interface api/v1/contract_liquidation_orders
  • Liquidation order push is added also into WebSocket Subscription.

 

1.0.6 API Upgrade: Added rest interface

      1. Added rest interface

1.0.5 API Upgrade: New Features of Query and Order Placing

  1. Newly Added API Restful Interface
  • Newly added Interface: query user’s order limit information
  • Newly added Interface: query user’s trading fee information
  • Newly added Interface: query user’s transfer limit information
  • Newly added Interface: query users’ position limit information
  • Newly added Interface: query platform information on insurance fund and estimated clawback rate
  • Newly added Interface: query platform information on open interest information
  • Newly added Interface: query history records information on insurance fund
  • Newly added Interface: query platform information on Tiered Adjustment Factor
  • Newly added Interface: place Flash Close order
  1. Modified API Interface
  • Restful interface: add “return to users’ adjustment factor” on Query Users’ Account Information Interface.;
  • Restful interface: add “return to users’ adjustment factor” on Query a Single Sub-Account’s Assets Information Interface.
  • WebSocket Interface: add “return to users’ adjustment factor” on WebSoket Portfolio Push Interface;
  • Restful Interface: add Optimal price set with optimal top 5, optimal 10 and optimal top 20 on Order Place Interface and Place a Batch of Orders Interface
  • Restful Interface: add “query according contract code” on Acquire History of Match Results Interface

1.0.4 API Upgrade:Restful interface

  1. Query assets information of all sub-accounts under the master account
  • URL:api/v1/contract_sub_account_list
  • Notice: Only return data for activated contract sub-account (i.e. sub-accounts that have gained contract trading permission).
  1. Query a single sub-account's assets information
  • URL:api/v1/contract_sub_account_info
  • Notice: Only query account information for activated contract sub-account (i.e. sub-accounts that have gained contract trading permission); No data return for sub-accounts which has logged in hbdm but have not gained trading permission/activated.
  1. Query a single sub-account's position information
  • URL:api/v1/contract_sub_position_info
  1. Query account financial records
  • URL:api/v1/contract_financial_record

 

1.0.3 API Upgrade: WebSoket Portfolio Push 

  • WebSoket balance push is available: users could subscribe the interface to get information of their balances automatically.
  • WebSoket position push is available: users could subscribe the interface to get information of their positions automatically.
  • Acuqire positions information via Restful interface: api/v1/contract_position_info .The string of “latest price”is added into response

 

1.0.2  API Upgrade: Transfer margin between Spot account and Future account

  1. URL /v1/futures/transfer
  • This interface is used to transfer assets between Spot account and Future account.
  • The type is “pro-to-futures” when transferring assets from Spot account to Future; “futures-to-pro” when transferring from Future account to Spot account.
  • API rate limit for this interface is up to 10 times per minute.
  1. API rate limit
  • Private interface rate limit has been increased from 10 times/second to 30 times every 3 seconds, which means users could send up to 30 requests within 3 seconds.
  • The rate limit of other non-market public interface has been increased from 20 times/second to 60 times every 3 seconds, which means users could send up to 60 requests within 3 seconds.

 

1.0.1 API Upgrade: Post_only and more

  1. Cancel all interface: URL api/v1/contract_cancelall 
  • Send symbol to cancel all the contracts of that kind of symbol, e.g. send “BTC” to cancel all BTC weekly, biweekly and quarterly contracts.
  • Send contract_code to cancel the contracts of that code.
  • Send symbol+contract_type to cancel the certain contracts under the symbol of that contract_type, e.g. send “BTC” and “this week”, then the BTC weekly contracts will be cancelled.
  1. Order place interface: URL api/v1/contract_order
  • Post_only is added into the string of order_price_type.
  • Description of post_only: assure that the maker order remains as maker order, it will not be filled immediately with the use of post_only, for the match system will automatically check whether the price of the maker order is higher/lower than the opponent first price, i.e. higher than bid price 1 or lower than the ask price 1. If yes, the maker order will placed on the orderbook, if not, the maker order will be cancelled.
  • Position limit will be applied to post_only while order limit will not.
  1. Place a batch of orders: URL /v1/contract_batchorder
  • Post_only is added into the string of order_price_type.
  • Description of post_only: assure that the maker order remains as maker order, it will not be filled immediately with the use of post_only, for the match system will automatically check whether the price of the maker order is higher/lower than the opponent first price, i.e. higher than bid price 1 or lower than the ask price 1. If yes, the maker order will placed on the orderbook, if not, the maker order will be cancelled.
  • Position limit will be applied to post_only while order limit will not.
  1. Will response following string for "header" via api
  • ratelimit-limit: the upper limit of requests per time, unit: time
    ratelimit-interval: reset interval (reset the number of request), unit: ms
    ratelimit-remaining: the left available request number for this round, unit: time
    ratelimit-reset: upper limit of reset time used to reset request number, unit: ms


  1. Order details acquisition: URL api/v1/contract_order_detail
  • The string of “role” (i.e. taker or maker) is added into “trades”
  1. Acquire history of match results: URL api/v1/contract_matchresults
  • The string of “role” (i.e. taker or maker) is added into “trades
  1. WebSoket, the private order push interface, requires API KEY Verification
  • Each UID can build at most create 10 WS connections for private order push at the same time. For each account, contracts of the same underlying coin only need to subscribe one WS order push, e.g. users only need to create one WS order push connection for BTC Contract which will automatically push orders of BTC weekly, BTC biweekly and BTC quarterly contracts.
  • Please note that the rate limit of WS order push and RESTFUL private interface are separated from each other, with no relations.

  

1.0.0 has launched on December 10, 2018