Module matching

Source
Expand description

L2 Matching Engine - Realistic order matching with queue position modeling

Provides accurate L2 order matching simulation including:

  • FIFO queue position tracking
  • Partial fill support
  • Realistic latency simulation
  • Multiple queue models (RiskAverse, Probabilistic, L3FIFO)

§Lock Ordering Convention

IMPORTANT: To prevent deadlocks, always acquire locks in the following order:

  1. order_map
  2. bid_orders or ask_orders

Never acquire bid_orders/ask_orders before order_map when both are needed.

Structs§

ConservativeParams
Conservative execution parameters
Execution
Order execution result
MarketImpact
Market impact model for limit orders
MatchingEngine
L2 Matching Engine with const generic order queue sizing
Order
Order information for matching

Enums§

OrderSide
Order side
OrderType
Order type
QueueModel
Queue model types
QueuePosition
Queue position information
TimeInForce
Time in force

Type Aliases§

DefaultMatchingEngine
Default matching engine with 8 orders per price level
MatchingEngine4
Matching engine with 4 orders per price level (low liquidity)
MatchingEngine16
Matching engine with 16 orders per price level (medium liquidity)
MatchingEngine32
Matching engine with 32 orders per price level (high liquidity)