Market

MarketQuoteMarket

Interface Description

The interface feature is that for each websocket connection, each time the request is sent, the backend will overwrite the previous subscription request by default. After the subscription is successful, data will be pushed.

Request-Protocol Number: 14010

Data format:json

Data Structure

data definition

Symbol definition

Request Example

Copy

{
    "cmd_id":14010,
    "seq_id":123,
    "ext":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
        "symbol_list": [
            {
		"symbol_id": 112312,
		"trade_type": 1,
                "trade_mode": 0,
                "depth_level": 5,
                "merge_accuracy":"0.001",
                "trade_info_count": 5,
            },
	],
    }
}

Response-Protocol Number: 14011

Data format:json

Data Structure

data definition

Tick ​​definition

bid_deep definition

ask_deep definition

trade_info definition

Example Response

Copy

{
    "ret":200,
    "msg":"ok",
    "cmd_id":14011,
    "seq_id":123,
    "ext":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
        "tick_list":[
            {
		"symbol_id": 123,
		"trade_type": 1,
                "trade_mode": 0,
		"seq": 1605509068000001,
		"tick_time": 1605509068,
                "price_digits": 2,
		"bid_deep": [
                    {
			"price_bid": "9.12",
                        "volume_bid": "9.12",
                    },
		],
                "ask_deep": [
                    {
			"price_ask": "147.12",
			"volume_ask": "147.12",
                    },
		],
                "trade_info": [
                    {
			"price": "651.12",
                        "volume": "100",
                        "trade_direction": 1,
                        "trade_time": 1605509068,
                    },
		]
            },
        ]
    }    
}

Push data - real-time transaction quotation push

illustrate

The quotation push mainly reflects the transaction information. The push data content is a string. Currently, one quotation is pushed at a time. The backend service will push the data to the requester only after the requester sends a quotation subscription request.

Field Explanation

pt(product ID, quote transaction type, transaction mode, quote sequence number, quote timestamp, current price, transaction volume, transaction direction); "pt(symbol_id,trade_type,trade_mode,seq,tick_time,price,volume,trade_direction);" trade_type value meaning 1: full position contract, 2: single position contract, 3: leverage, 5: spot, 6: stock trade_mode value meaning 1: MM, 2: butterfly MM, 3: matching, 4: aggregation

Push data example

"pt(1123,1,0,1232312,34545435345,6.23,1000,1);"

Push data-market quote push

illustrate

The quote push mainly reflects the market information, and will merge the deep quotes according to the merge precision field in the subscription request. The push data content is a string, and currently one quote is pushed at a time. The backend service will push the data to the requester only after the requester sends a market transaction quote subscription request.

Field Explanation

pd(product ID, quotation transaction type, transaction mode, quotation sequence number, quotation timestamp);(1st tier bid price, 1st tier bid volume)(2nd tier bid price, 2nd tier bid volume);(1st tier ask price, 1st tier ask volume)(2nd tier ask price, 2nd tier ask volume); "pd(symbol_id,trade_type,trade_mode,seq,tick_time);(price_bid1,volume_bid1)(price_bid2,volume_bid2);(price_ask1,volume_ask1)(price_ask2,volume_ask2);" trade_type value meaning 1: full position contract, 2: single position contract, 3: leverage, 5: spot, 6: stock trade_mode value meaning 1: MM, 2: butterfly MM, 3: matching, 4: aggregation

Push data example

"pd(1123,1,0,1232312,34545435345);(6.23,123)(6.22,256);(6.24,111)(6.25,222);" "pd(1123,1,0,1232312,34545435345) ;(6.23,123)(6.22,256);(6.24,111)(6.25,222)(6.25,333);" "pd(1123,1,0,1232312,34545435345);;(6.24,111)( 6.25,222)(6.25,333);"

Last updated