counterparty-risk

counterparty-risk is a skill for Claude Code from JoelLewis/finance_skills. It costs 172 tokens per session (3,521 once invoked), scanned A, original, MIT.

A guide to measuring and managing credit risk between trading parties, called counterparties, in over-the-counter and securities transactions. It covers assessing a new counterparty, responding to financial deterioration, and handling a default close-out.

In plain words
What is it for?
Use it to assess a counterparty, check netting and jurisdiction issues, estimate current or future exposure, monitor signs of credit stress, and plan a default close-out.
Why use it?
It structures a risk review around legal enforceability, credit quality, exposure, and default actions. This helps prevent risk estimates from relying only on a company group name or a single credit measure.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the trading-operations plugin — 8 skills shipped together

not rated 184repo +5 1mo ago A scan Socket: passSnyk: passSkillSpector: pass 172 tokens original MIT

Good fit Use it to assess a counterparty, check netting and jurisdiction issues, estimate current or future exposure, monitor signs of credit stress, and plan a default close-out.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/joellewis/finance_skills/counterparty-risk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add JoelLewis/finance_skills --skill counterparty-risk
Clone the repo
git clone --depth 1 https://github.com/JoelLewis/finance_skills

Made for: Claude Code.

Or install trading-operations, the plugin that ships this one along with the rest of its 8 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for counterparty-risk

README.md
[![agentmods](https://agentmods.dev/badge/skills/joellewis/finance_skills/counterparty-risk/github.svg)](https://agentmods.dev/skills/joellewis/finance_skills/counterparty-risk)
Your own site
<a href="https://agentmods.dev/skills/joellewis/finance_skills/counterparty-risk"><img src="https://agentmods.dev/badge/skills/joellewis/finance_skills/counterparty-risk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for counterparty-risk

Your own site · 80×15
<a href="https://agentmods.dev/skills/joellewis/finance_skills/counterparty-risk"><img src="https://agentmods.dev/badge/skills/joellewis/finance_skills/counterparty-risk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 172 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,521 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 18 Mar 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00172 $0.03521
Opus 5 $0.00086 $0.01760
Sonnet 5 $0.00034 $0.00704
Haiku 4.5 $0.00017 $0.00352

Measured 12d ago against content hash 4c726c6d0feb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

counterparty-risk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/trading-operations/skills/counterparty-risk/SKILL.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Read the full file on GitHub · 83 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 83 lines · 172 tokens per session scan A 4c726c6d0feb

Subscribe to this mod's changes

counterparty-risk is a skill published in the GitHub repository JoelLewis/finance_skills (184 stars, last pushed 1mo ago), licensed MIT. It adds 172 tokens to every session and 3,521 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

stock-liquidity

Analyze stock liquidity using bid-ask spreads, volume profiles, order book depth, market impact estimates, and turnover ratios via Yahoo Finance data. Use this skill whenever the user asks about liquidity, trading costs, bid-ask spread, market depth, volume analysis, slippage, market impact, turnover ratio, or how…

himself65/finance-skills · 188 tokens

fintel-data

Query Fintel (fintel.io) institutional market intelligence via the REST API at https://api.fintel.io/v1 with FINTELAPIKEY (X-API-KEY header), or the official MCP server at https://mcp.fintel.io/mcp. Read-only data: short interest, borrow rate/fee and shares available to borrow, daily short volume, fails-to-deliver…

himself65/finance-skills · 234 tokens

estimate-analysis

Deep-dive into analyst estimates and revision trends for any stock using Yahoo Finance data. Use when the user wants to understand analyst estimate direction, how EPS or revenue forecasts changed over time, compare estimate distributions, or analyze growth projections across periods. Triggers: "estimate analysis for…

himself65/finance-skills · 195 tokens

earnings-preview

Generate a pre-earnings briefing for any stock using Yahoo Finance data. Use this skill whenever the user wants to prepare for an upcoming earnings report, understand what analysts expect, review a company's beat/miss track record, or get a quick overview before an earnings call. Triggers include: "earnings preview…

himself65/finance-skills · 221 tokens

earnings-recap

Generate a post-earnings analysis for any stock using Yahoo Finance data. Use when the user wants to review what happened after earnings, understand beat/miss results, see stock reaction, or get an earnings recap. Triggers: "AAPL earnings recap", "how did TSLA earnings go", "MSFT earnings results", "did NVDA beat…

himself65/finance-skills · 186 tokens

twitter-reader

Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…

himself65/finance-skills · 161 tokens