DusanTodorovic5 /
StockSimulator
Stock exchange simulator made in Swing using Java with logic backend in C++ giving it faster load time and better data control
27/100 healthLoading repository data…
Sid110406 / repository
Backend exchange simulator featuring a C++ price-time priority matching engine and Python FastAPI REST API layer
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A high-performance electronic trading matching engine built in Modern C++ with a FastAPI backend. The project simulates the core functionality of a real-world exchange by maintaining independent order books for multiple symbols and matching orders using Price-Time Priority (FIFO).
The matching engine is written entirely in C++ for performance, while Python bindings expose the engine through REST APIs.
REST API
│
FastAPI Backend
│
Python Service Layer
│
pybind11 Bindings
│
C++ Matching Engine Core
│
Independent Order Books
The engine follows the same matching strategy used by modern exchanges.
Priority:
Priority:
This guarantees Price-Time Priority (FIFO).
backend/
│
├── app/
│ ├── routes/
│ ├── services/
│ ├── models/
│ ├── utils/
│ ├── engine/
│ └── main.py
│
└── Cpp_files/
├── core/
│ ├── MatchingEngine.cpp
│ ├── OrderBook.cpp
│ ├── Order.cpp
│ └── ...
│
└── bindings/
├── bindings.cpp
└── CMakeLists.txt
Each trading symbol maintains its own independent order book.
The order book stores:
Buy side:
Highest Price
↓
FIFO Queue
Sell side:
Lowest Price
↓
FIFO Queue
The engine is designed for concurrent environments.
Features include:
This allows multiple symbols to be processed concurrently while preserving correctness.
Client
│
POST /order
│
FastAPI
│
Validation
│
Generate Order ID
│
Python Bindings
│
C++ Matching Engine
│
Trades Generated
│
REST Response
POST /order
Submits either a Market or Limit order.
DELETE /order/{symbol}/{order_id}
Cancels an active order.
GET /book/{symbol}/best_buy_price
Returns the highest bid currently available.
GET /book/{symbol}/best_sell_price
Returns the lowest ask currently available.
GET /orderbook/symbols
Returns all symbols currently maintained by the engine.
The matching engine was benchmarked under both single-threaded and multi-threaded workloads to evaluate throughput and scalability.
Single Thread
Orders Processed : 10,000,000
Execution Time : 8.52 s
Throughput : 1.17 Million Orders/sec
Multi Thread
Threads : 4
Symbols : 4
Orders Processed : 4,000,000
Execution Time : 0.875 s
Throughput : 4.57 Million Orders/sec
OrderBook can be processed independently.OrderBook.| Feature | Complexity |
|---|---|
| Order Matching | O(log P + T) |
| Order Insertion | O(log P) |
| Order Cancellation | O(1) |
| Best Bid / Ask | O(1) |
| Multi-Symbol Processing | Parallel |
| Matching Policy | Price-Time Priority (FIFO) |
Where:
Planned enhancements include:
This project demonstrates practical knowledge of:
Siddharth Arora
B.Tech Computer Science Indian Institute of Information Technology, Guwahati
If you found this project interesting, consider giving it a ⭐.
Selected from shared topics, language and repository description—not editorial ratings.
DusanTodorovic5 /
Stock exchange simulator made in Swing using Java with logic backend in C++ giving it faster load time and better data control
27/100 healthakshat20000 /
A high-performance, real-time stock trading simulator built with a multithreaded C++ backend, Redis pub/sub relay, and a modern React + Next.js frontend. Designed to emulate real-world stock exchange mechanics — order matching, trade execution, and live market updates.
42/100 health