An institutional-grade Fixed Income pricing engine that retrieves historical US Treasury data, bootstraps zero rates using piecewise log-linear interpolation, and implements the Nelson-Siegel-Svensson (NSS) parametric model to fit continuous yield curves.
This project specifically models the dynamic yield curve shifts (Normal -> Inverted -> Steep) observed during the 2006–2008 Great Financial Crisis.
- Automated Data Pipeline: Fetches constant maturity US Treasury yields (1M to 30Y) directly from the Federal Reserve Economic Data (FRED) API.
- Advanced Bootstrapping: Utilizes
QuantLibto handle day-count conventions (Actual/Actual ISDA), holiday calendars, and zero-rate extraction. - NSS Optimization: Implements the 6-parameter Nelson-Siegel-Svensson mathematical model via
scipy.optimizeto smooth noisy market data into a continuous curve. - Crisis Visualization: Pro-quant terminal aesthetic plotting using
matplotlibto visualize curve inversion.
The engine estimates the zero rate
1 Terminal logs detailing the FRED data fetch and NSS calibration parameters (
- src/data_loader.py: FRED API integration and data cleaning.
- src/bootstrapper.py: QuantLib environment setup and piecewise log-linear discounting.
- src/nss_model.py: SciPy curve fitting and mathematical parametric formulation.
- src/visualizer.py: Matplotlib plotting logic.
- main.py: The central pipeline orchestrating the above modules.
For Educational and Research Purposes Only. The code and models provided in this repository do not constitute financial advice, investment recommendations, or trading signals. Yield curve bootstrapping in a live production environment requires highly granular tick data, bid/ask spread handling, and proprietary instrument modeling not included in this academic demonstration.