Order-Book Reconstruction from a Market-Data Feed

Sequence checking, gap recovery via snapshot, and incremental delta application

Order-Book Reconstruction from a Market-Data Feed Sequence checking, gap recovery via snapshot, and incremental delta application 01 / Source 02 / Ingest 03 / Recover 04 / Reconstruct 05 / Consume Market Feed · seq-numbered · 01 / Source · UDP / TCP Market Feed seq-numbered UDP / TCP Sequence Check · detect gaps · 02 / Ingest · per-channel Sequence Check detect gaps per-channel Apply Deltas · incremental · 03 / Recover · ordered Apply Deltas incremental ordered Snapshot Sync · REST resync · 03 / Recover · on gap Snapshot Sync REST resync on gap Order Book · bids / asks · 04 / Reconstruct · in-memory Order Book bids / asks in-memory Strategies · signals · 05 / Consume · consumer Strategies signals consumer Book Publish · L2 depth · 05 / Consume · consumer Book Publish L2 depth consumer raw deltas wire format in-sequence ordered gap detected recovery base snapshot buffered updated book state write top of book read L2 depth read Legend primary data policy / PII async batch data store

In-sequence Path

  • • Deltas carry monotonic sequence numbers per channel
  • • Ordered messages apply directly to the live book
  • • The hot path stays lock-light and allocation-free

Gap Recovery

  • • A missing sequence number triggers a snapshot fetch
  • • Deltas newer than the snapshot are buffered, then replayed
  • • The book is never partially applied from a detected gap

Consumers

  • • Strategies read top-of-book for signals
  • • Depth is republished for downstream services
  • • Readers see a consistent reconstructed book