venue and symbol, so you always know where liquidity is and which instrument it is in.
The pipeline
Once per emit interval, for each book:1
Take each routable venue's latest snapshot
Stale and offline venues are dropped, with reasons.
2
Apply your fee, signed
bid × (1 − fee), ask × (1 + fee). A maker rebate is a negative fee and needs no special case.3
Merge, keeping every level
The emitted view is truncated to
depth; the book routing walks is not.4
Net off any cross
Then bucket into VWAPs, if the subscription asked for that.
Venue health
Online venues appear in the book or receive orders. A socket that stays open while silently delivering nothing is the failure that fills a hedge far through the touch, so silence is treated as a fault rather than as “no news”.
A dropped stream reconnects with exponential backoff and flips health on the way out and back. The transition is logged, not every retry, so an outage produces two lines rather than thousands.
VWAP depth
Ask for the price to fill a given size, and SORY returns both the VWAP and the limit price needed to achieve it. The gap between them is your expected slippage.[1, 5, 10] means “the VWAP to fill 1”, “to fill 5”, “to fill 10” — not three consecutive slices.
A bucket the book cannot fill is omitted rather than reported short. There is no VWAP for a fill that cannot happen, and sizing off a number that was never achievable is worse than having no number.
Crossed markets
Aggregating across venues will cross, especially once fees move prices around. By default the overlapping quantity is netted out before the router sees it. Either waybook.crossed tells you it happened — a crossed book never reaches routing unnoticed.
Streaming
emit_interval_ms (default 100ms), never under a lock, and gathered so one slow consumer cannot stall another.
Trades
Optional.start(trades=True) subscribes to the public tape.
