Depth

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 nameTypeNecessaryRemarks
eventStringYsubscribe / unsubscribe
argsArrayYSubscribe param. There can be no more than 50 sym parameters per subscribe.
> channelStringYChannel name: depth/ orderbook, depth for 200 prices, orderbook for 50 prices.
> symStringYUnique identifier

Push Data

Full snapshot (updatetype: "all") — sent once on subscribe:

{
    "arg": { "channel": "depth", "sym": "BINANCE_PERP_BTC_USDT", "updatetype": "all" },
    "data": {
        "ts": "1597026383085",
        "seq": "1000",
        "pre_seq": "0",
        "num": 1,
        "Bids": [["70283.2", "0.004"], ["70282.8", "0.005"]],
        "Asks": [["70296.1", "0.095"], ["70296.2", "0.126"]]
    }

Incremental update (updatetype: "update") — all subsequent pushes:

{
    "arg": { "channel": "depth", "sym": "BINANCE_PERP_BTC_USDT", "updatetype": "update" },
    "data": {
        "ts": "1597026383085",
        "seq": "1000",
        "pre_seq": "0",
        "num": 1,
        "Bids": [["70283.2", "0.004"], ["70282.8", "0.005"]],
        "Asks": [["70296.1", "0.095"], ["70296.2", "0.126"]]
    }

FieldTypeRemarks
channelStringexample: depth
symStringUnique identifier
updatetypeStringall/update. Default is all. all : Full snapshot
update : Incremental update
tsStringMarket data generation timestamp (milliseconds)
seqStringSequence number of the current message (used for ordered processing)
pre_seqStringPrevious sequence number
numStringcumulative incremental sequence number for push messages.
BidsStringBid depth data list, with each element being [price, size].
> priceStringPrice
> qtyStringQuantity
AsksStringAsk depth data list, with each element being [price, size].
> priceStringPrice
> qtyStringQuantity