Multi-Exchange Market Data Collector (Reference) by Changfei DingMulti-Exchange Market Data Collector (Reference) by Changfei Ding

Multi-Exchange Market Data Collector (Reference)

Portfolio project
Changfei Ding
Live Capture & Spread Overview
Live Capture & Spread Overview
Reference implementation · live public exchange sample + deterministic offline replay
Data & Automation Architect — Resilient multi-exchange market data collector in Python (asyncio + aiohttp + SQLite WAL) normalizing live WebSocket and REST feeds from Coinbase (BTC-USD), Kraken (XBT/USD → BTC-USD), and OKX (BTC-USDT) while keeping quote currencies explicit.
Features capped jittered exponential backoff, a per-venue circuit breaker reset only after persisted valid ticks (price > 0), monotonic stale-feed detection wired into active WS reconnect and REST fallback, non-blocking REST gap backfill with strict window/new-row verification, and INSERT OR IGNORE deduplication (UNIQUE(run_id, exchange, symbol, ts_ms, source, dedup_seq)).
Verified via deterministic offline replay (177 deduplicated ticks from 179 raw inputs, 1 recovered 7s gap, 40 passing tests under ruff and mypy) and a 45-second live multi-venue capture (1,543 stored ticks from 1,614 raw frames, 0.83 bps abs / +0.75 bps signed mean USD-USD spread, 15.88 bps mean USDT-USD basis, 159.0–241.0 ms live p95 non-skewed ingest latency), emitting HTML, PNG, and structured JSON reports.
Built with AI-assisted tooling; architecture, review, and tests by me.

0 likes · 1 view · Nov 20, 2026

Reference implementation: resilient Coinbase/Kraken/OKX WS+REST collector with SQLite WAL, gap backfill, and spread analytics (40 pytest, live 45s sample).

Tags