Skip to content

Harshit-077/OrderBook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

High-Performance Limit Order Book (LOB)

A real-time BTC-USD Order Book matching engine built in C++17. This project simulates a low-latency trading environment by processing market data updates and executing market orders with price-time priority.

πŸš€ Features

  • Price-Time Priority: Maintains a sorted L2 book using std::map with $O(\log N)$ discovery.
  • Matching Engine: Supports aggressive market orders that cross the spread and match against existing liquidity.
  • Multithreaded Design: Asynchronous market data feed simulation using std::thread and std::mutex.
  • Analytics: Real-time trade logging to CSV and a Python-based visualizer for post-trade analysis.

πŸ›  Tech Stack

  • C++17: Core engine logic.
  • CMake: Build system.
  • nlohmann/json: JSON parsing for simulated market data.
  • Python (Pandas/Matplotlib): Data visualization.

πŸ“¦ How to Build & Run

  1. Prerequisites: Install nlohmann-json and cmake.
  2. Build:
    mkdir build && cd build
    cmake ..
    make
    
  3. Run:
    ./bin/lob_simulator --config=../data/configs/default-config.json

πŸ“œ License

This project is licensed under the terms of the MIT license.

About

An implementation of a high-performance order book engine that simulates how financial exchanges manage and match buy and sell orders in real time. The system is designed to handle limit and market orders, maintaining price-time priority for efficient trade execution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors