FakeX is a high-performance trading system that demonstrates the use of the LMAX Disruptor pattern for processing financial transactions.
- High-performance order matching engine
- Account management with balance tracking
- Support for buy and sell limit orders
- Benchmarking tools for performance testing
- Java Development Kit (JDK) 23 or higher
- Gradle (or use the included Gradle wrapper)
./gradlew build./gradlew runThe project includes JMH benchmarks to measure the performance of various components of the trading system.
./gradlew jmhTo run a specific benchmark, use the --includes parameter:
./gradlew jmh --includes=BasicOrderMatchingBenchmarksrc/main/java: Main source codecom.fakex.core: Core trading engine componentscom.fakex.domain: Domain models (Order, Trade, Account)com.fakex.command: Command pattern implementationcom.fakex.wal: Write-Ahead Log implementation
src/jmh/java: Benchmark codecom.fakex.benchmark.end2end: End-to-end benchmarkscom.fakex.benchmark.gc: Garbage collection benchmarks
The FakeX trading system uses the following libraries:
- LMAX Disruptor (4.0.0): High-performance inter-thread messaging library
- Agrona (2.1.0): High-performance data structures and utility methods
- Chronicle Queue (5.27ea5): Ultra-low latency, persisted queue implementation for Write-Ahead Logging
- Chronicle Wire (2.27ea5): Serialization library for Chronicle Queue
- Chronicle Bytes (2.27ea2): Memory management library for Chronicle Queue
- Chronicle Core (2.27ea3): Core utilities for Chronicle libraries