XBase Matching Engine
High-performance, deterministic order matching
A low-latency matching engine with price-time priority, partial fills, cancel/replace and self-trade prevention.
- 100.3088
- 100.2590
- 100.2056
- 100.1550
- 100.1066
- 100.0540
- 99.9527
- 99.9038
- 99.8522
- 99.8029
- 99.75100
- 99.7060
- —
Product Overview
Order Matching Engine
What it is
XBase Matching Engine is the component at the heart of a trading platform: it matches incoming orders against the order book under deterministic rules, publishes results as events and distributes market data in real time.
The problem it solves
Two things are non-negotiable in a matching engine: correctness and predictable latency. The same input must always produce the same output, state must be recoverable without loss after a crash, and latency must not spike under load. The engine is designed around those three requirements.
Who it is for
For organisations operating their own exchange, brokerage platform or internal marketplace; usable together with XBase Exchange or on its own.
Core Features
Core Features
Limit and Market Orders
Core order types with time-in-force options (GTC, IOC, FOK).
Price-Time Priority
Orders at the same price match in arrival order; the rule is deterministic and auditable.
Order Book
In-memory, level-based order book; depth snapshots and incremental updates.
Partial Fill
Orders can fill partially against several counter-orders; the remainder stays on the book.
Cancel / Replace
Cancel and replace consistent with priority rules; quantity reductions keep priority.
Self-Trade Prevention
Matching between opposite orders from the same account is blocked by policy.
Real-Time Execution
Matches are published immediately as events; the settlement layer consumes them.
WebSocket Market Data
Subscription-based streams for the order book, trades and own-order status.
Modules
- Limit Order
- Market Order
- Price-Time Priority
- Order Book
- Partial Fill
- Cancel / Replace
- Self Trade Prevention
- Real-Time Execution
- WebSocket Market Data
- Low Latency Architecture
How It Works
How It Works
- 01
Order acceptance
The gateway validates the order and writes it to the market's sequenced input queue.
- 02
Sequential processing
A single processor per market consumes orders in sequence; there is no concurrency to reason about.
- 03
Matching
The order is matched under price-time priority starting from the best opposing price.
- 04
Event publication
Fills, partial fills, cancels and book changes are written to the event log and pushed to subscribers.
- 05
Recovery
On restart, the order book is rebuilt exactly from the event log and the last snapshot.
Architecture
Architecture
The engine follows a single-writer-per-market principle. All state lives in memory; durability comes solely from an append-only event log. That gives predictable latency without locks and deterministic replay.
- 01Input sequencerAssigns a unique sequence number to each order; input order is preserved exactly during recovery.
- 02Matching coreIn-memory order book and matching logic; one thread per market.
- 03Event logAppend-only durable log; together with snapshots, the source of recovery.
- 04Market data publisherDistributes book and trade streams over WebSocket.
- 05Settlement bridgeForwards fill events to the balance and account service.
- 01
Input sequencer
Assigns a unique sequence number to each order; input order is preserved exactly during recovery.
- 02
Matching core
In-memory order book and matching logic; one thread per market.
- 03
Event log
Append-only durable log; together with snapshots, the source of recovery.
- 04
Market data publisher
Distributes book and trade streams over WebSocket.
- 05
Settlement bridge
Forwards fill events to the balance and account service.
Technologies
- TypeScript
- Go
- PostgreSQL
- Redis
- Kafka
- Kubernetes
Integration
Integration
REST API
Versioned, documented endpoints.
WebSocket
Real-time data streams.
SDK
Server and client libraries.
Security
Security
Access control
Orders arrive only through the authenticated gateway; the engine is never exposed directly.
Audit logging
The event log doubles as a complete audit trail; every order movement is traceable.
Monitoring
Metrics for latency distribution, queue depth and match rate.
Resilience
Zero-loss recovery from snapshot + log; replication options.
Use Cases
Use Cases
Crypto asset exchange
The primary matching layer for spot markets.
Broker internalisation
Matching client orders in-house and routing the residual flow to external venues.
Tokenised asset and private marketplaces
Any secondary market that requires orderly market microstructure.
Deployment
Deployment
- Cloud
- Private Cloud
- On-Premise
- Hybrid
Let's talk about Order Matching Engine
For a demo, technical depth or pricing, talk directly to our engineering team.