src/utils/zerodha/zerodha-event.utils.ts → buildSnapshot()
Each active index setting produces a snapshot object on every broadcast interval. Snapshots are:
- Stored in
latestSnapshotData(in-memoryMap) - Mirrored to
latestDataMapinsocket-manager.ts - Emitted via Socket.IO as
{indexName}TickData - Persisted to
IndexDataMongoDB collection
Top-level snapshot
Legacy flat fields (from options)
When options are active, OI and bid/ask fields are flattened to the top level for backward compatibility with the financial table UI:Cash segment (cash)
Futures segment (futures)
Options segment (options)
Strike entry
Each strike in the chain contains:baseValue resolution
getActiveSegmentValue selects baseValue based on activeSegment:
Fallback: options underlying → futures LTP → cash LTP →
0.
Consumers
See Latest data map and Data flow for the full pipeline.