How bozoslav/order-book works
This is a C++ price-time-priority matching engine for exchange simulations. A caller submits orders to the order book; the engine checks FOK fillability when requested, matches eligible opposing orders, records trades, and rests any remaining GTC quantity. It also supports cancellation, modification, and book printing. The map separates matching and lifecycle stages from the price-level and order-storage structures. Evidence is limited to the README and sampled headers/source; no external exchange integration or runtime service is shown.
Main entry points: OrderBook.cpp Order Processing · OrderPool.h Order Pool · PriceArray.h Price Levels · OrderBook.h Order Book API
Components 14
Matching Engine
- Order Book API
include/OrderBook.h - Order Processing
src/OrderBook.cpp - FOK Check
src/OrderBook.cpp - Price-Time Matching
src/OrderBook.cpp - GTC Resting
src/OrderBook.cpp - Cancel / Modify
src/OrderBook.cpp - Book Display
src/OrderBook.cpp
Book Storage
- Price Levels
include/PriceArray.h - FIFO Queues
include/OrderQueue.h - Order Pool
include/OrderPool.h
Order Data
- Order Record
include/Order.h - Price Value
include/Price.h - Trade Record
include/Trade.h
Other components
- Trading Caller
Connections 16
- Trading Caller → Order Book API: submits orders
README.md - Order Book API → Order Processing: declares operations
include/OrderBook.h - Order Processing → FOK Check: checks FOK
src/OrderBook.cpp - Order Processing → Price-Time Matching: matches orders
src/OrderBook.cpp - Order Processing → GTC Resting: rests GTC remainder
src/OrderBook.cpp - Order Processing → Cancel / Modify: cancels or modifies
src/OrderBook.cpp - Order Processing → Book Display: prints book
src/OrderBook.cpp - Order Processing → Price Levels: reads and updates
src/OrderBook.cpp - Order Processing → Order Pool: allocates and releases
src/OrderBook.cpp - Order Processing → Trade Record: emits trades
src/OrderBook.cpp - Price Levels → FIFO Queues: maintains levels
include/PriceArray.h - Price Levels → Order Pool: reads order nodes
include/PriceArray.h - FIFO Queues → Order Pool: links pooled nodes
include/OrderQueue.h - Order Pool → Order Record: stores orders
include/OrderPool.h - Order Record → Price Value: contains price
include/Order.h - Trade Record → Price Value: contains price
include/Trade.h