A Python-based fixed income risk engine that models yield curves, prices bonds, and evaluates interest rate risk using DV01, duration, convexity, and key rate sensitivity analysis. The project uses real US Treasury data to simulate portfolio behavior under interest rate shocks.
- US Treasury Constant Maturity Rates (modeled from market yield curve data)
| Maturity (Years) | Yield |
|---|---|
| 0.0833 | 0.0374 |
| 0.25 | 0.0367 |
| 0.50 | 0.0359 |
| 1.00 | 0.0348 |
| 2.00 | 0.0347 |
| 5.00 | 0.0373 |
| 10.00 | 0.0418 |
| 30.00 | 0.0484 |
| Scenario | Portfolio Value |
|---|---|
| Base Case | 249.10 |
| +100 bps Shock | 236.61 |
| -100 bps Shock | 262.58 |
- Loss under +100bps: -12.49
- Gain under -100bps: +13.48
- 0.1297
| Maturity | KRDV01 |
|---|---|
| 2Y | 0.0184 |
| 5Y | 0.0414 |
| 10Y | 0.0699 |
- Portfolio exhibits non-linear interest rate sensitivity
- Gains from rate declines exceed losses from rate increases → convexity effect
- Risk exposure is concentrated in the long-end (10Y bucket dominates KRDV01)
- Duration alone underestimates portfolio risk under stress scenarios
- Built using term structure of Treasury yields
- Maturity spectrum from 1M to 30Y
- Discounted cash flow bond pricing
- Coupon and maturity-based valuation
- DV01 (Dollar Value of 1 basis point)
- Duration and convexity approximation
- Key Rate DV01 decomposition
- Parallel rate shocks (+/- 100 bps)
- Portfolio-level P&L simulation
Python, NumPy, Pandas, SciPy, Matplotlib
Yield curve constructed from observed market data across 1M–30Y maturities.
Non-linear P&L response demonstrating convexity effects under parallel rate shocks.
This project simulates a simplified rates risk engine similar to those used in:
- Market Risk teams
- Fixed Income trading desks
- Counterparty Credit Risk (CCR) analysis
Ranveer Bhalla

