Skip to content
Alchemy Logo

Stream an L2 order book

This API is in private preview. Endpoint availability and response schemas may change before general availability.

To maintain an L2 book from l2BookDiff, install the first message for each market as local state. It carries the current levels with isSnapshot: true. Apply later diffs in height order, checking each market's prev_seq against the snapshot seq and then against your local position.

l2Book is a standalone display snapshot, not a bootstrap source for a diff-maintained book. If continuity breaks, discard affected local state and adopt the pushed isSnapshot: true message; bootstrap and recovery use the same replacement mechanism.

For a snapshot shared by many consumers, or to let a slow client digest a large book while buffering live updates, use the REST snapshot read instead.

Advance a durable cursor only after downstream storage succeeds. Treat a gap, correction, or finality change as a reason to backfill and reconcile.

Was this page helpful?