mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
Chaos tests (Jepsen-style): - OrderMatchingAtomicity: verify buy+sell match is atomic - CLOBPriceTimePriority: 100 orders verify FIFO at same price - PartitionedMatchingEngine: no phantom fills after partition - ZMQMessageDelivery: no lost/duplicate orders under transport drops - NATSFailover: order flow survives disconnect/reconnect - ConcurrentCancelFill: race cancel vs fill, exactly one wins - MarketOrderSlippage: VWAP within 10% of best ask - GatewayLoadShedding: 10K orders, no panics, consistent book Benchmarks: - OrderInsert: ~773K ops/sec, 1294ns/order - OrderMatch: ~15K matches/sec, 66us/match - CancelOrder: ~608K ops/sec, 0 allocs - BatchOrders: ~442K orders/sec (1000-order batches) - ConcurrentMatching: ~16K markets/sec across 100 parallel books Known: engine has data races in AddOrder.LastOrderID (non-atomic write after atomic.Add) exposed by concurrent ZMQ/LoadShedding tests.