Exchange stream15 pairsExchange historyfor backfillCollectorgap detectionReconcilelate tradesPartitioned databaseCandles 1m to 1dMorning summaryTelegram
The problem.
Exchange streams drop, trades arrive late and candles quietly come out incomplete. Any signal built on that data inherits the errors, and nobody notices until money is lost.
What we built.
- A collector with gap detection and automatic backfill from the exchange history.
- A settle and reconcile pass for late trades. It fixed about 20% of candles that had volumes understated by up to 70%.
- Higher timeframes, from 5 minutes to 1 day, built from 1-minute candles and cross-checked against the exchange.
- Replay of a whole day through the live write path, compared by hash with what was recorded live.
- A separate watchdog, a morning summary in Telegram, backups with a monthly restore check.
Decisions worth explaining.
We rehearsed the outage
We cut the server off the network for 15 minutes on purpose. The system noticed and restored all 195 missing candles in 40 seconds after the link came back.
No promises about predictions
This stage is about correct data, not profit. Signals come later and are tested on data this stage has already proven.
In numbers.
72 hacceptance run with zero gaps across 15 pairs
40 sto heal a 15-minute network outage
~245kduplicate trades rejected per day
1:1replay of a day matches the live record by hash
Stack
- Python 3.12
- asyncio
- websockets
- httpx
- SQLAlchemy
- Alembic
- PostgreSQL 16
- Docker Compose
- Telegram Bot API
Need something like this?
Describe your process. We will tell you which parts of this system fit it and what it would cost.
I want the sameHave a process that eats your evenings?