Stop measuring risk against the S&P 500. Measure it against Your Portfolio.
Internal Beta is a professional-grade, self-hosted risk engine for stock investors. While standard tools compare stocks to the "Market," this system calculates how a stock moves relative to your specific holdings.
Built with Python 3.13 (FastAPI), React 19, and Real-time Financial Data, it identifies if a new stock is a true diversifier or just adding hidden concentration to your wealth.
Every brokerage shows you Beta vs the S&P 500. But that's not your risk.
- The Insight: A stock with a market beta of 1.2 might have an Internal Beta of 0.3 against your specific portfolio — making it a powerful diversifier for you.
- The Math: We use Leave-One-Out Covariance to avoid self-correlation inflation and Ledoit-Wolf Shrinkage for stable risk estimation.
Comprehensive analysis of your current state: Sharpe ratio, Max Drawdown, MCTR (Marginal Contribution to Risk), Correlation Clusters, and Efficient Frontier visualization.
Pick any stock. The system runs a 5-factor composite score (Sharpe improvement, Volatility reduction, Diversification benefit, Tail risk, and Quality-Valuation fit) to show you the optimal number of shares to add.
Scans S&P 400 in real-time via SSE. Ranks candidates by Cheap-Quality Score (Quality x Valuation) and instantly shows their Internal Beta fit for your specific portfolio.
Automated monitoring of ROIC, Gross Margins, FCF Yield, and Debt Health. The system flags "Broken Theses" when fundamental compounding signals start to decelerate.
The system is built as a high-performance, asynchronous microservices suite:
- Frontend: React 19, TypeScript, Tailwind CSS, Recharts (Heatmaps & Frontiers).
- Backend: Python 3.13, FastAPI (Async), Pydantic v2, Poetry.
- Data Engine:
yfinancefor data,PyPortfolioOptfor Ledoit-Wolf covariance shrinkage. - Infrastructure:
- Nginx: API Gateway with SSE passthrough.
- Redis: Shared cache for price/analysis (30min - 24h TTL).
- PostgreSQL: Secure portfolio persistence.
Ensure you have Docker and Docker Compose installed, then run:
git clone https://github.com/adifinki/internal-beta.git
cd internal-beta
docker compose up --build