Aegis — BTC Trading Signal Platform
A rule-based BTC signal and risk platform built on domain-driven architecture: live OKX market + derivatives data, a deterministic signal engine, hard risk gates, and a manual-confirmation workflow pushed to Telegram and a live dashboard.
Overview
I trade BTC discretionarily and wanted to stop running the same checklist by hand every session. Aegis is the system version of that checklist: it ingests live market and derivatives data, runs a deterministic regime + signal engine, applies hard risk gates, and proposes trades I confirm manually — it never auto-executes. The design constraint that shaped everything: a trading tool that quietly lies to you is worse than no tool. So the engineering bias is toward honesty — knowing when the data is real, when a signal is trustworthy, and when the whole thing should stay silent.
Process
- 01
Domain-driven architecture
Structured as clean DDD: domains (market_data, derivatives, features, strategies, execution, review) hold the logic; infrastructure (OKX, Coinglass, Telegram, SQLite) holds the adapters; apps (worker, api, backtest) are the entry points. Strategy is a Protocol — feed it a context of daily/4H trend, structure, and crowding features, get back a typed SignalProposal with entry zone, stop, TP1/TP2, R:R, and confidence. Swapping a data source or adding a strategy doesn't touch the core.
- 02
Live data + anti-lying guardrails
The original MVP leaned on Binance futures, which returns HTTP 451 in my environment — so it silently fell back to demo data and produced misleading alerts. I rebuilt derivatives on OKX public endpoints and tagged every snapshot with source and is_live. Snapshot-health checks now run before anything publishes: the daily brief is skipped and auto-published signal alerts are blocked whenever derivatives data is fallback or stale. The system would rather say nothing than say something false.
- 03
Signal → confirm → journal loop
A scheduler runs the scan loop on an interval; signals push to Telegram (rate-limited to 04:00–22:00 PT, de-duplicated, with a once-a-day heartbeat so silence is informative). I confirm or reject from Telegram or the dashboard, which also carries a manual-trade journal, a screenshot-draft review queue, a weekly report, OKX read-only account sync, PnL reconciliation, and a live strategy-parameter panel. A first-pass backtest runner exists too — and I deliberately label its 100% win rate as a smoke test, not an investable number: the window is short and trend-biased, with no slippage, fees, or funding yet.
Result
A 3,500-line, 25-test platform that runs end-to-end on live OKX data and surfaces trustworthy, manually-confirmed BTC signals — with the discipline to go quiet when its inputs degrade. The next milestones are the honest ones: a production-grade backtest with fees / funding / slippage and historical derivatives replay, a public HTTPS endpoint for TradingView webhooks, and richer health observability. The real lesson mirrors my C++ quant work — the math behind a signal is the easy part; the hard part is the engineering that makes the system safe to actually trust with money.
By the numbers
3.5k lines
Code
25
Tests passing
OKX live
Data source
None
Auto-execution
Next project
Content IP Engine — Agentic Daily Content Pipeline
A scheduled, agent-driven content factory for a personal-growth creator: it runs a thrice-weekly loop from topic generation to script, storyboard, and editing notes to publish copy — short-form and long-form from a single topic — with Slack as the human-in-the-loop interface.