Why volatility, not price
Predicting price direction is hard. Predicting volatility — the size of future swings — is more tractable and still useful for risk management.
GARCH basics
GARCH models conditional variance as a function of past squared returns and past variance. It captures volatility clustering: turbulent periods tend to follow turbulent periods.
Building the FastAPI service
The service exposes endpoints to:
- Fetch historical prices
- Fit a GARCH(1,1) model
- Return a volatility forecast with confidence intervals
FastAPI's auto-generated docs made the API easy to consume and test.
Deployment
I containerized the service with Docker and deployed to Render. Keeping the model fitting server-side avoids shipping weights to the client.
Takeaways
Financial time series reward careful modeling over brute force. GARCH is a small, interpretable model that performs surprisingly well for short-horizon volatility.



