Real-Time Order Book & Latency Optimization by Barinder SinghReal-Time Order Book & Latency Optimization by Barinder Singh

Real-Time Order Book & Latency Optimization

Barinder Singh

Barinder Singh

Real Time L2 Order Book & Latency Dashboard

Live market depth dashboard powered by a custom C++20 market data gateway, measuring latency down to the microsecond.

The Problem

Market data is only useful if it's fast and trustworthy. I wanted to see the full order book live and know exactly where every microsecond of delay comes from.

What I Built

C++20 Gateway streaming live futures market data.
Lock free ring buffer, zero copy writes and CPU cycle timestamps on every stage.
Live L2 order book with depth chart and trade tape.
Latency Panel tracking current, P50, P99.9 and max, with a rolling 1 hour view.
Live and Replay modes, with replays clearly labeled with their original capture time.

Results

Publish stage: 422ns median, 18.43 µs P99.9, 40.92 µs worst case.
Full Pipeline P99 under 18 µs across parse, queue, book update and publish.
Traced cloud latency spikes to thread scheduling contention, cutting P99/P99.9 by 9-10x.

Live Demo

Like this project

Posted Oct 21, 2026

Developed a C++20 market data gateway for a real-time order book dashboard.