← back to projects

tape

production

Rust market-data & execution-analysis system across Solana, Ethereum, and Base DEX venues. Normalizes every venue into one MarketEvent schema behind a lock-free hot/warm split, with per-stage p50/p99/p999 latency telemetry measured on the running instance.

RustTokioSolanaEVMaxumParquet

Overview

tape is a Rust daemon that ingests live DEX market data from Solana (Raydium V4, Orca Whirlpools, Meteora DLMM — SPL and Token-2022) and EVM (Uniswap V2/V3, Aerodrome on Ethereum + Base), and normalizes every venue into a single MarketEvent schema so downstream consumers never branch on venue-specific wire formats. On top sit cross-venue marginal-price routing, log-return lead-lag analytics, a research-grade capture/replay/Parquet pipeline, and an axum REST/WebSocket API feeding a React dashboard. 11 crates, 600+ unit tests, CI-green.

Architecture

The defining decision is a hot/warm path split enforced by lints (ADR-0001). The hot path — ingestion, decode, and publish — forbids heap allocation, Mutex, and async via clippy::disallowed_methods/disallowed_types, so the published latency numbers come with structural proof they are honest. Decoded events cross from hot to warm through a lock-free SPSC ring (rtrb) and an ArcSwap snapshot fan-out; the warm path (control plane, WebSocket fan-out) is idiomatic Tokio.

Key Features

  • One schema, many venues: a single MarketEvent envelope across five Solana + EVM venues, SPL and Token-2022.
  • Reorg detection: per-chain sliding window (Solana 32 slots, Ethereum 64 blocks, L2s 256) emits an explicit RevertEvent for every invalidated swap — no silent data loss.
  • REST/RPC reconciliation: a continuous truth oracle that catches venue bugs and manipulation by diffing observed state against REST/RPC ground truth.
  • Deterministic capture/replay: a schema-versioned .tape format enables bit-for-bit reproduction of any market-event sequence for backtesting.

Measured Performance

Per-stage latency is read live from /metrics, not illustrative:

  • decode → SPSC publish: 89 ns p50 / 340 ns p99
  • end-to-end (source → screen): 4.3 ms p50 / 24 ms p99