Skip to content
AS
All projectsPersonal project

Tickwire

A Nasdaq market data feed handler in C++

A C++20 feed handler that reads Nasdaq ITCH over UDP, recovers dropped packets and rebuilds the order book.

Role
Solo project
Category
Systems Programming
Status
Complete
Stack
C++20, UDP, Boost.Beast, WebAssembly, Next.js, TypeScript
Tickwire preview

(01) What it is

The project

Exchanges send market data over UDP, which means packets can get lost. Tickwire decodes Nasdaq TotalView ITCH 5.0 over MoldUDP64 on real UDP sockets, notices when packets go missing, asks for them again, and rebuilds the order book without corrupting it.

To test that properly I wrote a fault proxy that drops, duplicates and reorders packets on purpose, with a seed so every failure can be replayed exactly. The trickiest case was losing the last few packets of a session, because the only clue is a sequence number in a later heartbeat.

(02) Details

How it works

  1. 01Decodes all 23 ITCH 5.0 message types with strict length checks
  2. 02After recovering from packet loss, the book and trade hashes match a run with no loss at all
  3. 03If a gap can't be recovered, it reports a failure instead of pretending everything is fine
  4. 04Replays are byte exact, and seeking to a checkpoint gives the same result as replaying from the start
  5. 05Decodes about 119 million messages per second on one core
  6. 06The same engine compiles to WebAssembly and produces identical hashes in the browser

(03) Screenshots

The rebuilt order book
The rebuilt order book
Stepping through messages in the replay studio
Stepping through messages in the replay studio
Next projectPaddockk