Skip to content
← All projectsNo. 04 / 06

Trading Lab

A trading bot built like a critical system, not like a bet.

Year
2026
Role
Personal project — architecture and research
Status
Paper trading · devnet

Technical plate drawn from the project's real data.

The problem

I wanted to understand quantitative trading properly, not with random indicators. The goal was never “making money”: it was deciding with data instead of gut feeling, with formal risk management, without letting overfitting fool me.

What I built

  • 8-module event-driven architecture (data → signals → risk → execution) in strict TypeScript, ~7,700 lines.
  • Real-time Coinbase WebSocket feed, OHLCV bars, an append-only SQLite journal, HTTP health check and feed-outage alerts.
  • Risk layer with 7 pre-trade checks, a kill switch and a daily-loss circuit breaker.
  • FastAPI + Docker microservice serving FinBERT (NLP) to score news sentiment.
  • Research on 4 quantitative hypotheses (cointegration, HMM regimes, GARCH sizing, on-chain metrics).

By the numbers

architecture modules
8
unit tests
120+
pre-trade checks
7
lines of strict TypeScript
7,700

Technical decisions

  • Safe by construction: devnet and paper trading only; mainnet is not implemented and the factory rejects it.
  • Limits reject, they don’t trim: if an order exceeds the cap it is cancelled instead of silently resized.
  • Execution is swappable through an adapter: the same logic runs simulated or against devnet.
  • Reproducible: every run stores its config, commit hash and data hash; reports are never overwritten.
  • Walk-forward validation, purged k-fold and a single out-of-sample evaluation, with a deflated Sharpe ratio.

Stack

  • TypeScript
  • Node.js
  • Python
  • FastAPI
  • Docker
  • SQLite
  • WebSockets
  • Vitest

What I learned

The hard part is not writing a strategy, it is not fooling yourself. That is why the out-of-sample set is touched only once and the experiment log reports everything, including what went wrong.