Designing a Matching Engine: Determinism, Replay and Recovery
How single-threaded per-market engines, sequence numbers and append-only logs make an exchange core deterministic, recoverable and testable against recorded order flow.
Long-form, practical writing on how we design and build blockchain, trading, fintech and AI systems. No hype, no market predictions.
10 articles
How single-threaded per-market engines, sequence numbers and append-only logs make an exchange core deterministic, recoverable and testable against recorded order flow.
Trust assumptions, operational trade-offs and approval workflows for hardware security modules, threshold signatures and on-chain multisig, and when to combine them.
A decision framework covering throughput, sovereignty, validator burden, tooling, liquidity and exit strategy for teams deciding where their protocol should run.
Capital efficiency, latency, MEV exposure and oracle dependence compared across on-chain order books, automated market makers and the hybrid designs between them.
Transaction simulation, allowance hygiene, phishing heuristics and social or MPC recovery: the wallet features that stop users losing funds before a signature happens.
Smart accounts, paymasters, session keys and bundlers can remove gas and seed phrases from onboarding, provided the sponsor keeps clear policy limits on what it pays for.
Indexing on-chain events into retrievable documents, constraining model output to a schema, evaluating answers and keeping humans in the loop for anything that moves money.
Idempotent payment state machines, finality rules, sweeping, statements and exception queues: the unglamorous parts of merchant stablecoin settlement that make the books balance.
Immutable events, rebuildable projections, double-entry invariants enforced at write time, replay for audit and the migration pitfalls that catch teams adopting the pattern.
A Foundry-style workflow for smart contract testing: unit tests for behaviour, invariants for properties that must always hold, fuzzing to find what breaks them, and CI gates.
We are happy to review an architecture or a design document. Reach out and tell us what you are working on.