cds-mechanics-and-upfrontlisted
Install: claude install-skill howard-lynn-ye/fin-skills
# CDS mechanics and upfront
**A single-name CDS trades on a fixed coupon with an upfront payment, so the quoted "spread" is
a quoting device, not a cash flow.** Two steps convert one to the other and both have a trap in
them: `upfront = (quoted spread − coupon) × RPV01`, where **RPV01 is the risky annuity in years,
not the tenor** — and the **tenor is not the tenor either**, because "5Y" is a 20 June or
20 December date somewhere between 4.75 and 5.25 years away.
Measured figures below are printed by `scripts/cds.py` (runs in **1.0 s**; scipy plus pure
python dates, QuantLib optional). ✅ Measured means this file produced it on 2026-09-09 with
QuantLib 1.43, scipy 1.13.0, Python 3.11.3. Conventions are ✅ source-verified against ISDA's own
documents at cdsmodel.com, read 2026-09-09.
> **The rule:** `upfront = (quoted spread − coupon) × RPV01`, and **RPV01 is the risky annuity**.
> Never multiply by the tenor, and never trust the label — read the maturity **date**.
## 1. ✅ ISDA's own worked example, reproduced exactly
✅ **Source:** ISDA, *Standard CDS Examples* (April 2009) and *Standard North American Corporate
CDS Contract Specification* (version 4 March 2009), both published at cdsmodel.com. A 1-year
$36mm 100 bp standard CDS traded in Feb-09 maturing 20 Mar 10. ✅ `isda_worked_example()`
rebuilds the schedule from the conventions and matches every published figure:
| # | accrual start | accrual end | days (ISDA) | payment (ISDA) | payment date |
|---|---|---|---|---|---