Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

0x00 Project Roadmap

Vision: Build a production-grade cryptocurrency exchange from Hello World to Microsecond Latency. Current Status: Phase V (Extreme Optimization) - Order Commands parity complete.


πŸ“Š Progress Overview

This project documents the complete journey of building a 1.3M orders/sec matching engine. Below is the current status of each phase.


βœ… Phase I: Core Matching Engine

Status: Complete

ChapterTitleDescription
0x01GenesisBasic OrderBook with Vec<Order>
0x02Float CurseWhy floats fail β†’ u64 refactoring
0x03Decimal WorldPrecision configuration system
0x04BTree OrderBookBTreeMap-based order book
0x05User BalanceAccount & balance management
0x06Enforced BalanceType-safe fund locking
0x07Testing Framework1M order batch testing
0x08Trading PipelineLMAX-style Ring Buffer architecture
0x09Gateway & PersistenceHTTP API, TDengine, WebSocket, K-Line

βœ… Phase II: Productization

Status: Complete

ChapterTitleDescription
0x0AAccount SystemPostgreSQL user management
0x0A-bID SpecificationIdentity addressing rules
0x0A-cAPI AuthenticationEd25519 cryptographic auth
0x0BFunding & TransferInternal transfer architecture
0x0CTrade FeeMaker/Taker fees + VIP discount

πŸ”Ά Phase III: Resilience & Funding

Status: Complete

ChapterTitleDescriptionStatus
0x0DSnapshot & RecoveryState snapshot, crash recoveryβœ… Done
0x0EOpenAPI IntegrationSwagger UI, SDK generationβœ… Done
0x0FAdmin DashboardOps Panel, KYC, hot-reloadβœ… Done
0x11Deposit & WithdrawMock Chain integration, Idempotencyβœ… Done
0x11-aReal Chain IntegrationSentinel Service (Pull Model)βœ… MVP Done
0x11-bSentinel HardeningSegWit Fix (DEF-002) & ETH/ERC20 & ADR-005/006βœ… Done

πŸ”Ά Phase IV: Trading Integration & Verification

Status: Pending Verification

Context: The Core Engine and Trading APIs are implemented but currently tested with Mocks. This phase bridges the gap between the Real Chain (0x11) and the Matching Engine (0x01).

ChapterTitleDescriptionStatus
0x12Real Trading VerificationEnd-to-End: Bitcoind -> Sentinel -> Order -> TradeοΏ½ Code Ready (Needs Real-Chain Test)
0x13Market Data ExperienceWebSocket Verification (Ticker, Trade, Depth)οΏ½ Code Ready (Needs E2E Test)

⏳ Phase V: Extreme Optimization (Metal Mode)

Status: In Progress

Codename: β€œMetal Mode” Goal: Push Rust to the physical limits of the hardware.

ChapterTitleDescription
0x14Extreme OptimizationArchitecture Manifesto
0x14-aBenchmark Harnessβœ… 100% Bit-exact Parity (FILL)
0x14-bOrder Commandsβœ… IOC, Move, Reduce (Feature Parity)
0x15Zero-CopyPlanned
0x16CPU AffinityPlanned
0x17SIMD MatchingPlanned

πŸ† Key Milestones

Git TagPhaseHighlights
v0.09-f-integration-test0x091.3M orders/sec baseline achieved
v0.10-a-account-system0x0APostgreSQL account integration
v0.10-b-api-auth0x0AEd25519 authentication
v0.0C-trade-fee0x0CMaker/Taker fee system
v0.0D-persistence0x0DUniversal WAL & Snapshot persistence
v0.0F-admin-dashboard0x0FAdmin Operations Dashboard
v0.11-a-funding-qa0x11-aReal Chain Sentinel MVP (Deposit/Withdraw)
v0.11-b-sentinel-hardening0x11-bDEF-002 Fix, ADR-005/006, Hot Listing
v0.14-b-order-commands0x14-bβœ… IOC, Move, Reduce (Bit-exact Parity)

🎯 What You’ll Learn

  1. Financial Precision - Why f64 fails and how to use fixed-point u64
  2. High-Performance Data Structures - BTreeMap for O(log n) order matching
  3. Lock-Free Concurrency - LMAX Disruptor-style Ring Buffer
  4. Event Sourcing - WAL-based deterministic state reconstruction
  5. Real-World Blockchain Integration - Handling Re-orgs, Confirmations, and UTXO management
  6. Production Security - Watch-only wallets & Ed25519 authentication

Last Updated: 2025-12-31