Market Overview
The src/market/ layer orchestrates how orders flow through the simulated market. It provides:
- shared request/response and event types,
- data structures that hold instruments, portfolios, and order books,
- helper actions for mutating portfolios and market state,
- stores for time-based order expiry,
- matching and market engines that process external requests against the order books,
- telemetry utilities that keep rolling snapshots (best bid/ask, midprice, OHLCV bars) available to agents and provide on-demand depth queries.
- order-flow logging that records every add, trade, cancel, and expiry event for offline analysis or replay.