Case 03 — Crisis Monitor as a Service
A composite crisis score (0–100) built from 11 weighted components. 56 tickers analysed continuously, institutional short signals via REST, Telegram and web — monetised through Stripe.
The challenge
Professional investors needed a reproducible crisis score — with sources, weights and an audit trail. Requirements: FRED macro data, yfinance market data, 4 sector scorers (banks, CRE, BDCs, high-yield), ML classifiers, near-real-time short signals, multi-channel delivery, SaaS billing.
Architecture
A FastAPI core with JWT + rate-limiting. A crisis engine aggregates 4 sector scorers and a short scanner. ML layer: LSTM predictor, XGBoost classifier, HMM regime detection. Data fetchers for FRED, yfinance, EDGAR, options, news. Alert layer: Telegram bot. Subscription layer: Stripe. Dashboard on Streamlit, landing site static.
Pipeline
Composite-score computation (daily)
- 01Fetchers pull FRED, yfinance, EDGAR — versioned cache
- 024 sector scorers compute banks, CRE, BDC and HY sub-scores
- 03ML models yield regime classification + forward forecast
- 04Aggregator weights the 11 components into the final 0–100 score
- 05Threshold-based alerts to Telegram and email depending on tier
Technology stack
Outcome
In production as a containerised Docker stack, healthy for weeks. The composite score is reproducible, every sub-score auditable. 5 risk levels (CALM, MONITORING, ELEVATED, HIGH_RISK, CRISIS) are delivered consistently via API, Telegram and dashboard. Subscription tiers control delivery granularity.