Built Velocity — a USDC-margined perpetual futures exchange simulator.
It supports instant market execution, 20x leverage, and real-time liquidations against live market data.
System Architecture:
• Event Sourcing: Redis Streams acting as the deterministic sequencer for all trade events.
• Execution: Single-threaded, in-memory engine ensuring sub-ms market order fills.
• Persistence: Asynchronous write-behind to Postgres for a non-blocking ledger.
• Precision: Custom BigInt math (10^8) preventing floating-point drift.
Clean implementation of the LMAX architecture pattern.