modeling-xva-adjustments
Calculates comprehensive XVA including CVA, DVA, FVA, KVA, and MVA with portfolio-level analysis and hedging strategies. Use when computing XVA, modeling valuation adjustments, or analyzing funding costs.
Best use case
modeling-xva-adjustments is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Calculates comprehensive XVA including CVA, DVA, FVA, KVA, and MVA with portfolio-level analysis and hedging strategies. Use when computing XVA, modeling valuation adjustments, or analyzing funding costs.
Teams using modeling-xva-adjustments should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/modeling-xva-adjustments/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How modeling-xva-adjustments Compares
| Feature / Agent | modeling-xva-adjustments | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Calculates comprehensive XVA including CVA, DVA, FVA, KVA, and MVA with portfolio-level analysis and hedging strategies. Use when computing XVA, modeling valuation adjustments, or analyzing funding costs.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Modeling XVA Adjustments ## When To Use - Computing credit valuation adjustment (CVA) or debit valuation adjustment (DVA) for OTC derivative portfolios - Quantifying funding valuation adjustment (FVA) to reflect treasury funding costs/benefits on uncollateralized or partially collateralized positions - Estimating capital valuation adjustment (KVA) to allocate regulatory capital costs (SA-CCR, IMM, FRTB) back to individual trades - Calculating margin valuation adjustment (MVA) for initial margin costs under UMR or CCP requirements - Performing portfolio-level XVA aggregation with netting set and CSA-aware exposure profiles - Designing XVA hedging strategies or evaluating incremental XVA on new trades ## Inputs To Gather - **Trade population**: Trade-level details (notional, maturity, currency, product type) for each netting set - **CSA / margin terms**: Threshold, minimum transfer amount, independent amount, eligible collateral, rehypothecation rights, variation margin frequency, initial margin model (ISDA SIMM vs. schedule) [VERIFY against actual CSA documents] - **Counterparty credit data**: CDS spreads or mapped credit curves, recovery rate assumptions, rating/sector if using proxy curves - **Own-credit data**: Entity CDS spread or internal funding curve for DVA and FVA - **Market data**: Yield curves, FX rates, volatility surfaces, correlation assumptions for exposure simulation - **Funding curve**: Internal cost-of-funds curve distinguishing secured vs. unsecured rates; FVA spread = unsecured funding rate − OIS - **Regulatory parameters**: SA-CCR alpha factor, supervisory risk weights, cost-of-capital rate (typically 8–12%), capital horizon [VERIFY against current Basel III/IV regime applicable to entity] - **Simulation parameters**: Number of Monte Carlo paths, time grid granularity, diffusion model choice (GBM, local vol, stochastic vol) ## Workflow 1. **Scope & segmentation** — Identify netting sets, confirm CSA terms per netting set, classify trades as collateralized/uncollateralized/partially collateralized. Determine which XVA components are in scope (CVA, DVA, FVA, KVA, MVA). 2. **Exposure simulation** — Run Monte Carlo simulation to generate future portfolio values on a time grid. Compute expected positive exposure (EPE) and expected negative exposure (ENE) profiles per netting set, applying CSA margining logic (threshold, MTA, margin period of risk). 3. **CVA calculation** — Integrate discounted EPE against counterparty default probability: - CVA ≈ Σ_t [ DF(t) × EPE(t) × (1 − R_cpty) × ΔPD_cpty(t) ] - Use counterparty CDS-implied hazard rates or mapped proxy curves - Apply wrong-way risk adjustments where exposure is correlated with counterparty credit quality 4. **DVA calculation** — Mirror CVA using ENE and own default probability: - DVA ≈ Σ_t [ DF(t) × ENE(t) × (1 − R_own) × ΔPD_own(t) ] - Note DVA accounting treatment varies: IFRS 13 requires DVA in P&L; some desks exclude from pricing [VERIFY entity's DVA policy] 5. **FVA calculation** — Compute funding cost/benefit on expected unsecured exposure: - FVA ≈ Σ_t [ EPE(t) × s_fund(t) × Δt ] − Σ_t [ ENE(t) × s_fund(t) × Δt ] - Where s_fund is the entity's funding spread over OIS - Distinguish FCA (funding cost) from FBA (funding benefit) if reported separately 6. **KVA calculation** — Estimate lifetime cost of regulatory capital: - Compute future capital profiles using SA-CCR EAD at each simulation date - KVA ≈ Σ_t [ DF(t) × h_capital × RegulatoryCapital(t) × Δt ] - h_capital = hurdle rate (cost of equity minus risk-free rate, typically 6–10%) - [VERIFY applicable capital framework: SA-CCR vs. IMM; Basel III vs. IV timeline] 7. **MVA calculation** — Quantify cost of funding initial margin over trade life: - Project future IM using ISDA SIMM or CCP schedule on simulated portfolios - MVA ≈ Σ_t [ DF(t) × E[IM(t)] × s_fund(t) × Δt ] - For bilateral trades under UMR, confirm phase-in applicability [VERIFY UMR phase and AANA threshold] 8. **Aggregation & allocation** — Sum components to total XVA per netting set and portfolio-wide. Allocate incremental XVA to individual trades using Euler allocation or stand-alone/incremental decomposition for pricing and desk-level P&L attribution. 9. **Hedging strategy** — Identify primary XVA risk drivers: - CVA hedge: Single-name CDS or index CDS (iTraxx/CDX) for spread risk; interest rate swaps for exposure profile - FVA hedge: Secured funding or collateral transformation trades - Assess hedge effectiveness, basis risk, and cost-of-hedge vs. XVA reduction 10. **Sensitivity & stress testing** — Run bumps on key inputs (credit spreads ±10bp, funding spreads ±5bp, rates ±25bp, correlation shifts) and report XVA Greeks (CS01, IR01, FVA01). Stress-test under adverse scenarios (counterparty downgrade, funding stress, margin call spikes). ## Output - **XVA summary table**: CVA, DVA, FVA (FCA/FBA split), KVA, MVA per netting set and total portfolio, with base-case values and percentage of notional - **Exposure profiles**: EPE and ENE time series charts per netting set, with and without collateral - **Capital profile**: Projected regulatory capital over time under SA-CCR / IMM - **IM projection**: Expected initial margin trajectory for MVA computation - **Sensitivity report**: XVA Greeks (CS01, IR01, FVA01, CorrelSens) in tabular format - **Stress results**: XVA under 3–5 stress scenarios with narrative on key drivers - **Hedging recommendation**: Instruments, notional sizing, expected hedge ratio, residual risk, and estimated hedge cost - **Methodology documentation**: Simulation assumptions, model choices, recovery rates, proxy mapping logic, and any overrides ## Quality Checks - Confirm EPE/ENE profiles converge with sufficient Monte Carlo paths (check standard error < 1% of mean) - Validate CVA against analytic approximation (e.g., semi-analytic formula for vanilla swaps) as a sanity check - Ensure FVA sign convention is consistent: positive FVA = cost to the entity for net lending positions - Verify netting set boundaries match legal documentation (ISDA Master Agreement scope) - Cross-check CDS-implied default probabilities against rating-implied benchmarks for reasonableness - Confirm KVA capital calculation matches independently computed SA-CCR EAD for spot date - Validate that collateral modeling correctly reflects CSA terms (threshold, MTA, rounding, eligible currencies) - Review incremental XVA for a new trade: should be bounded between stand-alone XVA (upper) and marginal XVA (lower) - Flag any counterparty without liquid CDS data — proxy mapping methodology must be documented and reviewed
Related Skills
managing-renal-dose-adjustments
Adjusts medication doses based on renal function using CrCl/eGFR calculations. Use when adjusting for renal impairment, calculating CrCl-based doses, or managing medications in kidney disease.
managing-hepatic-dose-adjustments
Guides medication adjustments for hepatic impairment using Child-Pugh classification. Use when adjusting for liver disease, evaluating hepatic metabolism, or managing medications in cirrhosis.
modeling-sum-of-parts-valuations
Builds SOTP valuations for conglomerates and multi-segment companies with segment-appropriate methodologies. Use when valuing diversified companies, calculating conglomerate discounts, or modeling segment breakups.
modeling-revenue-forecasts
Builds bottom-up revenue models from segment-level drivers with assumption documentation. Use when forecasting revenue, modeling growth drivers, or building segment-level projections.
modeling-portfolio-company-returns
Builds PE return models with entry/exit multiples, leverage analysis, and value creation attribution. Use when modeling PE returns, calculating IRR/MOIC, or attributing value creation drivers.
modeling-margin-analysis
Deconstructs gross, operating, and net margin trends with driver attribution and normalization. Use when analyzing profitability, attributing margin changes, or benchmarking margins.
modeling-cap-table-scenarios
Builds cap table models with round-by-round dilution, option pool, and exit waterfall analysis. Use when modeling cap tables, calculating ownership dilution, or projecting exit proceeds.
modeling-bond-valuations
Calculates bond pricing with duration, convexity, OAS, and Z-spread analysis. Use when pricing bonds, calculating risk metrics, or evaluating relative value.
managing-insurance-capital-modeling
Structures insurance capital model analysis with economic capital, regulatory capital, and rating agency capital comparison. Use when modeling insurance capital, comparing capital frameworks, or assessing capital adequacy.
managing-cash-flow-modeling
Models portfolio cash flows for liability-driven and income-oriented investment strategies. Use when modeling portfolio cash flows, planning income distributions, or managing liability matching.
modeling-waterfall-distribution-mechanics
Builds distribution waterfall models with European vs American style carry, preferred return accrual, and GP clawback calculation. Use when modeling distribution waterfalls, comparing carry structures, or calculating LP distributions.
modeling-volatility-targeting-strategies
Builds volatility targeting models with realized vol estimation, leverage adjustment, and drawdown management mechanics. Use when implementing vol targeting, adjusting portfolio leverage, or managing drawdown limits.