Skip to main content

Orderbook

Market depth data for a trading pair:

  • Snapshot depth: 40 each for asks and bids.
  • Events trigger order book version change:
    • order enters order book
    • order leaves order book
    • order quantity changes
    • order filled

Pushes snapshot data only

Push frequency: 100ms

Topic: orderbook.40.{symbol}

Response Parameters

ParameterTypeComments
topicstringTopic name
tsnumberThe timestamp (ms) that message is sent out
typestringData type. snapshot
dataarrayObject
> sstringTrading pair
> tnumberThe timestamp (ms) that system generates the data.
> barrayBids. The element is sorted by price in descending order
>> b[0]stringBid price
>> b[1]stringBid size
> aarrayAsks. The element is sorted by price in ascending order
>> a[0]stringAsk price
>> a[1]stringAsk size

Subscribe Example

{
"req_id": "depth00001", //optional
"op": "subscribe",
"args": [
"orderbook.40.BTCUSDT"
]
}

Stream Example

{
"topic": "orderbook.40.BTCUSDT",
"ts": 1673439424737,
"type": "snapshot",
"data": {
"s": "BTCUSDT",
"t": 1673439424737,
"b": [
[
"17423",
"0.809534"
],
[
"17422.86",
"0.043596"
],
...
],
"a": [
...
[
"17428.28",
"0.004811"
],
[
"17428.62",
"0.23"
]
]
}
}