Order Matching Engine
A High-Performance Order Matching Engine in C++ with Cancel Support, PnL tracking, and CSV-based simulation
( GitHub )Project Overview
This project simulates a Central Limit Order Book (CLOB), which most modern exchanges use to match buy and sell orders. The engine maintains a live book of outstanding orders and matches them using price-time priority.
Features
- Supports both Limit and Market order types
- First-In-First-Out (FIFO) matching of orders by price-time priority
- PnL Tracking for all matched orders
- On-demand snapshot querying of current state of order book
- CSV data input simulation generator for add and cancel orders
- Simplified Python version of matching engine for conceptual understanding

C++ Order Matching Engine Speed for 99999 orders ( ~0.67s )

Python Order Matching Engine Speed for 99999 orders ( ~6s )

Querying for Ticker 2211 with max_id 400
Gallery

.png)
Trading Ladder Snapshot of Query for Ticker 2211 with max_id 400
Trading Ladder Snapshot of Query with Add and Cancel functionality


Input Data for Orders ( Add-Only )
Input Data for Orders (Add and Cancel)

Python Query Snapshot View