Documentation Index
Fetch the complete documentation index at: https://whitebit-mintlify-fix-broken-links-1774829655.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Market Depth channel provides real-time order book data with support for both one-time queries and subscription-based updates.Update Behavior
After successful subscription, the server sends a full snapshot of the order book as the first
depth_update message. All subsequent messages are incremental updates containing only the changes since the last update.Public
depth updates exclude Retail Price Improvement (RPI) orders. The depth_update stream includes only regular order book liquidity.Private active order endpoints and private WebSocket streams return RPI orders. The exchange UI order book (web and mobile) displays RPI orders.Understanding Updates
- First message (
past_update_idis absent): Full order book snapshot with all price levels - Subsequent messages (
past_update_idis present): Only changed price levels - Removed levels: Shown as
[price, "0"]- when amount is “0”, remove the price level from the local order book
If 10 seconds elapse without any order book changes, the server pushes a full snapshot again as a keepalive mechanism.
Maintaining a Local Order Book
To maintain an accurate local order book, follow the algorithm below:- Subscribe to depth updates
- Receive the first message (full snapshot) - initialize the order book
- For each incremental update:
- If amount is “0” → remove the price level
- If amount is not “0” → update existing level or insert new level at the correct sorted position
- Keep order book sorted: asks ascending, bids descending
- Truncate to the desired limit after each update