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
Parameter | Type | Comments |
---|---|---|
topic | string | Topic name |
ts | number | The timestamp (ms) that message is sent out |
type | string | Data type. snapshot |
data | array | Object |
> s | string | Trading pair |
> t | number | The timestamp (ms) that system generates the data. |
> b | array | Bids. The element is sorted by price in descending order |
>> b[0] | string | Bid price |
>> b[1] | string | Bid size |
> a | array | Asks. The element is sorted by price in ascending order |
>> a[0] | string | Ask price |
>> a[1] | string | Ask 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"
]
]
}
}