TradeWatch
In progressPhase 3 of 12 completeMarket Intelligence & Paper-Trading Platform
- price
- 96.43
- mean
- 98.20
- σ
- 1.94
- z
- -0.91
t+0066 Flagged: 3.0 standard deviations below the rolling mean.
TradeWatch watches live market data and tries to notice when something is behaving strangely compared to how it normally does. Prices and trades stream in continuously, so the system has to keep up in real time rather than analyzing things after the fact.
Under the hood, market data flows through Kafka to two separate processes that both read the same stream: one stores every trade exactly as it came in, and the other builds it into one minute, five minute, hourly, and daily candles. Kafka only guarantees a message will arrive at least once, so both processes are written so that receiving the same trade twice never corrupts the data.
Rather than jumping straight into building trading strategies, most of the work so far has gone into making sure the plumbing underneath is actually trustworthy: the pipeline, the database writes, the CI checks. Right now the project is on phase 3 of 12, and there is no strategy engine or machine learning yet, on purpose. A trading strategy built on top of a shaky pipeline is worse than no strategy at all. The anomaly detector, once it's live, will only ever flag activity that looks unusual for that specific stock compared to its own history. It is not trying to catch fraud or market manipulation, and the project is careful not to claim that it does.
Implementation detail09
- Real-time pipeline: a market data provider feeds Kafka, which fans out to two independent consumer groups — one storing raw trades in PostgreSQL, one aggregating into 1-minute bars with 5m/1h/1d rollups.
- At-least-once delivery with idempotent writes; offsets are only committed after data is durably stored.
- Over 30 days of real historical backfill, aggregated into multi-timeframe bars.
- Statistical anomaly detection flags market activity that is unusual relative to a symbol's own recent behaviour — explicitly not a claim of fraud or manipulation detection.
- Simulates trading only: no brokerage connectivity, no real money moves.
- Layered architecture (domain / application / infrastructure) enforced by import-linter in CI.
- Typed settings that fail startup with every missing config variable named at once.
- Five independent CI jobs: lint and type-check, unit and API tests, integration tests against real Postgres, a startup check, and the frontend.
- No performance number appears anywhere in the project unless a benchmark produced it.
- Python
- FastAPI
- Kafka
- PostgreSQL
- Redis
- Alembic
- React
- TypeScript
- Vite
- Docker
- GitHub Actions