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), assessing central clearing mandates under Dodd-Frank or EMIR and CCP default waterfalls, monitoring creditworthiness via CDS spreads or ratings, quantifying wrong-way risk, or computing EAD, SA-CCR, and CVA. For Reg T and FINRA Rule 4210 brokerage margin see margin-operations; for settlement risk, DVP, and CLS see settlement-clearing.
npx skills add https://github.com/JoelLewis/finance_skills --skill counterparty-risk
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.
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.
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.
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.
Automatically organizes invoices and receipts for tax preparation by reading messy files, extracting key information, renaming them consistently, and sorting them into logical folders. Turns hours of manual bookkeeping into minutes of automated organization.
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
This skill calculates key financial ratios and metrics from financial statement data for investment analysis
This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions
This skill retrieves upcoming earnings announcements for US stocks using the Financial Modeling Prep (FMP) API. Use this when the user requests earnings calendar data, wants to know which companies are reporting earnings in the upcoming week, or needs a weekly earnings review. The skill focuses on mid-cap and above companies (over $2B market cap) that have significant market impact, organizing the data by date and timing in a clean markdown table format. Supports multiple environments (CLI, Desktop, Web) with flexible API key management.
Crypto wallet operations via the awal CLI — sign in, check balances, send USDC/ETH/POL/SOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API calls, monetize an API, or query onchain data. Use whenever the user mentions signing in, login, authentication, wallet status, balance, address, sending money, paying someone, transferring tokens, ENS names, swapping/trading/converting tokens, funding/topping up/onramp, USDC, ETH, POL, SOL, the x402 bazaar, paid APIs, monetizing an endpoint, or querying onchain data on Base.
Access real-time and historical stock market data, forex rates, cryptocurrency prices, commodities, economic indicators, and 50+ technical indicators via the Alpha Vantage API. Use when fetching stock prices (OHLCV), company fundamentals (income statement, balance sheet, cash flow), earnings, options data, market news/sentiment, insider transactions, GDP, CPI, treasury yields, gold/silver/oil prices, Bitcoin/crypto prices, forex exchange rates, or calculating technical indicators (SMA, EMA, MACD, RSI, Bollinger Bands). Requires a free API key from alphavantage.co.
Braintree Automation: manage payment processing via Stripe-compatible tools for customers, subscriptions, payment methods, and transactions
Take joellewis/counterparty-risk from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.