Credit Default Swap (CDS) Spread
Calculates the CDS-equivalent spreads of US corporate credit: the spread a protection buyer would pay each year to insure against a default of an issuer with that credit, by maturity or by rating.
These are the par spreads of credit default swaps on the survival curves the ICE BofA option-adjusted spreads imply (see get_survival_curve), which turns the spreads of corporate bonds into CDS spreads.
The swaps follow the ISDA CDS Standard Model: the premium is paid quarterly on an ACT/360 basis, the premium accrued since the last payment is paid on default, and the protection pays (1 - R) of the notional at the time of default. The par spread is the premium at which both legs are worth the same:
The formula is as follows:
\[\text{RPV01} = \sum(\tau_{k} P(t_{k}) Q(t_{k})) + \frac{365}{360} \cdot \sum(\text{∫\_t\_\{k-1\}}^{t}_{k} (t - t_{k-1}) P(t) (- \operatorname{dQ}(t)))\] \[\text{Protection Leg} = (1 - R) \cdot \text{∫}_{0}^{T} P(t) (- \operatorname{dQ}(t))\] \[\text{CDS Spread} = \frac{\text{Protection Leg}}{\text{RPV01}}\]where \(\tau_{k}\) is the ACT/360 accrual of the k-th quarter, P(t) = (1 + r(t))^(-t) the discount factor of the annually compounded US Treasury zero-coupon curve, Q(t) the survival probability of the piecewise flat hazard rate curve and R the recovery rate. The integrals are exact on the grid of the curve, hazard rate and premium dates, as in the standard model. The spreads are discounted on the Treasury curve, the curve the option-adjusted spreads are measured over, rather than the swap curve dealers use, and the protection starts today without the standard model’s step-in day.
The gap between a CDS-equivalent spread and the bond spread at the same maturity is a model basis: a bond loses its price less the recovery at default while a CDS pays the face value less the recovery, and the CDS premium stops at default. Traded CDS spreads also differ by the liquidity of each market, the cheapest-to-deliver option and the funding of the bonds.
For a single name with spreads or hazard rates of your own, use cds_model.get_credit_default_swap and cds_model.get_cds_implied_hazard_rates.
Also known as: CDS spread, CDS-equivalent spread, credit default swap premium, bond-implied CDS spread.
Example
Install the Finance Toolkit with pip install financetoolkit -U, then call get_credit_default_swap_spread:
from financetoolkit import FixedIncome
fixedincome = FixedIncome(end_date="2026-11-05", fred_api_key="your_fred_api_key")
fixedincome.get_credit_default_swap_spread()
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
What credit default swap spreads for 1 to 10 years did corporate bond spreads imply on 5 November 2026?
Which returns:
| Maturity | Corporate |
|---|---|
| 1Y | 0.0061 |
| 3Y | 0.0075 |
| 5Y | 0.0091 |
| 7Y | 0.0104 |
| 10Y | 0.0110 |
5 rows
Parameters
get_credit_default_swap_spread accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
maturity | bool | Whether to use the survival curve of the maturity buckets of the US Corporate Index, or one per rating. Defaults to True (by maturity). | False |
ratings | list[str] | str | None | The ratings: “AAA”, “AA”, “A”, “BBB”, “BB”, “B” or “CCC”, as a list or a comma-separated string; giving them returns the spreads by rating. Defaults to None, every rating when maturity is False. | None, every rating when maturity is False |
recovery_rate | float | The share of the face value recovered on default, for the bonds and the swaps alike. Defaults to 0.4, the ISDA standard for senior unsecured debt. | |
tenors | list[float] | str | None | The tenors of the swaps in years or as labels such as “6M”, as a list or a comma-separated string. Defaults to None, which uses 1, 3, 5, 7 and 10 years. | None, which uses 1, 3, 5, 7 and 10 years |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the FixedIncome rounding. | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper O’Kane, D. (2008). “Modelling Single-name and Multi-name Credit Derivatives.” Wiley, ch. 5 to 7.
- Paper Markit (2009). “ISDA CDS Standard Model.”
- Paper Hull, J.C. and White, A. (2000). “Valuing Credit Default Swaps I: No Counterparty Default Risk.” The Journal of Derivatives, 8(1), 29-40.
- Library Referenced against QuantLib’s CreditDefaultSwap
- Library Referenced against QuantLib’s IsdaCdsEngine
- Library Shares similar logic as FinancePy’s CDS