Risk Course
XVA Framework: CVA, DVA & FVA
Simulate IRS exposure under Hull-White and compute CVA, DVA and FVA adjustments from first principles.
Enrol now
- Lifetime access — all lessons & updates
- 11 lessons across 2 structured parts
- Fully worked Jupyter notebooks
- Market datasets + published benchmark prices
- Free lesson previews before you buy
- 14-day money-back guarantee
Secured by a no-questions-asked 14-day refund.
Overview
Introduction
Before 2008, derivative pricing ignored the credit quality of the counterparty. The crisis showed that this was not a theoretical idealisation but a material mispricing — one that destroyed billions of dollars of value on uncollateralised books. Credit Value Adjustment, Debit Value Adjustment and Funding Value Adjustment are the industry's answer: they are the adjustments that bring counterparty risk, own-default risk and funding cost into the fair value of every derivative trade.
This course builds a complete XVA engine for an interest rate swap from first principles. You simulate the swap's mark-to-market across 10,000 paths under the Hull-White model, compute the expected positive exposure and negative expected exposure profiles across the trade's 5-year life, and translate those profiles into CVA, DVA and FVA using the industry-standard discrete-time formulas. Every component is built transparently so you understand exactly what assumptions are driving each adjustment.
CVA is now a regulatory capital line item, reported quarterly by every bank under IFRS 13. DVA is controversial — it is a gain from own-default risk, which raises uncomfortable accounting questions — and FVA divides academic opinion but is universally charged in practice. This course gives you the technical foundation to compute, stress and challenge these numbers, whether your role is in XVA trading, model validation, risk oversight or quant research.
Hands-on
The project you'll build
The project is structured around a single 5-year interest rate swap. You first build an exact Hull-White simulation: using the analytical conditional mean and variance of the short rate, you generate 10,000 paths on a monthly time grid without Euler approximation error, calibrate the model to the current market term structure, and reconstruct the full discount curve on each path at each time step.
With the exposure simulation running, you value the IRS on each path at each future date, compute the expected positive exposure profile EE(t) = E[max(V(t),0)] and the negative expected exposure profile NEE(t) = E[max(-V(t),0)], and compute the 95th-percentile peak exposure PFE(t). You visualise the exposure profiles and verify they peak near the midpoint of the trade's life — a standard sanity check for an at-market swap.
The final component translates exposure into XVA. You compute CVA using the discrete sum LGD × Σ P(0,t_i) × EE(t_i) × ΔPD_B(t_i), and DVA symmetrically for own-default probability and NEE. You compute bilateral CVA, then add FVA for the uncollateralised funding cost. You analyse the impact of a zero-threshold CSA on CVA, compute spread sensitivities, and present the results in a unified XVA decomposition table.
Outcomes
What you'll learn
XVA framework
Explain what CVA, DVA and FVA are, why they were introduced post-2008, and how they enter trade pricing and P&L attribution.
Hull-White exact simulation
Implement the exact conditional simulation of the Hull-White short rate using the analytical mean and variance, avoiding Euler discretisation error.
IRS exposure simulation
Value an interest rate swap on each simulated path at each future date, computing the full distribution of mark-to-market across the trade's life.
EE and NEE profiles
Compute the expected positive exposure and negative expected exposure profiles and the 95th-percentile peak exposure.
CVA computation
Calculate CVA using the discrete-time formula with risk-neutral default probabilities from the counterparty's CDS spread.
DVA and bilateral CVA
Compute DVA from own-default probability and NEE, combine with CVA to form bilateral CVA, and discuss the DVA monetisation controversy.
FVA
Compute the funding value adjustment for the unsecured trade and understand the relationship between FVA and the bank's own credit spread.
CSA and spread sensitivity
Quantify the CVA reduction from a zero-threshold CSA and compute sensitivities of XVA to credit spread and interest rate volatility.
Stack
Tools & technology
The course teaches a workflow, not just a toolset — here is what we use and what you could swap in.
| Tool | Used for | Alternatives |
|---|---|---|
| Python 3 | Hull-White simulation, exposure profiles and XVA computation | Julia, MATLAB, C++ |
| NumPy | Vectorised path simulation, exposure arrays and CVA summation | JAX, CuPy for GPU simulation |
| SciPy | Hull-White calibration to the term structure and spread sensitivity bumping | scipy.stats for normal distribution, custom root-finding |
| Monte Carlo Simulation | Generating the 10,000 short rate paths under Hull-White for exposure simulation | Quasi-Monte Carlo, PDE methods, semi-analytical exposure approximations |
| Jupyter | Step-by-step exposure profile visualisation and XVA decomposition output | VS Code, plain Python scripts |
Syllabus
Course curriculum
11 lessons across 2 parts. Lessons marked Free preview can be read before you enrol.
Part 1 — Exposure SimulationSimulate IRS exposure under Hull-White and compute EE/NEE profiles.
- 1.XVA: the accounting of counterparty riskWhy CVA, DVA and FVA exist and how they enter P&L and pricing.Free preview
- 2.Hull-White short rate simulationExact simulation of the HW SDE and calibration to the term structure.Free preview
- 3.IRS mark-to-market at each time stepValue a swap on each path at each future date using the simulated curve.
- 4.Expected Exposure (EE) and peak exposureAverage max(V(t),0) across paths to build the EE profile.
- 5.Negative Expected Exposure (NEE)Compute our liability exposure E[max(-V(t),0)].
Part 2 — CVA, DVA & FVACompute the three XVA adjustments and analyse their sensitivities.
- 1.CVA: credit value adjustmentCompute CVA = LGD × Σ P(0,t) × EE(t) × ΔQ_B(t).
- 2.DVA: debit value adjustmentCompute DVA from own-default survival probability and NEE profile.
- 3.Bilateral CVA: BCVA = CVA − DVANet the two adjustments and discuss the DVA controversy.
- 4.FVA: funding value adjustmentCompute the cost of funding the uncollateralised trade.
- 5.XVA sensitivities to spread and volBump credit spreads and IR vol and observe the impact on XVA.
- 6.Conclusion: from XVA to KVA and MVAThe full alphabet of valuation adjustments and where they matter.
Before you start
Prerequisites
- Hull-White model familiarity: the SDE, mean reversion and the closed-form ZCB price (the Short Rate Models course covers this).
- Swap pricing fundamentals: how an IRS is valued from a discount curve (covered in the Yield Curve Bootstrapping or LMM course).
- Working Python and NumPy — Monte Carlo loops, array operations, broadcasting.
- Basic credit concepts: default probability, hazard rate, LGD and survival probability (the CDS Pricing course is ideal preparation).
Fit
Who this course is for
XVA quants and traders
You work on a CVA desk or XVA trading book and want a complete, from-scratch engine to verify your understanding of the numbers you produce daily.
Model validation analysts
You validate XVA models and need a transparent reference implementation to test against production systems and identify approximation errors.
Risk managers and controllers
You oversee derivative counterparty risk and want to understand the mechanics of the exposure and XVA calculations you receive from the front office.
Quant finance students
You are studying counterparty credit risk and want a complete, working XVA engine to complement the academic literature on Brigo, Green and Gregory.
Faculty
Your instructor
QuantIndex Faculty
QuantIndex Faculty are practising quantitative analysts with direct experience building and validating XVA engines, computing CVA capital and managing counterparty credit risk on rates and credit derivative books. The course is written by quants who implement Hull-White exposure simulation and XVA desk workflows in production and is reviewed for technical accuracy and code quality before each release.
Benchmarked & verified
Every price you compute is checked against published results from leading textbooks and market data. You do not finish the course hoping your model is right — you finish it knowing.
Questions
Frequently asked questions
What is the difference between CVA and a credit reserve, and does the distinction matter for my role?
A credit reserve is a discretionary P&L buffer; CVA is a mark-to-market fair value adjustment calculated from market-implied default probabilities, required under IFRS 13 and reported in financial statements. The distinction matters enormously for a bank's reported earnings, regulatory capital calculation (SA-CVA under Basel III) and for the desk P&L attribution between the trading desk and the XVA desk.
Why use Hull-White and not a more realistic multi-factor model for exposure simulation?
Hull-White is the industry-standard single-factor model for XVA because it calibrates exactly to the market term structure, produces analytical simulation moments (so exact simulation is possible), and generates well-behaved exposure profiles. Multi-factor models (G2++, LMM) are used by large banks for complex books; the Hull-White version taught here is the correct foundation and the most common approach for IRS-heavy portfolios.
Is DVA real? I have heard it is controversial.
DVA is real in the sense that it is required under IFRS 13 and affects reported P&L. It is controversial because it represents a gain from the bank's own deteriorating credit quality, which is difficult to monetise in practice — you cannot hedge your own default by buying back your own bonds in size. The course covers both the mechanics and the controversy, including the FVA debate triggered by Hull and White.
How does a zero-threshold CSA reduce CVA, and by how much in the examples?
A zero-threshold CSA requires daily margin exchange so that the exposure at any point equals only the one-day move, rather than the full mark-to-market accumulated over the life of the trade. In the course examples, a zero-threshold CSA reduces CVA by roughly 80–90% for a 5-year IRS, demonstrating why collateral agreements are the most effective CVA mitigation tool available.
What is the difference between CVA as computed here and regulatory CVA capital?
The CVA computed in the course is the fair-value adjustment used for trade pricing and IFRS accounting. Regulatory CVA capital under Basel III (SA-CVA) is a capital charge computed using a standardised formula with supervisory parameters, not necessarily equal to the fair-value CVA. The course focuses on the economic fair-value CVA; the final lesson discusses the regulatory capital implications.
Is there a refund policy?
Yes — a 14-day, no-questions-asked money-back guarantee. If the course is not right for you, email us and we will refund you in full.
Ready to start?
- Lifetime access — all lessons & updates
- 11 lessons across 2 structured parts
- Fully worked Jupyter notebooks
- Market datasets + published benchmark prices
- Free lesson previews before you buy
- 14-day money-back guarantee
Secured by a no-questions-asked 14-day refund.