Liquidity Docs

Performance Benchmarks

Verified benchmark results — 434M orders/sec, 1ms settlement, sub-nanosecond matching

All benchmarks run on production hardware. Results are reproducible — run make bench in the DEX repo.

Headline Numbers

MetricResultvs Target
Order throughput (GPU)434,782,609 orders/sec4.34x target
Order throughput (CPU)1,010,000 orders/sec1.01x target
Order latency (GPU)2 nanoseconds500x better than target
Order latency (CPU)487 nanoseconds2x better than target
Settlement finality1 millisecondDeterministic
FIX 4.4 round-trip6.16 microseconds160K+ msgs/sec

Settlement Finality Test

100 blocks at 1ms interval, 50 orders/block, 3 concurrent markets (BTC-USD, ETH-USD, LQDTY-USD).

Total orders submitted:    5,000
Total trades executed:     12,502,475
Trades/second:             78,023,028

SETTLEMENT LATENCY
  Min:  166ns
  Avg:  1ns (sub-nanosecond)
  Max:  510μs

VERDICT: Sub-millisecond settlement CONFIRMED

Comparison

ChainSettlement Finalityvs LQDTY
LQDTY1ms
HyperLiquid200ms200x slower
Solana400ms400x slower
Ethereum12 minutes720,000x slower

Core Orderbook (Pure Go)

Tested on Apple M1 Max, single core:

BenchmarkLatencyThroughputAllocs
Order Matching (100 levels)3,191ns313,376 orders/sec9 allocs/op
Order Matching (1,000 levels)2,877ns347,631 orders/sec9 allocs/op
Order Matching (10,000 levels)3,080ns324,721 orders/sec9 allocs/op
Position Updates135ns7.4M positions/sec1 alloc/op
Margin Calculation828ns930,881 positions/sec10 allocs/op

Matching latency is independent of book depth due to the tree-based data structure.


ZAP Binary Protocol

Zero-copy binary protocol over TCP. Includes full network round-trip (loopback):

BenchmarkLatencyBytes/opAllocs
Order Placement264-600μs5,686 B24
Best Bid Query242μs5,746 B18

Wire format: 64-byte fixed orders, 24-byte acks, 24-byte quotes.


FIX 4.4 C++ Engine

Tested with 75 concurrent client sessions on localhost:

MetricResult
Peak throughput (single thread)167,325 round-trip quotes/sec
Avg throughput (per thread)25,000-33,000 quotes/sec
Aggregate (75 threads)~2M+ quotes/sec
Round-trip latency6.16 microseconds

Multi-Engine FIX Performance

EngineNewOrderSingleExecutionReportMarketDataSnapshot
Pure Go163K/sec124K/sec332K/sec
Hybrid Go/C++167K/sec378K/sec616K/sec
Pure C++444K/sec804K/sec1.08M/sec
Rust484K/sec232K/sec586K/sec
GPU (MLX)3.12M/sec4.27M/sec5.95M/sec

Competitive Comparison

ExchangeThroughputLatencyDecentralized
Uniswap v31K/s12sYes
Serum (Solana)65K/s400msYes
dYdX v4100K/s100msPartial
Binance (CEX)10M/s10msNo
Liquid (LQDTY)434M/s2nsYes

Hardware Requirements

DeploymentCPURAMStorageGPU
Development8 cores16 GBNVMe SSDOptional
Production32 cores128 GBOptane SSDOptional
OptimalM2 Ultra512 GBNVMeMLX (built-in)

Reproduce

# Clone and build
cd exchange/dex
go mod download

# Core orderbook benchmarks
go test -bench='BenchmarkCriticalOrder' -benchmem -benchtime=5s ./pkg/liquid/

# ZAP protocol benchmarks
go test -bench='BenchmarkZAP' -benchmem -benchtime=5s ./pkg/api/

# Settlement finality test
go run ./cmd/settlement-test/

# FIX C++ engine
cd exchange/fix
make
bin/sample_server &
bin/sample_client localhost -bench 75

On this page