A high-performance, low-latency order matching engine written in Java.
- Java 25 or later
- Maven 3.6+
- Order Management: Add, match, and cancel orders for multiple financial instruments
- Real-time Matching: Efficient price-time priority matching algorithm
- Event Publishing: Publishes trade and order events to downstream consumers
The matching engine is built using modern Java technologies optimised for low latency:
- Agrona: High-performance data structures and utilities
- Simple Binary Encoding (SBE): Efficient binary encoding for request messages
- LMAX Disruptor: High-throughput inter-thread messaging library for event processing. Each instance is written to by a single thread, which mitigates the need for more expensive CAS operations by the internal sequencer
MatchingEngine: Main engine managing multiple order booksOrderBook: Individual order book implementation with price levelsOrderPool: Memory pool for order objects to eliminate allocations on the hot path. This is critical for avoiding garbage collection pauses- Event publishers for trade and order updates