History of HTX Coin-margined Swaps API Version

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

1.1.4 2020-1-29 【Added:Get a Batch of Market Data Overview、Get Kline Data of Mark Price、Subscribe Kline Data of Mark Price、Request Kline Data of Mark Price. 5-17 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: /swap-ex/market/detail/batch_merged
  1. Added Get Kline Data of Mark Price
  • Interface Name: Get Kline Data of Mark Price
  • Interface Type: public
  • Interface URL: /index/market/history/swap_mark_price_kline
  1. Added Subscribe Kline Data of Mark Price
  • Interface Name: Subscribe Kline Data of Mark Price
  • Interface Type: public
  • Subscription topic: market.$contract_code.mark_price.$period
  1. Added Request Kline Data of Mark Price
  • Interface Name: Request Kline Data of Mark Price
  • Interface Type: public
  • Subscription topic: market.$contract_code.mark_price.$period
  1. Modified Cancel All Orders(Added two optional parameters in request: direction, indicates order direction, if not filled in means both with available values: “buy”, “sell”. offset, order offset, if not filled in means both with available values: “open”, “close”.)
  • Interface Name: Cancel All Orders
  • Interface Type: private
  • Interface URL: /swap-api/v1/swap_cancelall
  1. Modified Get Information of an Order(Added one field in return parameter "data": real_profit(real profit when close position).)
  • Interface Name: Get Information of an Order
  • Interface Type: private
  • Interface URL: /swap-api/v1/swap_order_info
  1. Modified Order details acquisition(Added field in return parameters both "data" and "trades": real_profit(real profit when close position). 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: /swap-api/v1/swap_order_detail
  1. Modified Current unfilled order acquisition(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 short, 4:close long. Added two fields in return parameter "orders": update_time(order updated time, in milliseconds), real_profit(real profit when close position).)
  • Interface Name: Current unfilled order acquisition
  • Interface Type: private
  • Interface URL: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_hisorders_exact
  1. Modified Acquire History Match Results(Added one field in return parameter "trades": real_profit(real profit when close position).)
  • Interface Name: Acquire History Match Results
  • Interface Type: private
  • Interface URL: /swap-api/v1/swap_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: /swap-api/v1/swap_matchresults_exact
  1. Modified Subscribe Order Data(sub)(Added one field in return data: real_profit(real profit when close position).added two fields 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.$contract_code
  1. Modified Cancel All Trigger Orders(Added two optional parameters in request: direction, order direction, if not filled in means both, with available valuse: “buy”, “sell”; offset, order offset, if not filled in means both with available values: “open”, “close”.)
  • Interface Name: Cancel All Trigger Orders
  • Interface Type: private
  • Interface URL: /swap-api/v1/swap_trigger_cancelall
  1. Modified Cancel all Take-profit and Stop-loss Orders(Added one parameter in request: direction, order direction, if not filled in means both, with available valuse: “buy”, “sell”.)
  • Interface Name: Cancel all Take-profit and Stop-loss Orders
  • Interface Type: private
  • Interface URL: /swap-api/v1/swap_tpsl_cancelall
  1. Modified Query Trigger Order Open Orders(Added one parameter in request: trade_type, 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: /swap-api/v1/swap_trigger_openorders
  1. Modified Query Open Take-profit and Stop-loss Orders(Added one parameter in request: trade_type, 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: /swap-api/v1/swap_tpsl_openorders

 

 

 

1.1.3 2021-01-12 【1 Added Get the estimated settlement price. 2-7 Added ”Set a Take-profit and Stop-loss Order“ interfaces. 8-21 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: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_order_detail
  1. Modified "Current unfilled order 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: Current unfilled order acquisition
  • Interface Type: private
  • Interface URL: /swap-api/v1/swap_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: /swap-api/v1/swap_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: /swap-api/v1/swap_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.$contract_code
  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.$contract_code
  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: /swap-api/v1/swap_trigger_hisorders
  1. Modified "Get Swap 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 Swap Open Interest Information
  • Interface Type: public
  • Interface URL: /swap-api/v1/swap_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.$contract_code.detail
  1. Modified "Query Swap Info" Interface(Added "delivery_time" in return parameter to represent delivery time(millesecond timestamp))
  • Interface Name: Query Swap Info
  • Interface Type: public
  • Interface URL: /swap-api/v1/swap_contract_info
  1. Modified "Subscribe Market Detail Data" Interface(Added "delivery_time" in return parameter to represent delivery time(millesecond timestamp))
  • Interface Name: Subscribe Contract Info (no authentication)(sub)
  • Interface Type: public
  • Subscription Topic: public.$contract_code.contract_info

 

 

1.1.2 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:swap-api/v1/swap_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:swap-api/v1/swap_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:swap-api/v1/swap_hisorders_exact

 

1.1.1 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: swap-api/v1/swap_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: swap-api/v1/swap_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.$contract_code.liquidation_orders

 

1.1.0 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:swap-api/v1/swap_matchresults_exact

2、Query history orders via multiple fields

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

3、Query financial records via multiple fields

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

 

 

1.0.9 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(swap_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:swap-api/v1/swap_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:$contract_code

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:$contract_code

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:$contract_code

5、The interface(swap_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:swap-api/v1/swap_order_info

 

1.0.8 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.0.7 2020-08-06 【Added interfaces:Subscribe market BBO data push; Query user’s available leverage;Query user’s settlement records;Subscribe trigger orders updates 】

1、Subscribe Market BBO Data

  • Interface Name:Subscribe market BBO data push
  • Interface Type:public
  • Subscribe topic:market.$contract_code.bbo

2、 Query user’s available leverage

  • Interface Name: Query user’s available leverage
  • Interface Type:private
  • Interface URL:swap-api/v1/swap_available_level_rate

3、Query user’s settlement records

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

4、Subscribe trigger orders updates

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

  

1.0.6 2020-6-19 【 Updated: added client_order_id in outer return parameter 】

1、Modified perpetual swaps subscribe match order data interface: added client_order_id in outer return parameter

  • Interface name: subscribe match order data
  • Interface type: private
  • Subscription topic: matchOrders.$contract_code

 

1.0.5 2020-06-14 【 Add interfaces: Premium index Kline data(websocket, restful); Estimated funding rate Kline data(restful, websocket); Basis data (restful, websocket);Update interfaces: add average premium index of querying historical funding rates; add four depth level of subscribing market depth; etc】

1、Add an interface: Query Premium Index Kline Data

  • Interface Name: Query Premium Index Kline Data
  • Interface Type: public interface
  • Interface URL: /index/market/history/swap_premium_index_kline

2、Add an interface: Subscribe Premium Index Kline Data

  • Interface Name: Subscribe Premium index Kline data
  • Interface Method: public interface
  • Subscribe Topic: market.$contract_code.premium_index.$period

3、Add an interface: Subscribe Premium Index Kline Data

  • Interface Name: Request Premium index Kline data
  • Interface Method: public interface
  • Request Topic: market.$contract_code.premium_index.$period

4、Add an interface: Query Estimated Funding Rate Kline Data

  • Interface Name: Query Estimated funding rate Kline
  • Interface Type: public interface
  • Interface URL: /index/market/history/swap_estimated_rate_kline

5、Add an interface: Subscribe Estimated Funding Rate Kline Data

  • Interface Name: Subscribe Estimated Funding Rate Kline
  • Interface Type: public interface
  • Subscribe Topic: market.$contract_code.estimated_rate.$period

6、Add an interface: Request Estimated Funding Rate Kline Data

  • Interface Name: Request estimated funding rate k line
  • Interface Type: public interface
  • Request Topic: market.$contract_code.estimated_rate.$period

7、Add an interface: Query Swap Basis Data

  • Interface Name: Get basis data
  • Interface Type: public interface
  • Interface URL: /index/market/history/swap_basis

8、Add an interface: Subscribe Swap Basis Data

  • Interface Name: Subscribe basis data
  • Interface Type: public interface
  • Subscribe Topic: market.$contract_code.basis.$period.$basis_ price_type

9、Add an interface: Request Swap Basis data

  • Interface Name: Request basis data
  • Interface Type: public interface
  • Request Topic: market.$contract_code.basis.$period.$basis_ price_type

10、Add average premuim index field of querying historical funding rate

  • Interface Name: Query historical funding rate
  • Interface Type: public interface
  • Interface URL: /swap-api/v1/swap_historical_funding_rate

11、Add Four depth level of subscribing Market Depth: step12,step13,step14,step15

  • Interface Name: Suscribe Market Depth
  • Interface Type: public interface
  • Interface URL: market.$contract_code.depth.$type

12、Add periodical push of websocket subscription of account: every 5s

  • Interface Name: Subscribe Account
  • Interface Type: private interface
  • Interface URL: accounts.$contract_code

13、Add periodical push of websocket subscription of position: every 5s

  • Interface Name: Subscribe Position
  • Interface Type: private interface
  • Interface URL: positions.$contract_code

14.1 Add fields: 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: swap-api/v1/swap_order_detail

14.2、Add fields: liquidation_type,canceled_at

  • Interface Name: Query Order Information
  • Interface Type: private interface
  • Interface URL: swap-api/v1/swap_order_info

14.3、Add fields: canceled_at, fee_asset

  • Interface Name: Subcribe Orders
  • Interface Type: private interface
  • Subscribe Topic: orders.$contract_code

15、Add a field returned by websocket subscription of private topics: uid

  • Interface Name: Subscribe Orders
  • Interface Type: private interface
  • Subscribe Topic: orders.$contract_code

  • Interface Name: Subscribe Accounts

  • Interface Type: private interface

  • Subscribe Topic: accounts.$contract_code

  • Interface Name: Subscribe Positions

  • Interface Type: private interface

  • Subscribe Topic: positions.$contract_code

  • Interface Name: Subscribe match Orders

  • Interface Type: private interface

  • Subscribe Topic: matchOrders.$contract_code

16、Add an interface: place a trigger order

  • Interface Name: Place a trigger order
  • Interface Type: private interface
  • Interface URL: /swap-api/v1/swap_trigger_order

17、Add an interface: Cancel trigger order

  • Interface Name: Cancel all trigger orders
  • Interface Type: private interface
  • Interface URL: /swap-api/v1/swap_trigger_cancel

18、Add an interface: Cancel all trigger orders

  • Interface Name: Cancel all trigger orders
  • Interface Type: private interface
  • Interface URL: /swap-api/v1/swap_trigger_cancelall

19、Add an interface: Query open trigger orders

  • Interface Name: Query open trigger orders
  • Interface Type: private interface
  • Interface URL: /swap-api/v1/swap_trigger_openorders

20、Add an interface: Query historical trigger orders

  • Interface Name: Query historical trigger orders
  • Interface Type: private interface
  • Interface URL: /swap-api/v1/swap_trigger_hisorders

21、Add an interface: Subscribe Match Orders

  • Interface Name: Subscribe Match Orders
  • Interface Type: private interface
  • Subscribe Topic: matchOrders.$contract_code

 

 

1.0.4 2020-5-27 【 Add an interface: websocket subscription of contract info 】

1、Add an interface: websocket subscription of contract info event

  • Interface Name: websocket subscription of contract info event

  • Interface Type: public interface.

  • Subscription topic: public.$contract_code.contract_info

 

1.0.3 2020-05-07 【 Add an interface: query assets and position info】

1、Add an interface: query assets and position info

  • Interface Name: query assets and position info

  • Interface Type: Private interface.

  • Interface URL: /swap-api/v1/swap_account_position_info

 

1.0.2 2020-04-09 [Add an interface: perpetual swaps funding rate WS push without authentication;2. Add an interface: perpetual swaps liquidation order WS push without authentication]

1、Add an interface: perpetual swaps funding rate WS push without authentication.

  • Interface name: Subscribe funding rate (no authentication)
  • Interface type: public interface.
  • Subscribe topic: public.$contract_code.funding_rate

2、 Add an interface: perpetual swaps liquidation order WS push without authentication

  • Interface name: Subscribe liquidation orders (no authentication)
  • Interface type: public interface.
  • Subscribe topic: public.$contract_code.liquidation_orders

 

1.0.1 2020-03-20

1、Log in with your master account on Web to sign the High Leverage Agreement if you use high leverage (>20x) for the first time. Afterwards, you can place order by API with high leverage (>20x).

2、The authentication path of the websocket subscription of order and user data is changed from '/notification' to '/swap-notification'.

  • Interface name: All interfaces under the websocket subscription of order and user data.
  • Interface type: User private interface.
  • Authentication path: /swap-notification.

3、Added incremental websocket subscription of orderbook data.orderbook event will be checked every 30ms.If there is no orderbook event, you will not receive any orderbook data.

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

4、Added API interface of querying user's API indicator disable information

  • Interface name: Query user's API indicator disable information
  • Interface type: User private interface
  • URL: /swap-api/v1/swap_api_trading_status

5、 Added websocket subscription of funding rate.It will be pushed once the funding rate is updated.

  • Interface name: Subscribe funding rate
  • Interface type: User private interface
  • Subscribe Topic: funding_rate.$contract_code

6、Modified on the interface of querying 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 /swap-api/v1/swap_order_limit

7、Modified on the interface of placing an order: 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: /swap-api/v1/swap_order

8、Modified on the interface of placing a batch of orders: 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: /swap-api/v1/swap_batchorder

9、Modified on the interface of placing lightning close order interface: added string "order_price_type", including values: lightning_ioc, lightning_fok, lightning

  • Interface name: Place lightning close order
  • Interface type: User private interface
  • URL: /swap-api/v1/swap_lightning_close_position

10、Modified on the interface of querying trade details for an order: added string "liquidation_type".

  • Interface name: Get trade details of an order
  • Interface type: User private interface
  • URL: POST /swap-api/v1/swap_order_detail

11、Modified "trade_type" and "orders" in the interface of querying history orders. 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 /swap-api/v1/swap_hisorders

12、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

13、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 name: transfer between master account and sub-accounts
  • Interface type: User private interface
  • URL:/swap-api/v1/swap_master_sub_transfer

14、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:/swap-api/v1/swap_api_state

15、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: /swap-api/v1/swap_master_sub_transfer_record

16、Added four kinds of transfer statements between master account and sub-accounts in returning financial record interface.

  • Interface name: Query contract financial record
  • Interface type: User private interface
  • URL: /swap-api/v1/swap_financial_record