The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...

Eleven books. One complete trading stack in modern C++.
From kernel bypass to the matching engine, from nanosecond timestamps to deterministic backtests, build every layer of a production trading system the way it actually runs: measured, replayed, and proven.
Nothing is true until it has been profiled, fuzzed, and replayed.
Bought separately
$569.94
Minimum price
$199
$299
About the Bundle
Most C++ books stop where production starts. They show you a lock-free queue that works on a laptop, an order book that handles a hundred orders, and a benchmark that measures an empty loop. Then you put it in front of real market data and it falls apart.
This library starts where those books stop.
Eleven books take you through every layer of a production trading system, in the order you would actually build one. No toy examples, no hand-waving, and no technique without the measurement that proves it works.
WHAT YOU WILL BUILD
WHY THIS LIBRARY IS DIFFERENT
Every book follows one rule: nothing is true until it has been profiled, fuzzed, and replayed.
Every technique comes with three things: the measurement that proves it, the trade-off it costs, and the failure it prevents.
Every chapter closes with a running ledger, a concrete record of latency, throughput, and correctness at that stage of the build. By the final chapter, you have a complete performance history of the system you built, not a pile of disconnected snippets.
Every example is modern C++20/23 code that compiles, handles the failures real systems hit, and states the memory ordering, data layout, and compiler flags it depends on.
WHO THIS IS FOR
C++ engineers moving into trading, market making, or exchange technology. Quant developers who want infrastructure skills that hold up in production. Systems engineers who want the most demanding low-latency workloads in the industry as their training ground. Anyone who has shipped “fast” C++ and then watched it miss its latency target under real load.
You should be comfortable with modern C++ and Linux. Trading knowledge is not required; every market concept is introduced where the system first needs it.
WHAT YOU GET
All 11 books in PDF and EPUB, DRM-free. Every future update to every book, at no extra cost. A complete reading path, from architecture to capstone. The full library at a fraction of the individual price.
Start with the map. Build the foundations. Construct every engine. Finish with a system you understand down to the nanosecond.
About the Books
Most of a strategy’s edge is won or lost after the decision to trade. A VWAP algorithm chases a volume spike at the close and pays the spread on its last third. A router loses queue priority on every passive child because its replace logic treats a size reduction as a new order. Identically sized slices arriving every thirty seconds teach the market your rhythm long before the order finishes. None of these show up as errors. They show up weeks later in the markouts.
This book is a production engineer’s guide to the layer between a trading decision and a filled order. It shows you how to build a complete execution engine in modern C++20/23, one that controls cost, latency and information leakage, and can explain every decision it makes.
You will learn how to:
Every chapter pairs its concepts with compilable code that handles the failures live systems actually hit: rejects, unsolicited cancels, fills that arrive after a cancel, venue disconnects mid-sweep, halts and stale data. Every chapter also closes with a Slippage and Latency Ledger, which tracks decision-to-wire latency and execution cost side by side as the engine is built.
Four appendices serve as working references:
This book is written for C++ engineers and quants building or running execution infrastructure. It assumes working knowledge of modern C++ and concurrency, and introduces the financial models where the engine first needs them.
Two servers price the same portfolio from the same market snapshot with the same binary, and their deltas disagree in the eleventh digit. Nobody changed the model. A reduction order moved with the thread scheduler, or a compiler fused one multiply-add on one build and not the other. Risk reconciliation stops, and someone spends three days proving the numbers were “basically the same”.
This book shows you how to build pricing engines that cannot have that problem.
Deterministic Pricing Engines in C++ builds one production-grade engine from the floor up: closed-form kernels, trees, finite difference solvers, Monte Carlo, stochastic and local volatility, calibration, and adjoint Greeks. Every layer holds to one standard: the same inputs, method and build give the same bits, on any host and at any degree of parallelism. Then the book shows why that standard is what makes aggressive optimization safe. Caching, vectorization, scenario batching and incremental repricing all become changes you can prove harmless before they merge.
You will learn to:
What makes this book different:
std::expected, designated initializers, C++20 atomics) and is written to compile, not as pseudocode.Who it’s for: quant developers, trading-systems engineers and engineering leads who own pricing infrastructure in production. It assumes you know what a Greek is and are comfortable with modern C++. It does not teach either from scratch.
In the world of High-Frequency Trading, nanoseconds separate the profitable from the obsolete. Which side of the trade are you on?
Standard C++ practices and traditional operating system architectures are not fast enough for modern financial markets. Every cache miss, context switch, and kernel interrupt adds latency that degrades trading performance. To compete at the highest level, you must strip away the abstractions and engineer your system to work in perfect harmony with the bare metal.
Architecting HFT Systems in Modern C++ is a definitive, hands-on guide to building ultra-low-latency trading infrastructure. This book bridges the gap between theoretical computer science and the brutal realities of production trading systems. You will learn how to bypass the kernel entirely, design lock-free memory structures, and write code that executes consistently in under a microsecond.
Whether you are a quantitative developer, a systems architect, or a senior C++ engineer looking to enter the algorithmic trading industry, this book provides the exact blueprints used by top-tier proprietary trading firms.
What You Will Learn Inside:
You cannot afford to rely on generic software design patterns when money is on the line. Stop losing trades to system overhead.
Get your copy today and learn how to engineer systems that execute faster than the competition.
Learn to eliminate cache miss bottlenecks and memory stall penalties with confidence using measured, verified data layout engineering, guided by a systems programmer’s playbook for struct design, access pattern optimization, and concurrent data structure architecture across CPU-bound production systems.
Key Features
Book Description
Most engineers reach for algorithmic optimizations when their code is slow, unaware that the same pointer-connected heap layout or the same AoS struct that looked fine in testing will stall the CPU on memory the day the working set actually grows. This book closes that gap, providing the practical knowledge of cache line mechanics, data layout transformation, and concurrent system design needed to build software with measured throughput guarantees, not assumed ones.
You will begin at the silicon level, understanding what cache lines physically are, how the memory hierarchy imposes latency on every access that misses it, and why the pointer-connected layouts that object-oriented design naturally produces are structurally hostile to the hardware. You will measure the problem before touching a single struct, using hardware performance counters to quantify cache miss rates, memory stall fractions, and instructions per cycle across your real hot paths.
The book walks through the full arc of production data-oriented engineering: struct field ordering and padding elimination, hot and cold data separation, Array of Structures to Structure of Arrays conversion that unlocks compiler auto-vectorization, AoSoA hybrid layouts, Entity Component Systems with dense archetypal storage and generational handles, flat array replacements for pointer-based trees and lists, slot maps that provide O(1) stable-handle lookup without pointer indirection, software prefetching, cache tiling, false sharing elimination, per-thread work partitioning, and lock-free ring buffer design where memory layout determines coherence traffic as much as the algorithm does. Three applied chapters walk a scene graph, a high-frequency trading order book, and a particle system through complete transformations with hardware counter measurements at every step.
Whether you are optimizing your first cache-bound simulation loop or hardening a production system that must sustain low latency under real concurrent load, this book provides actionable layout techniques and measurement discipline for performance that holds under live workloads.
What You Will Learn
Who This Book Is For
This book is for C++ systems engineers, performance engineers, and senior developers building or optimizing throughput-critical software across game engines, simulation systems, financial infrastructure, and any domain where the gap between theoretical hardware throughput and measured application performance demands a hardware-level explanation. No prior knowledge of data-oriented design or CPU microarchitecture is assumed.
Table of Contents
Stop treating a matching engine's correctness as something a demo can prove. Learn to build lock-free order books, cache-line aligned price-time priority, and zero-jitter trade execution, guided by a verification discipline that takes the system from a passing test suite to a build you can prove holds under real concurrency, real load, and a real crash.
Key Features
perf c2c measurements, zero-allocation memory pools, and full OS-level jitter eliminationBook Description
A matching engine that never crashes in testing is not a matching engine that behaves correctly under real order flow, and the gap between those two claims is not a corner case, it is where production trading systems actually fail. This book treats that gap as the engineering problem it actually is, starting with the honest question of what "deterministic" precisely guarantees and what it does not, before a single line of optimization code gets written.
From there it covers the full stack in order: order book data structures benchmarked under real volume, order types and matching semantics including icebergs, stop-cascades, and amendment priority rules, and price-time priority as a fairness guarantee that individually correct features can still violate the moment they interact, illustrated by a full regulatory-inquiry case study. The engineering chapters that follow eliminate non-determinism at its source, lock-free compare-and-swap design, the ABA problem and hazard pointers, cache-line alignment measured rather than assumed, zero-allocation hot paths backed by pooled memory, and the nine sources of OS and scheduler jitter most engineers building their first low-latency system never think to check.
The final part closes the loop: measuring tail latency honestly with HDR histograms and realistic burst-load generation instead of misleading averages, proving correctness with libFuzzer-driven edge-case discovery and property-based testing, confirming determinism with byte-identical replay across ten thousand adversarially-scheduled runs, and validating crash recovery with fault injection and measured recovery-time objectives, so that every guarantee this book opens with still holds on the other side of a real production incident.
What You Will Learn
perf c2c instead of assumed struct paddingSCHED_FIFO, NUMA placement, and interrupt isolationWho This Book Is For
This book is for C++ systems engineers, quantitative developers, and trading infrastructure teams building matching engines, order management systems, or any latency-sensitive concurrent system where correctness under load is non-negotiable. Familiarity with modern C++, concurrency fundamentals, and Linux systems programming is assumed; prior exposure to lock-free data structures is helpful but not required.
Table of Contents
Your backtest says Sharpe 4. The market says otherwise.
Most strategies don’t fail because the idea was wrong. They fail because the backtest was lying, and nobody built an engine capable of catching it. A fill that could never have happened. A price the strategy saw before it existed. A latency the simulator pretended away. A sweep of four thousand configurations that found exactly what noise finds.
Deterministic Backtesting Engines in C++ shows you how to build the engine that catches all of it. This is not a book of strategies. It is a book about the machinery that decides whether a strategy’s numbers can be believed. You will build a production-grade, event-driven backtester in modern C++ that treats every result as a claim and tries to break it, then shows you exactly how much of that result rests on assumptions.
Key Features
What You Will Learn
Who This Book Is For
Quantitative developers, quant researchers, and trading infrastructure engineers who build or depend on backtesting systems for intraday strategies: market making, short-horizon signals, and execution. You should be comfortable with modern C++ (templates, concepts, the memory model) and know what an order book is. Everything else is built from the ground up in C++23, with complete listings that compile as shown.
What You Get
Part of Weston Ashgrove’s Field Guide to Production Trading Systems, alongside Deterministic Matching Engines, Deterministic Risk Engines, and Deterministic Pricing Engines.
A backtest is a claim. This book gives you the engine to test it.
Your timestamps are lying to your P&L.
Every number your desk trusts rests on a clock. That includes your markouts, your tick-to-trade, your fill attribution, and the replays you backtest against. When those clocks disagree by a few microseconds, the numbers don’t fail loudly. They drift quietly. A fill gets booked against the wrong book state, a strategy’s edge looks like latency, and a backtest built from captured data rewards behaviour that live trading punishes.
Most firms find out the hard way: in a fill dispute, a post-trade investigation that can’t sequence its own events, or a regulator asking for evidence nobody kept.
This book is the fix, written for people who already know why a microsecond matters.
What you get:
Who it’s for: senior quants, trading-systems leads, and low-latency engineers who make decisions on the numbers their timestamps produce.
No theory padding and no vendor pitch, just the mechanisms, the failure modes and the code.
If your edge is measured in microseconds, your clocks are part of your strategy. Get them right.
Learn to eliminate silent feed corruption with confidence using measured, verified engineering, guided by a pragmatic architect's playbook for zero-copy parsing, gap recovery, and deterministic reconstruction.
Key Features
Book Description
Most engineers ship a feed handler once it parses cleanly, unaware the test stream never exercised a real gap. This book closes that gap, providing the practical knowledge of zero-copy parsing, gap recovery, and reconstruction needed to build a handler with measured correctness, not assumed correctness.
You will begin by parsing FIX, ITCH, and OUCH at speed, benchmarking against real message-mix captures, and detecting sequence gaps that distinguish true loss from ordinary reordering. You'll gain a clear framework for engineering out silent corruption at its source, understanding where naive parsing, unbounded buffers, and untested recovery introduce risk, and how each cost compounds, or gets eliminated, under real load.
The book walks through the full arc of a production system: snapshot-plus-incremental recovery that survives a real outage, order book reconstruction with correctly scoped liquidity, measuring wire-to-book latency honestly, and proving determinism with byte-identical replay. It addresses production faults, including feed divergence and silent staleness, and closes with a full reference implementation.
Whether you're building your first feed handler or hardening your fourth, this book provides actionable techniques for securing correctness that holds under real load.
What You Will Learn
Who This Book Is For
This book is for C++ systems engineers, quantitative developers, and senior infrastructure engineers building or hardening a production feed handler. It's useful for engineers moving into latency-sensitive, high-throughput roles where correctness guarantees grow more complex. No prior binary protocol experience is assumed.
Table of Contents
Learn to eliminate scalar throughput ceilings with confidence using measured, verified SIMD engineering, guided by a systems programmer’s playbook for data layout, hardware dispatch, and cross-architecture production deployment.
Key Features
Book Description
Most engineers add SIMD to a codebase after it is slow, writing intrinsics around the hot loop without understanding why the surrounding code cannot be vectorized and without measuring whether the result is actually faster. This book closes that gap, providing the practical knowledge of memory layout, hardware execution models, and portable abstraction needed to build SIMD code with measured throughput, not assumed throughput.
You will begin at the silicon level, understanding what SIMD registers physically are, how parallel ALUs execute multiple lanes simultaneously, and why CPUID dispatch is an architectural decision rather than an afterthought. You will gain a clear framework for eliminating the layout problems that kill vectorization at its source, understanding where AoS data structures, misaligned allocations, and pointer aliasing introduce barriers, and how each compounds or gets eliminated under real load.
The book walks through the full arc of production SIMD engineering: x86 foundations from SSE through AVX2 and into AVX-512’s dedicated mask register file, ARM NEON’s interleaved load and store model, portable abstraction layers that compile to native instructions, and the compiler collaboration techniques that determine whether the auto-vectorizer succeeds or silently falls back to scalar. It addresses the algorithm cookbook problems that most SIMD resources skip entirely, including branchless search, vectorized sorting networks, and structural byte parsing for JSON and CSV at memory bandwidth rates. The book closes with benchmarking discipline, hardware counter profiling, and a complete fat binary deployment architecture with runtime ISA dispatch and cross-architecture regression testing.
Whether you are vectorizing your first numeric kernel or hardening a production SIMD codebase that targets a heterogeneous deployment fleet, this book provides actionable techniques for throughput that holds under real workloads and correctness that holds across every supported architecture.
What You Will Learn
Who This Book Is For
This book is for C++ systems engineers, performance engineers, and senior developers building or optimizing throughput-critical software across numeric computing, signal processing, database engines, financial systems, and any domain where scalar code leaves measurable hardware capacity unused. It is useful for engineers moving into low-latency or high-throughput roles where the gap between theoretical peak and measured throughput demands explanation. No prior SIMD experience is assumed. The book builds the mental model from first principles in Chapter 1 and every intrinsic is explained at the point of first use.
Table of Contents
Learn to build fixed-latency risk infrastructure with confidence using lock-free engineering, guided by a production trading systems architect's playbook for cache-aligned state, incremental computation, and provable correctness under load.
Key Features
Book Description
Most risk engines ship once they pass a quiet-market demo, unaware the same mutex or the same O(n) recomputation that looked fine in testing will stall the matching engine the day volatility actually spikes. This book closes that gap, providing the practical knowledge of cache-aligned state, lock-free publication, and incrementally-maintained risk figures needed to build a risk engine with measured latency guarantees, not assumed ones.
You will begin by deriving an actual latency budget from tick-to-fill time and realized adverse price movement, rather than picking a round number, and building position tracking that updates atomically as fills arrive without contending with the order path. You'll gain a clear framework for pre-trade risk checks, implementing size limits, fat-finger detection, and price collar validation as a fully lock-free gate ahead of the matching engine.
The book walks through the full arc of a production risk system: parametric VaR maintained incrementally rather than recomputed from scratch, live correlation and portfolio-level exposure decomposition, historical stress testing run in parallel without touching the fill path's cache lines, and full production resilience through fail-safe policy design, circuit breakers, and regulatory audit trails. It addresses correctness rigor, including replay testing against historical fills, property-based invariant checking, and reconciliation against independent end-of-day reference data, and closes with a full annotated reference implementation.
Whether you're building your first real-time risk gate or hardening your fourth, this book provides actionable techniques for securing latency guarantees that hold under live order flow.
What You Will Learn
Who This Book Is For
This book is for C++ engineers, quantitative developers, and trading systems architects building or hardening a production risk engine. It's useful for engineers moving into low-latency infrastructure roles where correctness and speed are both non-negotiable. No prior risk management experience is assumed.
Table of Contents
Stop treating your matching engine, risk gate, and FPGA layer as three problems you've already solved. The fourth problem, the one that only shows up once all three run together against live order flow, is what this book is about.
Key FeaturesA matching engine that passes its own test suite, a risk engine that rejects every order it should, and an FPGA gateway that hits its latency target on the bench are not a trading system. They're three sign-offs, and the gap between them and one correct system is where integrated systems fail, silently, the first day all four run together against real order flow.
It treats that gap as the engineering problem it is, opening with a real end-to-end latency budget across market data, matching, risk, and FPGA execution, one shared clock semantics per boundary rather than four privately defined numbers added together. It wires the risk gate into the hot path as a synchronous check, passes exposure state across boundaries without added latency, and integrates the FPGA layer with a software fallback tested continuously, not a codepath nobody has run in months.
The middle chapters build cross-component reliability: fault recovery ordering across subsystems with independent recovery paths, system-wide determinism through a shared sequence and clock reconciliation at the hardware boundary, and graceful degradation that scopes a fault rather than forcing an unnecessary halt.
The final part proves the system works: latency measurement with per-stage attribution finding which subsystem regressed, deterministic replay reproducing a session byte-for-byte, and chaos testing injecting correlated, simultaneous failures single-fault testing cannot find. It closes with production operation: alerting tied to the real system budget, and a deployment strategy treating hardware-software compatibility as a checked contract.
What You Will LearnThis book is for C++ systems engineers, quantitative infrastructure teams, and trading technology leads who have built one component of a trading pipeline and are now responsible for making several work together. Familiarity with modern C++ is assumed.
Table of ContentsWithin 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.