Expand description
Fill simulator: Shared logic for simulating order fills.
Used by both MockExchange (for test assertions) and PaperExchange (for paper trading).
§Performance Optimization
Uses sorted VecDeques (by price) for O(1) front removal when filling orders. This reduces complexity from O(quotes × orders) to O(quotes × fillable_orders). For grid strategies with 100 levels, this provides ~10-15x speedup.
Structs§
- Fill
Simulator - Simulates order fills based on quote price crossing.
- Pending
Order - A pending order waiting to be filled
- Simulated
Fill - Result of a simulated fill