Skip to content

TanmayRanaware/Latency-Aware-Smart-Order-Router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latency-Aware Smart Order Router

A production-grade C++17 smart order router with latency modeling, simulated venues, and performance analytics

  • Clean architecture: Separation of concerns (core, venue, router, analytics, utils)
  • Simulated exchanges: Configurable latency, fill probability, partial fills, execution reports
  • Latency model: Effective latency = network + processing; interface ready for EWMA/adaptive models
  • Routing strategy: Score = price_advantage − latency_penalty + fill_weight; multiple modes (BestPrice, LowestLatency, HybridScore)
  • Performance analytics: Execution latency, fill ratio, slippage, venue efficiency ranking
  • Precise timing: std::chrono microsecond-level measurement; RAII, smart pointers, no globals

Build

mkdir build && cd build
cmake ..
cmake --build .

Run

./smart_order_router

Runs 1000 simulated orders with randomized market data and prints a final performance report comparing venues.

Run Tests

cd build && ctest

Project Structure

include/
  core/       Order, ExecutionReport, MarketData, Types
  venue/      Venue, SimulatedExchange, VenueManager
  router/     SmartOrderRouter, LatencyModel, RoutingStrategy
  analytics/  PerformanceAnalyzer, Metrics
  utils/      Logger, Clock
src/          Implementation files
tests/        test_router, test_latency
config/       router_config.yaml
data/         sample_market_data.csv

Performance Metrics (Example Output)

After a typical run you'll see venue-level stats similar to:

Venue A (VENUE_A):
  Avg Latency: 320 µs
  Fill Rate: 92%
  Avg Slippage: 0.3 bps

Venue B (VENUE_B):
  Avg Latency: 180 µs
  Fill Rate: 75%
  Avg Slippage: 0.6 bps

Venue C (VENUE_C):
  Avg Latency: 450 µs
  Fill Rate: 88%
  Avg Slippage: 0.4 bps

Hybrid Router: Improved fill quality and reduced effective slippage across venues.

Design Notes

  • Move semantics and constexpr where appropriate
  • No heap allocations in hot path for critical routing logic
  • Thread-safe design where order submission and analytics are concerned
  • End-to-end latency measured from order acceptance to execution report

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •