Skip to main content
NanoARB supports high-performance market data ingestion from CME Group exchanges using the MDP 3.0 (Market Data Platform) protocol, as well as synthetic data generation for development and testing.

CME MDP 3.0 Protocol

The nano-feed crate provides a complete implementation of the CME MDP 3.0 binary protocol with zero-copy parsing for ultra-low latency.

Message Types

MDP 3.0 messages are parsed into strongly-typed Rust structures:
Source: nano-feed/src/messages.rs:354-373

Book Update Messages

Book updates contain incremental changes to the order book:
Source: nano-feed/src/messages.rs:183-198, 146-160

Price Encoding

CME uses mantissa-exponent encoding for prices:
The exponent is typically:
  • -2 for ES futures (0.01 precision)
  • -3 for higher precision instruments
Source: nano-feed/src/messages.rs:163-168

Trade Messages

Trade messages contain executed trades with aggressor side:
Source: nano-feed/src/messages.rs:274-289, 235-247

Zero-Copy Parsing

NanoARB uses the nom parser combinator library for zero-copy, zero-allocation parsing of binary MDP 3.0 messages.

Parser Architecture

Source: nano-feed/src/parser.rs:170-193

Message Parser

The MdpParser maintains sequence tracking and handles incomplete buffers:
Source: nano-feed/src/parser.rs:35-94

Sequence Gap Detection

The parser automatically detects missing messages:
Source: nano-feed/src/parser.rs:115-133

Synthetic Data Generation

For development and backtesting, SyntheticGenerator creates realistic market data:

Configuration

Source: nano-feed/src/synthetic.rs:14-40

Preset Configurations

Pre-configured settings for common instruments:
Source: nano-feed/src/synthetic.rs:62-92

Generating Events

Source: nano-feed/src/synthetic.rs:157-176, 365-373

Realistic Market Dynamics

The generator simulates:
  • Price movement: Random walk with configurable volatility
  • Bid-ask spread: Maintains realistic spread in ticks
  • Depth levels: Multiple price levels with varying quantities
  • Trade flow: Alternating buy/sell trades that consume liquidity
  • Time progression: Realistic timestamps with configurable intervals
Source: nano-feed/src/synthetic.rs:166-169

Usage Example

Real Market Data

Synthetic Data for Testing

Performance Characteristics

Parsing Latency

The zero-copy parser achieves:
  • BookUpdate parsing: ~200-400ns per message
  • Trade parsing: ~150-300ns per message
  • Sequence validation: ~10ns overhead per message
Benchmark your system:

Memory Usage

The parser maintains minimal state:
  • MdpParser: 16 bytes (sequence counter + flags)
  • Per-message allocation: Only for variable-length entry vectors
  • Zero-copy: No intermediate buffers for parsing

Error Handling

Handle gaps by requesting snapshots:

Next Steps

Feature Extraction

Extract LOB features from market data

Order Book

Reconstruct the limit order book

ML Integration

Feed data into ML models

Backtesting

Backtest strategies on historical data