This project is a high-performance Limit Order Book (LOB) and Matching Engine developed to bridge the gap between financial regulation theory and computational execution. It is designed to simulate how different regulatory mandates (from ANTIC in Cameroon or the FCA in the UK) impact market liquidity and price discovery.
As markets move toward AI-driven execution and "Sovereign Cloud" infrastructures, the "physics" of the matching engine becomes a legal battleground. This simulator allows for:
- Latency Stress-Testing: Simulating the impact of 1ms–10ms network delays on market fairness.
- Algorithmic Regulation: Testing "Order-to-Trade" ratios and minimum resting time mandates as code.
- Price-Time Priority Analysis: Observing how the "Spread" behaves under different liquidity conditions.
- Language: C++17 (Optimized for low-latency execution).
-
Data Structures:
std::mapwith custom comparators for$O(\log n)$ price-level access,std::listfor$O(1)$ order insertion/deletion to maintain strict time priority. - Build System: CMake + MinGW/GCC.
- Limit Order Book: Separate Bid/Ask trees with deterministic sorting.
- Matching Engine: Automatic execution when Buy Price
$\geq$ Sell Price. - Live Market Feed: Real-time calculation of "Best Bid," "Best Ask," and "Market Spread."
- Regulatory Gateway: (In Development) Logic to block "spoofing" or high-frequency cancellations.
To build and run the simulator on Windows (MinGW):
mkdir build && cd buildcmake -G "MinGW Makefiles" ..cmake --build ..\MarketSimulator.exe