Skip to main content
Access to book stream in production is gated: request an API key with book stream access, or have an existing key upgraded.

Book Stream

Book stream gives you ten levels of order book depth per side, with the mid price and tick size. Levels are cumulative from the spot outward, so each level carries the total size available up to that price. Book stream covers direct routes only. For the full message format and parameters, see the Book Stream API.
1

Set up

Import a WebSocket client, read the endpoint from the environment, and pick the pair to watch.
2

Connect and subscribe

Open the connection to /book-stream and send a subscribe op once it is open. Book stream covers direct routes only.
3

Render the book

Each update carries mid, tick, and ten levels per side. b and a are arrays of { price, cumulative_size_human }, ordered nearest to spot outward, where the size is cumulative base from the spot to that level.
Quotes and book levels are approximations. DFlow computes them at runtime from current routes, so they may differ from the quote you receive at order time. Treat them as a live read on the market, not a guaranteed execution price.

Stream Top-of-Book Quotes

Read live bid and ask for a pair.

Book Stream API

Messages, fields, and the depth format.