joellewis/finance_skills/counterparty-risk

Claude Code and agent skill by joellewis/finance_skills

Trust tier 2
  • community
  • ext:[{"type":"plugin","description":"Custom plugin integration"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Guide counterparty credit risk measurement and management for OTC and securities trading, organized around three workflows: assessing a new counterparty, responding to a credit-deterioration event, and executing a default close-out. Use when measuring current or potential future exposure to a counterparty, setting or reviewing counterparty credit limits, evaluating ISDA Master Agreement netting and close-out mechanics, designing CSA collateral terms or uncleared margin compliance (VM/IM, SIMM),…

Install

npx vskill@latest install joellewis/finance_skills/counterparty-risk

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Counterparty Risk

Core Concepts

Workflow A: Assessing a New Counterparty
  1. Identify the legal entity and verify netting enforceability. Map the exact legal entity (not the corporate group), its jurisdiction, and entity type. Confirm close-out netting enforceability via ISDA netting opinions for that jurisdiction and entity-type combination before counting any netting benefit — where enforceability is uncertain, risk and capital must be measured gross. Apply the sovereign ceiling for counterparties in jurisdictions with material sovereign risk.
  2. Assess credit quality from three angles. External ratings are a baseline but a lagging indicator — they typically reprice after the market has. Internal scoring: for banks, focus on CET1 (strong banks hold >12%), leverage ratio (well-capitalized banks target 5%+), LCR/NSFR (minimum 100%), and NPL trend; for corporates, debt/EBITDA, interest coverage (below 2x signals stress), free cash flow, and Altman Z-score, plus qualitative factors (management, franchise, regulatory standing). Market-implied: CDS spreads react fastest — annual PD ≈ CDS_spread / (1 − recovery); a 200bp spread at 40% recovery implies roughly 3.3% annual default probability.
  3. Determine the trading channel: cleared vs. bilateral. Standardized interest rate swaps in major currencies and index CDS must clear under Dodd-Frank Title VII / EMIR (end-user hedging exemptions exist). Non-mandated products stay bilateral under the uncleared margin rules: zero VM threshold, IM threshold up to $50 million per counterparty group, and IM held segregated at a third-party custodian with no rehypothecation. Client clearing adds clearing-member risk: evaluate portability provisions and maintain a backup clearing member.
  4. Negotiate documentation. ISDA Master Agreement (the 2002 version uses the Close-out Amount methodology; many legacy relationships remain on the 1992 version's Market Quotation/Loss — know which governs each relationship), Schedule elections (governing law, Specified Entities, cross-default thresholds, additional termination events such as NAV triggers), and CSA terms: threshold, minimum transfer amount, independent amount/IM, eligible collateral and haircuts, valuation frequency (daily is standard), and dispute resolution. Link the CSA threshold to ratings so it steps down — ideally to zero — on downgrade.
  5. Set the credit limit. Tier by credit quality, with sub-limits by product and tenor (long-dated exposure is more uncertain) and a settlement limit separate from the pre-settlement limit. Apply explicit add-ons or reduced limits for wrong-way risk, where exposure and counterparty credit quality are positively correlated (general WWR: PD correlated with market factors; specific WWR: structural, e.g., a put written on the counterparty's own stock).
  6. Stand up measurement and monitoring. Compute current exposure CE = max(V, 0); PFE at 95-97.5% confidence via Monte Carlo (simulate risk-factor paths, revalue the netting set at each time step, take the percentile of max(value, 0)); EE/EPE as the capital basis; EAD = 1.4 × (RC + PFE add-on) under SA-CCR; CVA = LGD × Σ EE_i × PD_i × DF_i. Aggregate across all desks, products, and legal entities facing the counterparty — a trade missing from the counterparty risk system is unmeasured exposure. Wire pre-deal limit checks into order flow, monitor post-trade for market-driven breaches, alert at ~80% utilization, and hard-block at 100%. Review cadence: annual full review for top-tier names, semi-annual for lower tiers, monthly (or more) for the watch list.
Workflow B: Responding to a Credit-Deterioration Event

Early-warning thresholds that should put a counterparty on the watch list before any downgrade: sustained CDS widening (e.g., 50bp over 30 days, or absolute spread above 300bp), stock price decline >30% over 60 days, negative rating outlook, covenant breaches, regulatory enforcement actions, accounting restatements, or significant client withdrawals.

  1. Confirm and classify the trigger. Initiate a formal credit review: temporary setback (a bad quarter, a one-time loss) or structural deterioration (capital erosion, rising NPLs, franchise decline)? Review the latest financials, disclosures, and analyst coverage.
  2. Enforce CSA downgrade provisions. Check for ratings-linked threshold step-downs and additional termination events; call any collateral the CSA now permits (a threshold stepping to zero converts the prior threshold amount into an immediate collateral call).
  3. Reduce the credit limit. Convene the credit committee and re-tier the counterparty. If current exposure now exceeds the reduced limit, document the breach and a dated remediation plan.
  4. Reduce exposure. In rough order of cost: let maturing trades roll off without replacement; execute offsetting trades; novate trades to other counterparties (requires consent); unwind by agreement with a close-out payment. Prioritize long-dated, high-PFE trades for novation or unwind; short-dated trades maturing within weeks rarely justify early-termination costs.
  5. Restrict new trading. Hold on exposure-increasing trades; require credit-officer approval for any new trade, which must be flat or exposure-reducing.
  6. Escalate monitoring to daily — exposure, CDS, collateral disputes, news — and explicitly stress wrong-way risk by jointly shocking the exposure drivers and the counterparty's default (e.g., a European bank counterparty and euro depreciation that inflates FX-forward exposure simultaneously).
  7. Pre-position for default. Pre-calculate close-out amounts and collateral adequacy, identify replacement counterparties for critical hedges, and confirm which agreement version and close-out methodology governs.
  8. Document everything — committee decisions, limit rationale, the reduction plan, and communications — as evidence of prudent risk management for internal audit and examiners.
Workflow C: Default Close-Out Playbook

Maintain this playbook pre-built for every watch-list counterparty: pre-drafted Event of Default and termination notices, pre-identified valuation sources (dealer panels, pricing services, internal marks), pre-computed exposure and collateral figures, and a contact tree (legal, credit, trading, operations). Close-out must execute in days, not weeks — every day of delay is unhedged market risk on the terminated portfolio.

  1. Confirm the Event of Default under the governing Master Agreement (failure to pay, credit support default, cross-default above the threshold, bankruptcy, merger without assumption). Distinguish from Termination Events (illegality, force majeure, tax events, ATEs), which may permit termination of only the affected transactions.
  2. Deliver the default notice using the pre-drafted form, observing the agreement's notice mechanics and grace periods.
  3. Designate the Early Termination Date (same day or a future date, as the agreement permits).
  4. Value the terminated transactions using commercially reasonable procedures — 2002 ISDA Close-out Amount (flexible but more subjective) or 1992 Market Quotation/Loss — drawing on the pre-identified valuation sources. Document quotes and marks contemporaneously; valuation disputes are the most litigated part of close-outs.
  5. Net to a single Early Termination Amount. The single-agreement provision defeats cherry-picking by the bankruptcy estate: all transactions terminate together and net to one claim, including unpaid amounts. This is where the netting-enforceability verification from Workflow A pays off.
  6. Apply collateral held under the CSA against the net amount. Expect exposure drift over the margin period of risk (regulatory MPOR ~10 business days bilateral, ~5 days cleared) between the last margin collection and final close-out — this is the exposure IM was sized to cover.
  7. Re-hedge the terminated portfolio immediately. The close-out crystallizes the claim, but the market risk of the vanished trades is live until replaced.
  8. For cleared trades, the CCP runs default management instead. The default waterfall applies resources in order: (1) the defaulter's initial margin, (2) the defaulter's default fund contribution, (3) the CCP's own capital (skin-in-the-game), (4) non-defaulting members' default fund contributions, (5) capped supplemental assessments, (6) recovery tools (variation margin gains haircutting, partial tear-up). CCPs size resources to the Cover 1 / Cover 2 standard — the default of the largest one or two members under extreme but plausible conditions. Clients of a defaulted clearing member should trigger porting of positions and margin to a backup member within one to two days.
Core Reference

Exposure measures (one line each). Current exposure: CE = max(V, 0), where V is the net mark-to-market of the netting set. PFE: the high-percentile (95-97.5%) simulated exposure profile over time — rising with horizon, then rolling off as trades mature. EE/EPE: average exposure at a date / time-averaged EE, the basis for regulatory capital under SA-CCR and IMM. EAD (SA-CCR): 1.4 × (RC + PFE add-on). CVA: the market value of counterparty credit risk — LGD × Σ(EE_i × PD_i × DF_i), where LGD = 1 − recovery rate, EE_i is expected exposure at time i, PD_i the default probability in period i, and DF_i the discount factor — a separate Basel III capital charge that raises the cost of bilateral OTC trades. Market-implied PD can be backed out of CDS spreads as spread / (1 − recovery rate). Limit utilization is monitored as current exposure / credit limit. Wrong-way risk: standard PFE models assume exposure-default independence — add joint stress scenarios where they correlate.

Netting. Payment netting reduces settlement flows; close-out netting is the credit-risk tool. Netting benefit = gross exposure − net exposure; netting ratio = net/gross (a ratio of 0.3 means netting cut exposure 70%). CCP multilateral netting nets across all clearing members and can exceed any bilateral result.

Collateral. VM covers current exposure (daily exchange, typically title transfer and reusable); IM covers close-out-period exposure (posted at inception, segregated, no rehypothecation under the uncleared margin rules). Collateralized exposure = max(V − haircut-adjusted collateral, 0); with a CSA threshold, residual uncollateralized exposure = max(V − threshold, 0) − collateral held. ISDA SIMM (sensitivity-based, recalibrated annually) generally produces lower IM than the regulatory schedule because it recognizes hedging and diversification. Typical haircuts: cash 0%; Treasuries 0.5-4% by maturity; investment-grade corporates 5-10%; equities 15-25%; plus ~8% FX haircut for non-domestic-currency collateral. Valuation disputes are routine — transfer the undisputed amount while escalating per the CSA.

CCP margin methodology. CCPs compute IM with historical-simulation VaR or Expected Shortfall at 99%+ confidence over the MPOR (typically 5 days for cleared swaps, 2 days for listed futures), plus concentration, liquidity, and wrong-way add-ons; VM is exchanged daily or intraday. Clearing concentrates risk in the CCP itself — CCPs are designated SIFMUs with heightened supervision, and members should assess each CCP's default waterfall adequacy.

Settlement risk. Settlement risk mechanics — DVP, PvP/CLS, Herstatt risk — are owned by the settlement-clearing skill (trading-operations); the counterparty-risk implication is that settlement limits must be set separately from pre-settlement limits because the exposure is full notional, not mark-to-market.

Worked Examples

Two worked examples are in references/examples.md — load for an end-to-end scenario: (1) setting up a counterparty credit limit framework with tiering, sub-limits, and governance, (2) designing collateral management for bilateral OTC trades under the uncleared margin rules.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • pluginCustom plugin integration

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/joellewis/finance_skills/counterparty-risk/badge)](https://verified-skill.com/skills/joellewis/finance_skills/counterparty-risk)

Something wrong with this skill or its page? Tell us.