Skip to main content

Orderbook

Subscribe to the Event Contract orderbook stream. Supports 25 levels.

Push frequency: 20ms

Topic:
orderbook.25.{symbol} e.g., orderbook.25.ETHUSDT-28AUG26-2450-2570-OUT

Process snapshot/delta

Once you have subscribed successfully, you will receive a snapshot. The WebSocket will keep pushing delta messages every time the orderbook changes. If you receive a new snapshot message, you will have to reset your local orderbook.

To apply delta updates:

  • If you receive a size of 0, delete the entry
  • If you receive an entry that does not exist, insert it
  • If the entry exists, update the size

Response Parameters

ParameterTypeComments
topicstringTopic name
typestringData type: snapshot, delta
tsnumberTimestamp (ms) when the system generates the data
datamapObject
> sstringSymbol name
> rarrayPayout ratio orderbook entries. Up to 25 levels.
>> r[0]stringPayout ratio (price)
>> r[1]stringOrder value (size). Size 0 means the entry should be deleted.
> uintegerUpdate ID. If u=1, it is a snapshot caused by a service restart — overwrite your local orderbook.
> seqintegerCross sequence. Smaller seq means earlier data.
ctsnumberTimestamp from the matching engine when this data is produced

Subscribe Example

{
"op": "subscribe",
"args": [
"orderbook.25.ETHUSDT-28AUG26-2450-2570-OUT"
]
}

Response Example

{
"topic": "orderbook.25.ETHUSDT-28AUG26-2450-2570-OUT",
"ts": 1787794783020,
"type": "snapshot",
"data": {
"s": "ETHUSDT-28AUG26-2450-2570-OUT",
"r": [
["3.5", "14900"],
["2.28", "500"],
["2.07", "500"]
],
"u": 702,
"seq": 49115
},
"cts": 1787794647814
}