C++ Trading Ecosystem

Note that the videos provided are very old and only show maybe 10%~ of the actual backend implementation. I have yet to touch-up on the user interface so most of the things are displayed in the console or .log files currently.

I am still working on finishing the user interface using Qt Creator on Linux

General Info

A multithreaded trading ecosystem that hosts an exchange that can support multiple clients. The system ensures that orders are fairly executed on a first-come-first-serve basis. The exchange also has basic market maker and liquidity taker algorithms running that run different trading strategies. 

The system also ensures that should any market data updates packet not make it to any client, they can rebuild the orderbook from an orderbook snapshot and previous incremental updates.

 

Learning outcomes

  • Minimizing latency utilizing data duplicates or queues to transfer data between threads
  • Profiling latencies, execution times with RDTSC, focusing on mean, range and spikes
  • Dealing with WinSock, handling loss recovery when using UDP via incremental and snapshot data streams
  • Compiler hinting and attributes to maximize performance
  • Learning good design and optimization techniques
  • Packing data structures
  • Qt usage

Components

  • Matching engine, trading engine
  • Order gateway server
  • Market data publisher & consumer
  • Feature engine, position, order & risk manager
  • market making & liquidity taker algorithm
  • market order book using best bid and ask