SnapshotStart from a checkpointPull an L4 snapshot or replay baseline for one venue and symbol.
DiffsApply updates in orderProcess ordered diffs without dropping or reordering messages.
Live bookHold current stateOn a gap event, mark the book unsafe and rebuild from a fresh checkpoint.
L4 Workflow
| Step | Purpose |
|---|---|
| Choose family | Keep Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, and Lighter separate |
| Get baseline | Start from a snapshot or route-specific history where available |
| Apply updates | Process ordered diffs without dropping or reordering messages |
| Detect gaps | Mark local state unsafe when sequence or replay gap events appear |
| Rebuild state | Refresh from a snapshot or replay checkpoint before trusting output |
| Log metadata | Store route, channel, symbol, timestamps, gap events, and request IDs |
Implementation Pattern
Confirm route support
Use the REST route family and OpenAPI before assuming L4 exists for a venue, symbol, or plan.
Start with one symbol
Confirm the local book can process a small stream before widening to more markets.
L4 State Checklist
Capture this checklist before claiming a client maintains an L4 book.| Field | Capture |
|---|---|
| Venue family and symbol | Core, Spot, HIP-3, HIP-4, or Lighter-specific context |
| Baseline source | REST snapshot, WebSocket snapshot, checkpoint route, or replay snapshot |
| Update source | Live diffs, replay messages, REST history, or SDK iterator |
| Ordering rule | Sequence field, timestamp ordering, cursor, or replay order |
| Gap response | Mark unsafe, stop output, rebuild, or rerun the bounded window |
| Storage label | L2, L3, L4, current, historical, replayed, or reconstructed |