-
Notifications
You must be signed in to change notification settings - Fork 12
Exchange Core Integration
tien.nguyen edited this page Jul 30, 2026
·
2 revisions
The execution-service integrates with exchange-core, an ultra-low latency, in-memory matching engine powered by the LMAX Disruptor ring-buffer pattern.
exchange-core is an external dependency hosted at https://github.com/nvxtien/exchange-core.
To build Emporia locally, developers must clone and install exchange-core into their local Maven repository (~/.m2/repository):
git clone https://github.com/nvxtien/exchange-core.git
cd exchange-core
mvn clean installexchange-core provides sub-microsecond order book matching, deterministic sequence execution, lock-free ring buffers, and binary serialization.
flowchart LR
subgraph EmporiaSystem ["Emporia Microservice Ecosystem"]
OMS["Order Management Service"]
KafkaOrderLog[["Kafka: emporia.orders.v1"]]
ExecService["Execution Service (:8087)"]
KafkaExecCmds[["Kafka: emporia.execution.commands.v1"]]
end
subgraph ExchangeCoreEngine ["Exchange-Core Engine"]
Adapter["ExchangeCoreAdapter"]
RingBuffer["LMAX Disruptor RingBuffer"]
MatchingEngine["In-Memory OrderBook Core"]
RiskEngine["Pre-Trade Risk Engine"]
end
OMS --> KafkaOrderLog
KafkaOrderLog --> ExecService
ExecService --> Adapter
Adapter --> RingBuffer
RingBuffer --> RiskEngine
RiskEngine --> MatchingEngine
MatchingEngine -->|Execution Result| Adapter
Adapter --> KafkaExecCmds
KafkaExecCmds --> OMS
- Located in
execution-service. - Translates Emporia domain
TradingOrdercommands (CREATE,CANCEL,MODIFY) into zero-allocationCommandOrderprimitives accepted by the Disruptor ring buffer. - Map venue execution fills back to
emporia.execution.commands.v1Kafka events.
-
exchange-coreisolates order matching to single-threaded ring buffer handlers to eliminate lock contention, atomic CAS overhead, and garbage collection pauses during high market activity.
-
exchange-corepublishes durable snapshots and risk seed metrics toportfolio-service(:8088), ensuring position balances remain synchronized across system restarts.
- Order Ingestion Rate: Up to 5,000,000 operations/second per core.
-
Matching Latency: 99.9th percentile
$< 5$ microseconds. - Failover Recovery: Journal-backed state replay upon service startup.
- Trading Terminology Glossary
- Order Lifecycle & Validation
- Order Routing & SOR
- Market Data & Pricing
- Portfolio & Risk Management
- Architecture & Order Flow
- Static Data Service
- Market Data Service
- Order Command Service
- Order Management Service (OMS)
- Execution Service
- Portfolio Service
- Design Patterns
- Microservices Overview
- Exchange-Core Integration
- Testing & Verification
- Deployment & Operations
- Repository: emporia
- Tech Stack: Java 21 | Spring Boot 4.0.7 | React 19 | Kafka | gRPC
- Coverage: 91.95% JaCoCo