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" } ]
}]
| Code | Meaning |
|---|---|
CS | Change set - follows the previous one |
PS | Pair symbol |
BO | Changed bid levels |
AO | Changed ask levels |
Each changed level adds a CP (change process) code to the price/amount pair:
CP | Meaning |
|---|---|
0 | Amount at this price changed; A is the new amount |
1 | New price level; A is its amount |
3 | Price 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.