Order matching system with visualizer written in C++.
This order book maintains its state using two separate red-black binary trees, implemented as tree maps. Each tree corresponds to either the buy or sell limits of the book and is comprised of list objects containing orders. Each limit is mapped with its corresponding limit price as a key and all orders are also mapped by a unique orderID key.
Using this data structure the orderbook is able to accomplish order addition, cancellation and execution all with an average time complexity of O(1).
- Accepts order input through piping and txt files input to allow backtesting of marketmaking trading strategies.
- Supports Market, GTC, FOK, and GFD order types.
- Allows for order submission, modification, and cancellation.
To compile and start the orderbook, run the following commands:
- Clone repo: git clone https://github.com/4b41/mini-lob.git
- Select directory: cd mini-lob
- Compile program: g++ -std=c++20 -Iinclude src/orderbook.cpp src/feed.cpp src/main.cpp -o Main
- Create named pipes (optional): mkfifo OUT_pipe mkfifo INP_pipe
- Run the program: ./Main
- Create makefile


