This repository combines two risk management studies into one project. The main notebook is a counterparty credit risk project covering FX exposures, interest rate swap exposures, CVA, sensitivities, and hedge VaR. The supporting notebook develops the scenario generation tools used in the broader risk workflow, including GBM, Ornstein Uhlenbeck mean reversion, and PCA based swap curve simulation.
The final project receives the most weight because it connects pricing, exposure simulation, CVA, and hedging into one risk management pipeline.
The final project prices and simulates a multi asset risk book with:
- FX forwards and options across EUR, JPY, CNY, and ZAR
- USD, EUR, and JPY interest rate swaps
- Lognormal and mean reverting FX scenarios
- One factor OU and three factor PCA interest rate curve scenarios
- Expected positive exposure and expected negative exposure profiles
- CVA for USD and EUR swaps using swaption based expected exposure
- CVA sensitivities to credit spread and implied volatility
- Historical simulation VaR with CDS hedges, vega hedges, and combined hedges
| Result | Value |
|---|---|
| Starting FX portfolio value | 770K USD |
| Initial USD equivalent swap portfolio value | -543K USD |
| USD 5Y swap CVA, one year grid | 53.1K USD |
| USD 95 percent CVA VaR, unhedged | 4.3K USD |
| USD 95 percent CVA VaR, CDS and vega hedged | 173 USD |
| USD 99 percent CVA VaR, unhedged | 8.7K USD |
| USD 99 percent CVA VaR, CDS and vega hedged | 287 USD |
The main finding is that model choice changes the shape of the exposure distribution. OU scenarios keep FX exposure more bounded than lognormal scenarios, while PCA interest rate scenarios reveal more curve shape risk than a one factor rate model. For CVA VaR, the combined CDS and vega hedge is the most effective hedge in the historical simulation because it addresses both spread driven and volatility driven CVA moves.
The supporting analysis estimates and compares:
- GBM drift and volatility for equity indices, single stocks, rates, FX, and commodities
- OU mean reversion parameters for the same market factors
- Asset class level model choice between GBM and OU
- PCA factor structures for USD, EUR, JPY, and GBP swap curves
- One factor OU swap curve simulation against three factor PCA curve simulation
This notebook is included because it shows the modeling foundation behind the final project: how to build market risk scenarios, when mean reversion is appropriate, and why three factor PCA captures level, slope, and curvature shocks that a one factor model misses.
data/
fx_ir_cdx_swaption_cva_data.xlsm
swap_curve_pca_data.xlsm
notebooks/
cva_exposure_var_final_project.ipynb
scenario_generation_pca_supporting_analysis.ipynb
requirements.txt
DATA.md
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
jupyter labOpen the notebooks from the notebooks folder. They are already executed, so the main tables and plots can also be reviewed directly on GitHub.
The notebooks and Excel workbooks contain the reproducible analysis and the important market data inputs.