Skip to content

High-performance, concurrent, and lock-free matching engine written in Rust. Designed for ultra-low latency trading systems and scalable exchange infrastructures.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

crypto-zero/apex-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ ApexEngine - High-Performance Matching Engine

ApexEngine is a next-generation, high-performance, lock-free matching engine, designed for ultra-low latency trading systems and scalable exchange infrastructures.
Reach the Apex of Matching Performance.

Requires Rust 1.86 stable.

Build Status License: MIT/Apache-2.0 Rust Version


✨ Features

  • Lock-free Order Book
  • Limit and Market Orders
  • Thread-safe Multi-Core Scalability
  • Priority-based Matching
  • Slippage Tolerance
  • Comprehensive Matching Strategies
  • High Performance Benchmarks
  • Memory Efficient

📖 Design Overview

  • Skiplist-based concurrent order book
  • Safe atomic state transitions for lifecycle
  • Market orders with optional slippage tolerance

🚀 Benchmarking

Benchmark ApexEngine's matching performance with the following scenarios:

cargo bench
Scenario Description
match_orders 10k Insert and match 10,000 limit orders
multi-thread insert/cancel/match TPS Concurrent insert/cancel/match

🛠 Usage Example

use matching_engine::prelude::*;
use matching_engine::DefaultMatchingEngine;
use std::sync::Arc;
use std::sync::atomic::AtomicU128;

let syncer = Arc::new(EmptyOrderBookSyncer {});
let id = Arc::new(AtomicU128::new(1));
let book = Arc::new(DefaultOrderBook::new(id, syncer));
let engine = DefaultMatchingEngine::new(book);

let mut order = make_limit_order(1, Side::Buy, 1000, 10, 1000000);
engine.create_order( & mut order).unwrap();

engine.match_orders();

📦 Dependencies


📈 Roadmap

  • Iceberg Orders
  • Advanced Order Types
  • Multi-Symbol Support
  • Persistent Storage

🛎️ Why ApexEngine?

Because every microsecond matters.
ApexEngine is engineered for ultra-high performance, deterministic matching, and scalable concurrency — without sacrificing safety.


🤝 Contributing

Contributions, issues and pull requests are welcome!


📜 License

This project is dual-licensed under:

at your option.

You may choose either license when using this software.

About

High-performance, concurrent, and lock-free matching engine written in Rust. Designed for ultra-low latency trading systems and scalable exchange infrastructures.

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages