All skills
joellewis avatar

/counterparty-risk

@cf3e6ba
by joellewisjoellewis/finance_skills200 stars
37

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.

Use this Skill: https://skilld.dev/gh/joellewis/finance_skills/counterparty-risk

This session only. Nothing lands on disk.

referencesexamples.md

≈3.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Counterparty Risk — Worked Examples

Example 1: Setting Up a Counterparty Credit Limit Framework

Scenario: A mid-size institutional trading desk is establishing a counterparty credit limit framework for its OTC derivatives business. The desk trades interest rate swaps, FX forwards, and equity options with approximately 40 counterparties including major global banks, regional banks, and several large corporate end-users. The desk needs a structured framework for setting, monitoring, and enforcing counterparty credit limits.

Design Considerations:

The framework begins with counterparty tiering based on credit quality. The desk categorizes counterparties into four tiers:

  • Tier 1 (AA- or higher): Major global banks with strong capital positions and diversified revenue. Maximum aggregate limit of $500 million per counterparty. These counterparties have deep liquidity, robust ISDA documentation, and active CSAs with daily margining.
  • Tier 2 (A- to A+): Large regional banks and well-capitalized financial institutions. Maximum aggregate limit of $200 million per counterparty. These counterparties have standard ISDA documentation and CSAs, though some may have higher thresholds or less frequent margining.
  • Tier 3 (BBB- to BBB+): Investment-grade corporates and smaller financial institutions. Maximum aggregate limit of $50 million per counterparty. These counterparties may have limited ISDA documentation and may not post collateral, requiring stricter exposure limits.
  • Tier 4 (below BBB- or unrated): Sub-investment-grade or unrated counterparties. Maximum aggregate limit of $10 million per counterparty. Trading is restricted to short-dated, fully collateralized transactions where possible.

Within each tier, individual counterparty limits are set based on specific credit analysis. The credit analyst evaluates the counterparty's financial statements (focusing on capital adequacy ratios for banks, leverage and interest coverage for corporates), market indicators (CDS spreads, equity volatility), qualitative factors (management, business model, regulatory standing), and the expected trading relationship (product types, tenors, netting potential).

Limits are sub-allocated by product type and tenor. For a Tier 1 counterparty with a $500 million aggregate limit, the sub-allocation might be: interest rate swaps up to $300 million (with sub-limits of $200 million for tenors under 5 years and $100 million for tenors 5-30 years), FX forwards up to $150 million (all tenors under 1 year), and equity options up to $100 million. These sub-limits need not sum to the aggregate limit — the aggregate limit caps total exposure regardless of product mix.

Settlement limits are set separately from pre-settlement limits. A counterparty may have a pre-settlement limit of $200 million (covering mark-to-market exposure on outstanding trades) and a settlement limit of $50 million (covering the notional amount at risk during the settlement window). Settlement limits are particularly important for FX transactions where Herstatt risk is present and CLS is not used.

Analysis:

The pre-deal limit check process integrates with the trading system. Before any new trade is executed, the system calculates the incremental exposure the trade would add to the counterparty's current exposure (using a pre-deal PFE add-on based on the trade's notional, product type, and tenor) and checks whether the resulting total would exceed the limit. If the limit would be breached, the trade is blocked and routed to the credit officer for review.

Limit utilization is monitored continuously. The exposure management system recalculates counterparty exposure as market prices change, not just when new trades are booked. A counterparty whose exposure was at 60% of limit in the morning could reach 90% by afternoon if market movements cause the portfolio's mark-to-market value to increase significantly. The system generates tiered alerts: amber at 80% utilization, red at 95%, and hard block at 100%.

The credit committee reviews the entire limit framework quarterly, with ad hoc reviews triggered by material credit events. Annual reviews include a comprehensive reassessment of each counterparty's creditworthiness, a review of limit utilization patterns (counterparties whose limits are consistently underutilized may have limits reduced to free up aggregate capacity), and stress testing of the limit framework under adverse scenarios (what would happen to exposure and limit utilization if interest rates moved 200bp, FX rates moved 10%, or equity markets dropped 30%).

Governance and reporting are integral to the framework. The credit risk management function produces a daily counterparty exposure report showing each counterparty's current exposure, PFE, collateral held, net exposure, limit, and utilization percentage. A weekly summary report aggregates exposure by tier, product type, and geography, highlighting concentration risks (e.g., if 60% of total exposure is concentrated in three Tier 1 banks, the firm has significant concentration risk even if each counterparty is individually well-rated). A monthly report to senior management and the risk committee includes trend analysis, limit breach history, watch list updates, and any material changes to the credit environment. These reports form part of the firm's risk governance framework and are subject to internal audit review.

The framework should also address the treatment of wrong-way risk within the limit structure. For counterparties where the desk has identified potential wrong-way risk, the credit limit should be set more conservatively, and the PFE calculation should incorporate stress scenarios that capture the correlation between exposure and counterparty credit quality. For example, if the desk holds commodity derivatives with an energy company, and the energy company's creditworthiness deteriorates when commodity prices fall (which is precisely when the derivatives may have high positive value to the desk), the standard PFE model may understate the true risk. Explicit wrong-way risk add-ons or dedicated wrong-way risk limits can address this gap.

Example 2: Designing Collateral Management for Bilateral OTC Trades

Scenario: An asset management firm is establishing bilateral OTC derivative trading capability for the first time. The firm will trade interest rate swaps and FX options to hedge portfolio exposures. The firm needs to design collateral management processes that comply with uncleared margin rules and efficiently manage collateral across multiple counterparty relationships.

Design Considerations:

The firm must first determine its regulatory obligations. Under the BCBS-IOSCO uncleared margin rules (implemented in the US via CFTC and prudential regulator rules, and in the EU via EMIR margin RTS), the firm must exchange both initial margin (IM) and variation margin (VM) for uncleared OTC derivatives if its aggregate average notional amount (AANA) exceeds the applicable threshold. Variation margin requirements apply to virtually all financial counterparties. Initial margin requirements apply in phased implementation based on AANA thresholds, with the final phase covering entities with AANA above $8 billion (US) or EUR 8 billion (EU).

The CSA negotiation with each counterparty must address several critical terms:

Threshold and minimum transfer amount: Under the uncleared margin rules, the VM threshold must be zero (no uncollateralized exposure is permitted for entities in scope). The MTA can be set up to $500,000 for VM. For IM, the threshold can be up to $50 million per counterparty group. The firm should negotiate these terms within regulatory constraints, balancing credit protection against operational burden.

Eligible collateral and haircuts: The firm specifies which collateral types it will accept and post. A typical schedule includes cash in major currencies (USD, EUR, GBP, JPY) with zero haircut, US Treasuries and equivalent sovereign bonds with haircuts of 0.5% to 4% depending on maturity, and investment-grade corporate bonds with haircuts of 5% to 10%. The firm should establish whether it will accept equities (higher haircut, more volatile) and set concentration limits (no more than a specified percentage of collateral in any single issuer for non-sovereign securities).

Segregation requirements: Under the uncleared margin rules, IM must be held in a segregated account at a third-party custodian. The IM cannot be rehypothecated, commingled with the receiving party's assets, or used for any purpose other than satisfying the margin obligation. VM does not have the same segregation requirement and can be held directly by the receiving party. The firm must establish custodial relationships with one or more third-party custodians (such as BNY Mellon, State Street, or JPMorgan as custody banks) to hold segregated IM.

The daily margining process follows a defined workflow. Each business day: the firm's risk system calculates the current mark-to-market value of the portfolio with each counterparty; the system calculates the required VM call (the change in net exposure since the last margin exchange) and the required IM (using either the ISDA SIMM model or a schedule-based approach); the collateral management team issues margin calls to counterparties where the firm is owed additional collateral, and responds to margin calls from counterparties where the firm owes collateral; collateral is transferred by the agreed settlement deadline (typically T+1 for cash, T+2 for securities); and the firm's records are updated to reflect the new collateral balances.

Analysis:

Dispute resolution is a critical operational consideration. If the firm and a counterparty disagree on the portfolio valuation (and therefore the margin call amount), the CSA dispute resolution provisions apply. The standard approach is: the parties exchange their respective valuations; if the difference exceeds a tolerance (typically $1-5 million), the parties engage in good faith negotiation; the undisputed amount is transferred while the dispute is resolved; escalation to senior management or a third-party valuation agent if the dispute is not resolved within a defined timeframe. The firm should track dispute frequency and magnitude by counterparty — persistent disputes may indicate valuation model differences that need to be reconciled.

ISDA SIMM (Standard Initial Margin Model) is the industry-standard model for calculating IM on uncleared derivatives. SIMM uses a sensitivity-based approach: the firm calculates the sensitivities of each trade to defined risk factors (delta, vega, curvature), and SIMM applies calibrated risk weights and correlations to compute the IM requirement. SIMM is recalibrated annually by ISDA using recent market data. Using SIMM rather than the regulatory schedule-based approach typically results in lower IM requirements because SIMM recognizes portfolio diversification and hedging benefits.

Collateral optimization is an ongoing operational challenge. The firm holds a pool of eligible collateral assets and must decide which assets to post to each counterparty. Cash is the cheapest to post (no haircut, immediate settlement) but has the highest opportunity cost (the firm forgoes the return on cash). Government securities are nearly as efficient (low haircut) but require settlement infrastructure and incur a small haircut cost. The firm should implement a collateral allocation algorithm that minimizes the total cost of collateral across all counterparty relationships, considering haircuts, opportunity costs, settlement timing, and any counterparty-specific collateral preferences.

The firm should also prepare for stressed collateral scenarios. During market stress, the value of non-cash collateral may decline (increasing the amount of collateral needed to meet margin requirements), margin calls may increase sharply (as portfolio MTM values swing), and counterparties may reject previously acceptable collateral types. The firm should maintain a buffer of high-quality liquid assets (cash and short-dated government securities) above minimum margin requirements to absorb margin call increases without needing to liquidate portfolio positions.

Operational infrastructure is a significant consideration for a firm establishing bilateral OTC capability for the first time. The firm needs: a collateral management system that tracks collateral balances by counterparty, calculates margin calls, and manages substitution requests; connectivity to custodian banks for collateral transfers (SWIFT messaging, custodian portals); legal documentation (CSAs negotiated and executed with each counterparty); accounting processes for recording collateral received and posted, including treatment of interest on cash collateral (typically paid at the federal funds rate or a negotiated rate); and trained personnel to manage the daily margin call process, respond to disputes, and coordinate collateral movements across counterparties and custodians. The operational cost of collateral management is non-trivial — firms should budget for systems, custody fees, and dedicated operations staff before entering bilateral OTC markets.

Source: SKILL.md on GitHub

1 alert16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The counterparty-risk skill provides guidance for managing counterparty credit risk but is classified as low risk because it instructs the agent to analyze external data sources such as credit reports and legal documents, creating a surface for indirect prompt injection.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at cf3e6ba. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 3 months ago

README badge

README badge for joellewis/finance_skills/counterparty-risk