Skip to main content

Order Book Difference (432)

Channel obdiff, event <PAIR> (for example BTCUSDT). Only the price levels that changed since the previous change set.

Subscribe with message type 151.

[432, {
"type": 432, "channel": "obdiff", "event": "BTCUSDT",
"CS": 1842,
"PS": "BTCUSDT",
"BO": [ { "CP": 0, "P": "85391", "A": "0.005" } ],
"AO": [ { "CP": 3, "P": "85412", "A": "0.0983193" } ]
}]
CodeMeaning
CSChange set - follows the previous one
PSPair symbol
BOChanged bid levels
AOChanged ask levels

Each changed level adds a CP (change process) code to the price/amount pair:

CPMeaning
0Amount at this price changed; A is the new amount
1New price level; A is its amount
3Price level removed; A is the amount it had before

Prices and amounts are strings without trailing zeros.

warning

2 is not used. If you receive any other value, discard your book and subscribe to orderbook again.

Use CS to detect gaps: apply a difference only when its CS follows the one you last applied. If it does not, drop your local book and resubscribe to Full Order Book for a fresh snapshot.