modeling-counterparty-credit-exposure
Calculates potential future exposure and CVA with simulation-based approaches and netting agreement analysis. Use when modeling counterparty exposure, calculating CVA/DVA, or assessing counterparty risk.
Best use case
modeling-counterparty-credit-exposure is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Calculates potential future exposure and CVA with simulation-based approaches and netting agreement analysis. Use when modeling counterparty exposure, calculating CVA/DVA, or assessing counterparty risk.
Teams using modeling-counterparty-credit-exposure 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-counterparty-credit-exposure/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How modeling-counterparty-credit-exposure Compares
| Feature / Agent | modeling-counterparty-credit-exposure | 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 potential future exposure and CVA with simulation-based approaches and netting agreement analysis. Use when modeling counterparty exposure, calculating CVA/DVA, or assessing counterparty risk.
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 Counterparty Credit Exposure ## When To Use - Calculating potential future exposure (PFE) profiles for OTC derivative portfolios - Computing credit valuation adjustment (CVA) and debit valuation adjustment (DVA) for pricing or accounting (ASC 820 / IFRS 13) - Assessing counterparty credit limits and concentration risk across netting sets - Evaluating the impact of collateral agreements (CSAs) on exposure profiles - Stress-testing counterparty exposure under adverse market scenarios - Supporting regulatory capital calculations under SA-CCR or IMM [VERIFY: applicable regulatory framework] ## Inputs To Gather - **Trade population**: Full list of trades per counterparty, including notional, trade date, maturity, currency, and product type (IRS, CDS, FX forwards, equity options, etc.) - **Netting agreements**: ISDA Master Agreement status, netting set definitions, and any close-out netting enforceability opinions [VERIFY: jurisdiction-specific enforceability] - **Collateral terms**: CSA parameters — threshold, minimum transfer amount (MTA), independent amount, eligible collateral types, rehypothecation rights, margin period of risk (MPR) - **Market data**: Yield curves, volatility surfaces, FX spot rates, credit spreads (CDS or bond-implied), correlation assumptions - **Counterparty credit data**: Credit ratings, CDS spreads (or proxy spreads), probability of default (PD) term structures, loss given default (LGD) assumptions - **Own credit data**: Entity CDS spreads or proxy for DVA calculation - **Simulation parameters**: Number of Monte Carlo paths, time grid granularity, confidence level for PFE (typically 95th or 97.5th percentile), simulation horizon ## Workflow 1. **Map netting sets and collateral** - Group trades by legal netting agreement; confirm enforceability per jurisdiction - Parse CSA terms: thresholds, MTAs, MPR, eligible collateral haircuts - Identify wrong-way risk exposures (counterparty credit quality correlated with exposure) 2. **Calibrate market models** - Select diffusion processes per risk factor (e.g., Hull-White for rates, GBM or local vol for equities/FX, reduced-form for credit) - Calibrate to current market data; document calibration targets and fit quality - Set correlation matrix across risk factors — use historical estimation with appropriate lookback window 3. **Run Monte Carlo simulation** - Simulate joint evolution of all risk factors across the time grid - Reprice each trade at each time step on each path (use analytic approximations or regression-based methods like Longstaff-Schwartz for early-exercise products) - Aggregate to netting-set level, apply close-out netting: net exposure = max(0, sum of MTMs within netting set) 4. **Apply collateral dynamics** - Model collateral calls with MPR lag (typically 10–20 business days for bilateral, 5 for cleared) - Apply thresholds, MTAs, and independent amounts per CSA - Compute collateralized exposure at each time step: E(t) = max(0, net MTM − collateral held) 5. **Calculate exposure metrics** - **Expected Exposure (EE)**: Mean of positive exposures across paths at each time step - **Potential Future Exposure (PFE)**: Quantile of exposure distribution (95th/97.5th percentile) at each time step - **Expected Positive Exposure (EPE)**: Time-weighted average of EE over the profile - **Peak PFE**: Maximum PFE across the time grid - **Effective EPE**: Non-decreasing transformation of EPE for regulatory purposes 6. **Compute CVA and DVA** - CVA = integral of discounted EE × counterparty default probability × LGD over the exposure horizon - DVA = integral of discounted ENE (expected negative exposure) × own default probability × LGD - Use counterparty CDS spreads for market-implied PD; use rating-based PD for accounting if required [VERIFY: CVA methodology — market-implied vs. historical PD per firm policy] - Consider bilateral CVA (BCVA = CVA − DVA) and FVA if required 7. **Stress test and validate** - Run exposure profiles under stressed market scenarios (rate shocks, spread widening, FX moves) - Test sensitivity to correlation assumptions, number of simulation paths, and time-grid density - Compare model PFE against add-on based methods (SA-CCR) as a reasonableness check - Back-test exposure predictions against realized MTMs where historical data is available ## Output - **Exposure profile report**: Time-series charts of EE, PFE (with confidence level), and peak PFE per netting set and counterparty - **CVA/DVA summary**: Unilateral CVA, DVA, and bilateral CVA per counterparty with breakdown by netting set - **Collateral impact analysis**: Comparison of uncollateralized vs. collateralized exposure profiles showing CSA benefit - **Sensitivity tables**: CVA sensitivity to credit spread moves (CS01), interest rate shifts, and correlation changes - **Wrong-way risk flags**: Identification of netting sets where exposure and counterparty default are positively correlated - **Methodology documentation**: Model choices, calibration details, simulation parameters, and all assumptions ## Quality Checks - Verify that netting-set groupings match legal documentation — incorrect netting inflates or deflates exposure - Confirm collateral parameters (thresholds, MTA, MPR) are sourced from actual CSA terms, not defaults - Check that the number of Monte Carlo paths produces stable results (re-run with doubled paths; PFE should not shift materially) - Validate that EE converges to zero as trades approach maturity - Ensure PFE at the 95th percentile exceeds EE at every time step — if not, check for simulation errors - Cross-check CVA magnitude against market benchmarks: CVA as basis points of notional should be plausible given counterparty spread level - Confirm discount curves and credit curves are as-of the same valuation date - Flag any trades with missing market data or valuation failures — do not silently drop them from the simulation - Mark all jurisdiction-dependent assumptions (netting enforceability, MPR regulatory minimums, capital framework) with [VERIFY]
Related Skills
managing-accreditation-compliance
Tracks Joint Commission/HFAP/DNV accreditation standards compliance with survey preparation. Use when preparing for accreditation, tracking standards compliance, or managing survey readiness.
security-deposit-letter-of-credit
Drafts an irrevocable standby letter of credit securing a commercial lease deposit under ISP98 and UCC Article 5. Covers documentary draw conditions, evergreen/expiry mechanics, transferability, and partial draws. Use when drafting standby LCs for lease security deposits, replacing cash deposits with LC instruments, or structuring beneficiary draw requirements.
revolving-credit-agreement
Drafts a market-standard U.S. revolving credit agreement for bilateral or syndicated facilities. Covers facility structure, SOFR/base rate interest, borrowing base, LC sublimits, collateral, guarantees, covenants, conditions precedent, events of default, and remedies. Use when drafting or negotiating revolving credit facilities, asset-based lending agreements, or syndicated loan documents.
intercreditor-lien-priority
Drafts U.S. intercreditor agreements establishing first lien vs second lien priority over shared collateral, covering standstill, enforcement control, payment waterfall/turnover, and 11 U.S.C. 510(a) subordination. Use for first lien/second lien financings, refinancing, or intercreditor negotiations requiring lien priority and remedies governance. Trigger: intercreditor, lien priority, first lien, second lien, standstill, turnover, payment waterfall, subordination agreement.
intercreditor-agreement
Drafts a first lien/second lien intercreditor agreement governing creditor priority, enforcement rights, and payment waterfalls over shared collateral. Follows LSTA and ABA market-standard conventions. Use when drafting intercreditor agreements, lien subordination agreements, first lien/second lien arrangements, or creditor priority documents in loan and financing transactions.
creditor-dissolution-notice
Drafts jurisdiction-compliant Notice to Creditors of Dissolution with claim procedures, statutory bar language, and distribution priority frameworks. Use when drafting creditor notices during corporate dissolution, winding up, or liquidation. Triggers on dissolution notice, creditor notification, claim bar date, corporate wind-up.
pricing-credit-derivatives
Structures credit derivative pricing with hazard rate calibration and default probability estimation. Use when pricing CDS, calculating credit spreads, or modeling default risk.
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.