Websocket channel for depth data up to 200
Description
Interval: 100ms
Notes: Initial subscription will receive the full data of bid/ask price up to 200. Every 100ms will receive the delta change, changing the quantity to the price key.
Request
{"event": "subscribe", "arg": [{ "channel": "depth", "sym":"OKX_SPOT_BTC_USDT" }]}
Field name | Type | Necessary | Remarks |
---|---|---|---|
event | String | Y | subscribe / unsubscribe |
args | Array | Y | Subscribe param. There can be no more than 50 sym parameters per subscribe. |
> channel | String | Y | Channel name: depth / orderbook , depth for 200 prices, orderbook for 50 prices. |
> sym | String | Y | Unique identifier |
Response
{"event":"subscribe","arg":[{"channel":"depth","sym":"OKX_SPOT_BTC_USDT"}],"code":0,"message":"Success"}
Field | Type | Remarks |
---|---|---|
event | String | subscribe / unsubscribe |
code | String | Error Code |
msg | String | Error Message |
args | Array | Subscribe param |
> channel | String | Channel name: depth / orderbook , depth for 200 prices, orderbook for 50 prices. |
> sym | String | Unique identifier |
Data Sample:
{
"arg":{
"channel":"depth",
"sym":"OKX_SPOT_BTC_USDT",
"updatetype":"update"
},
"data":{
"ts":"1732092613759",
"seq":"37947945726",
"pre_seq":"37947945641",
"num":433,
"Bids":[
[
"93247.9",
"0.65372274"
],
[
"93242.6",
"0.02041334"
],
[
"93241.7",
"0.02811836"
],
[
"93240.1",
"0"
],
[
"93239.4",
"0.0414241"
],
[
"93238.6",
"0.20821136"
],
[
"93238.5",
"0.27"
],
[
"93235.7",
"0.21806169"
],
[
"93234.9",
"0"
],
[
"93230.7",
"0.10842291"
],
[
"93229.9",
"0"
],
[
"93223.2",
"0.17068982"
],
[
"93222.4",
"0"
],
[
"93220.1",
"0.385755"
],
[
"93217.5",
"0"
],
[
"93214",
"0.21422164"
],
[
"93200.1",
"0"
],
[
"93198.3",
"0"
],
[
"93189.5",
"0"
],
[
"93177.9",
"0.01011395"
],
[
"93171.4",
"0"
],
[
"93167.4",
"0"
],
[
"93136.6",
"0.02145111"
],
[
"93135.8",
"0.01"
],
[
"93135.2",
"0.00001075"
]
],
"Asks":[
[
"93252.2",
"0.00005326"
],
[
"93253",
"0.19705105"
],
[
"93253.8",
"0.19315446"
],
[
"93256.1",
"0.02841637"
],
[
"93256.9",
"0.04456728"
],
[
"93258.7",
"0.14661635"
],
[
"93259.9",
"0.00014644"
],
[
"93260.7",
"0.06348764"
],
[
"93264.9",
"0.00254712"
],
[
"93265.7",
"0.11325629"
],
[
"93272.4",
"0"
],
[
"93272.6",
"0.21458917"
],
[
"93273.2",
"0.17746147"
],
[
"93274.6",
"0"
],
[
"93275.9",
"0.00009664"
],
[
"93289",
"0.00001397"
],
[
"93290",
"0.06839816"
],
[
"93291",
"0.03"
],
[
"93296.9",
"0"
],
[
"93297",
"0"
],
[
"93297.2",
"0"
]
]
}
}
Field | Type | Remarks |
---|---|---|
> channel | String | Channel name: depth / orderbook , depth for 200 prices, orderbook for 50 prices. |
> sym | String | Unique identifier |
> updatetype | String | all / update . Initial subscription to receive all depth data, following with update data |
data | Array | Data |
> ts | String | Timestamp, in Unix millionsecond. e.g. 1732093591811 |
> seq | String | sequence number for the current data |
> pre_seq | String | sequence number for the previous data |
> num | String | Total pushed data times |
> bids | String | Bids data |
> > price | String | Prices |
> > qty | String | Quantity |
> asks | String | Asks data |
> > price | String | Prices |
> > qty | String | Quantity |