Skip to content

triemerge/order-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

order-matching-engine

A simple order matching engine in C++20. Uses a lock-free queue to pass orders to a worker thread that runs the order book.

build & run

Needs a C++20 compiler.

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

./build/tests       # run tests
./build/demo        # run demo
./build/benchmark   # run benchmarks

layout

  • include/engine/ has all the engine headers (types, order book, SPSC queue, matching engine)
  • src/main.cpp is a demo that posts some orders and prints trades
  • tests/tests.cpp has basic correctness tests
  • bench/benchmark.cpp measures add_order latency and pipeline throughput

About

Low-latency order matching engine in C++20

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors