Learning objectives
- Recognize when a reconstructed order-flow state is no longer trustworthy.
- Reconcile a snapshot with subsequent updates without duplicate application.
Prerequisites: Understand sequence numbers and the difference between a book snapshot and trade history.
Mechanism and interpretation
An incremental feed describes changes from a previous state. Missing one change can invalidate the reconstructed book even when later messages continue arriving. A sequence gap is evidence of missing information, not evidence that nothing happened. Mark the affected state incomplete, record the gap, and use the feed's supported recovery procedure before treating it as synchronized.
A recovery snapshot describes state at a specified checkpoint. Subsequent increments must be applied from the correct boundary; applying an update already represented in the snapshot counts it twice. Conversely, skipping an update after the checkpoint omits a real change. A current book snapshot does not necessarily reconstruct every missed execution needed for historical cumulative delta. State recovery and event-history recovery are related but distinct tasks.
Worked case · synthetic data
In a simplified quantity stream, sequence 100 leaves displayed size 40. Sequence 101 is missing, and sequence 102 reports an absolute replacement size 25. A later snapshot states size 30 through sequence 104. Updates 105 and 106 add 5 and remove 8 under this toy additive protocol, so recovered size is 27. Reapplying sequence 104 after its snapshot would be wrong. The actual exchange protocol determines whether updates replace or adjust quantity.
Failure modes and context
A packet may contain several instruments and multiple messages. Do not infer instrument validity from a superficial timestamp alone. Sequence resets need explicit session handling. A recovered current book can be valid while an earlier flow bar remains incomplete. Keep completeness flags in exported features so downstream studies cannot mistake missing flow for zero flow.
Practice assignment
A snapshot covers events through sequence 500 with size 80. Buffered updates 499,500,501,502 have additive changes+3,−4,+10,−6. Which are applied after the snapshot and what is the result? If missed trades cannot be replayed, may the earlier cumulative-delta gap be labeled zero?
Worked answer
Apply only 501 and 502 under the stated checkpoint contract:80+10−6=84. Updates 499 and 500 are already represented. The earlier trade gap remains unknown unless recovered from suitable event records; a snapshot of current size cannot prove that no trades occurred. Export an incomplete interval or a declared reset instead of a fabricated zero.
Check your understanding
Question 1
What does a sequence gap establish?
- No trading occurred
- The next price is predictable
- At least one expected update is missing
Reveal answer and reasoning
C. At least one expected update is missing
Incremental reconstruction depends on the missing update even if later traffic resumes.
Question 2
What is 80+10−6 after the checkpoint?
- 80
- 84
- 83
Reveal answer and reasoning
B. 84
Apply only updates strictly after the snapshot boundary under the stated protocol.
Question 3
Does a book snapshot necessarily restore missed delta?
- No, it may lack the missing execution history
- Yes, every resting order is a trade
- Only when prices are unchanged
Reveal answer and reasoning
A. No, it may lack the missing execution history
Current displayed state and historical signed executions are different records.
