ThirdMomentQuantX

Chapter 18

Credit default swaps and survival curves

Contents
  1. 18.1 Notation
  2. 18.2 The standard contract
  3. 18.3 Time convention
  4. 18.4 The premium leg
  5. 18.5 The protection leg
  6. 18.6 Integrals on piecewise-constant rates
  7. 18.7 Values
  8. 18.8 Quote styles
  9. 18.9 Bootstrapping a survival curve
  10. 18.10 Sensitivities
  11. 18.11 Credit curves in a market
  12. 18.12 Edge cases and limits
  13. 18.13 Worked example
  14. References

This chapter defines how the library values a standard credit default swap (CDS), how it bootstraps a survival curve from CDS quotes, and how the sensitivities of any value to those quotes and to the recovery rate are computed. The survival curve is the one of Section 16.7, so a CVA can be built on default probabilities implied from the market instead of a spread typed by hand.

The model is the standard CDS model as the market uses it: premiums and protection valued with a hazard rate and a forward rate that are constant between known times, so that every integral has a closed form. It is written from its published description (International Swaps et al., 2009; O'Kane, 2008) and from first principles, not from any existing implementation. The contract terms are those of the 2009 standardisation (International Swaps and Derivatives Association, 2009) and the 2014 credit definitions (International Swaps and Derivatives Association, 2014).

18.1 Notation

Symbol Meaning
\(d_0\) The valuation date
\(\tau(d)\) The curve time of date \(d\): \((d - d_0)/365\), a date standing for the end of that day (Section 7.2)
\(d_T\) The trade date
\(d_{SI}\) The step-in date: one calendar day after the later of \(d_0\) and \(d_T\)
\(d_{CS}\) The cash settlement date: three business days after the later of \(d_0\) and \(d_T\)
\(M\) The maturity date, unadjusted: protection ends at the end of this day
\(A_i\), \(E_i\) The first day of the accrual of premium period \(i\), and the day after its last day
\(D_i\) The payment date of period \(i\)
\(\alpha_i\) The accrual fraction of period \(i\), Act/360 from \(A_i\) to \(E_i\)
\(a_i\), \(e_i\) The curve times \(\tau(A_i - 1)\) and \(\tau(E_i - 1)\): period \(i\) accrues over \((a_i, e_i]\)
\(s\), \(T\) The curve times protection runs between: \(s = \max(0, \tau(d_{SI} - 1))\) and \(T = \tau(M)\)
\(c\) The coupon, a decimal per year
\(N\) The signed notional: positive sells protection, negative buys it
\(R\) The recovery rate, a fraction of the notional
\(\lambda(u)\) The hazard rate at curve time \(u\), constant between the nodes of the survival curve
\(S(u)\) The survival probability to \(u\): \(\exp(-\int_0^u \lambda)\) (Equation (16.16))
\(P(u)\) The discount factor to \(u\) on the discount curve of the CDS currency
\(A\) The risky annuity: the value of a premium of 1 per year, paid while the entity survives
\(\Pi\) The protection leg: the value of 1 paid at default, if default happens between \(s\) and \(T\)
\(\bar a\) The accrued fraction: Act/360 from the start of the period holding \(d_{SI}\) to \(d_{SI}\)
\(P_s\) The discount factor to the cash settlement date, \(P(\tau(d_{CS}))\)
\(q_k\) The quote of the \(k\)-th tenor of a credit curve
\(t_k\) The curve time of the \(k\)-th node: the maturity of the \(k\)-th tenor

18.2 The standard contract

A standard CDS pays a fixed coupon, 100 or 500 basis points for most names in USD, on the 20th of March, June, September and December, the roll dates, adjusted to the next business day (Following). The premiums use Act/360. The protection buyer pays the coupon; the seller pays \((1-R)\) times the notional if the reference entity defaults.

Maturity. A standard maturity is a whole number of years or months after an anchor roll date, and the anchor moves twice a year (the semi-annual roll in force since December 2015). For a trade on date \(d\) in year \(y\):

\[M = \begin{cases} \text{20 Dec } (y-1) + \text{tenor} & d < \text{20 Mar } y,\\ \text{20 Jun } y + \text{tenor} & \text{20 Mar } y \le d < \text{20 Sep } y,\\ \text{20 Dec } y + \text{tenor} & d \ge \text{20 Sep } y. \end{cases}\]
(18.1)

In words: from 20 March to 19 September a 5Y matures on the 20 June five years later, otherwise on the 20 December. A 5Y traded on 16 October 2026 matures on 20 December 2031. The maturity is not adjusted for holidays. A convention can instead roll every quarter to the next roll date, the rule before 2015.

Premium periods. The first period starts on the roll date on or before the step-in date, adjusted: the buyer pays a full first coupon, and the seller pays back the part accrued before step-in at cash settlement (Section 18.7). The other unadjusted dates step back from the maturity by whole periods, so a maturity off the roll cycle leaves a short first period. Each period ends on the next adjusted date, except the last, which ends on the day after the maturity: the maturity date itself accrues. Payments fall on the adjusted dates, the last on the adjusted maturity.

Lags. The step-in date \(d_{SI}\) is one calendar day after the trade date, when protection starts; cash changes hands on \(d_{CS}\), three business days after the trade date. For a valuation after the trade date the lags count from the valuation date. The shipped USD contract USD-CDS uses the New York Fed calendar.

18.3 Time convention

A date stands for the end of that day. Protection starting on the step-in date covers a default during that day, so it runs from the end of the day before:

\[s = \max\bigl(0, \tau(d_{SI} - 1)\bigr), \qquad T = \tau(M).\]
(18.2)

For a new trade \(d_{SI} - 1 = d_0\), so \(s = 0\). In the same way, period \(i\) accrues over \((a_i, e_i]\) with \(a_i = \tau(A_i - 1)\) and \(e_i = \tau(E_i - 1)\): from the end of the day before its first day to the end of its last day. Periods paid on or before the valuation date are left out.

18.4 The premium leg

The coupon of period \(i\) is paid on \(D_i\) if the entity survives to the end of the accrual:

\[A^{\mathrm{surv}} = \sum_{i \,:\, D_i > d_0} \alpha_i\, S\bigl(\max(e_i, 0)\bigr)\, P\bigl(\tau(D_i)\bigr).\]
(18.3)

If the entity defaults during a period, the premium accrued to the default time is paid at default. The accrual runs at the rate \(\alpha_i/(e_i - a_i)\) per unit of curve time, over the part of the period that is protected:

\[A^{\mathrm{def}} = \sum_{i \,:\, D_i > d_0} \frac{\alpha_i}{e_i - a_i} \int_{\max(a_i, s)}^{e_i} (u - a_i)\, \lambda(u)\, S(u)\, P(u)\, du.\]
(18.4)

The risky annuity is \(A = A^{\mathrm{surv}} + A^{\mathrm{def}}\): the value of a coupon of 1 per year, accrual on default included.

18.5 The protection leg

The seller pays at the default time \(u\), with density \(\lambda(u) S(u)\), if it falls in the protection window:

\[\Pi = \int_s^T \lambda(u)\, S(u)\, P(u)\, du.\]
(18.5)

The payment is \((1 - R)\) times the notional; \(\Pi\) is the value per unit of loss.

18.6 Integrals on piecewise-constant rates

The integrals are cut on a grid holding \(s\), \(T\), the nodes of the survival curve, the nodes of the discount curve and the accrual boundaries \(a_i\) and \(e_i\) inside \((s, T)\). On each interval \([u, v]\) of the grid the hazard rate \(\lambda\) is constant, and so is the forward rate when the discount curve is log-linear in discount factors with its nodes on the grid, which is the library's default style (Section 7.2): the integrals below are then exact. With \(\Delta = v - u\) and

\[x = \lambda\Delta + \ln\frac{P(u)}{P(v)},\]

the integrals over the interval are

\[\int_u^v \lambda S P\, dw = \lambda\Delta\, S(u) P(u)\, g_1(x), \qquad \int_u^v (w - a)\, \lambda S P\, dw = \lambda\Delta\, S(u) P(u)\, \bigl[(u - a)\, g_1(x) + \Delta\, g_2(x)\bigr],\]
(18.6)

where \(\lambda\Delta = \ln S(u) - \ln S(v)\) and

\[g_1(x) = \frac{1 - e^{-x}}{x}, \qquad g_2(x) = \frac{1 - e^{-x}(1 + x)}{x^2}, \qquad g_1(0) = 1, \quad g_2(0) = \tfrac12.\]
(18.7)

In words: \(g_1\) is the average of \(e^{-x\theta}\) over \(\theta \in [0, 1]\), and \(g_2\) the average of \(\theta e^{-x\theta}\). Both closed forms lose digits to cancellation as \(x\) goes to zero, which happens for a short interval or a zero hazard rate and rate. For \(|x| < 0.1\) the series \(g_1(x) = \sum_{n=0}^{10} (-x)^n/(n+1)!\) and \(g_2(x) = \sum_{n=0}^{10} (n+1)(-x)^n/(n+2)!\) replace them: the first omitted terms are below \(10^{-19}\), and above \(0.1\) the closed forms lose fewer than three digits. The switch reads the value of \(x\), the one place where this code reads a value of the number type; the two forms agree to about \(10^{-16}\), so values and derivatives stay continuous.

18.7 Values

The value to the holder, accrued premium included, is

\[V = N\,\bigl(c\,A - (1 - R)\,\Pi\bigr).\]
(18.8)

A seller (\(N > 0\)) receives the premiums and pays the loss; a buyer's value is the same with its sign changed (the sign convention of Chapter 8).

Accrued premium and clean value. Because the buyer pays a full first coupon, the seller pays back the premium accrued from the start of the current period to the step-in date, \(N c \bar a\), on the cash settlement date. The clean value leaves that amount out:

\[V^{\mathrm{clean}} = N\,\bigl(c\,(A - \bar a P_s) - (1 - R)\,\Pi\bigr).\]
(18.9)

Par spread. The coupon at which the clean value is zero:

\[s^{\mathrm{par}} = \frac{(1 - R)\,\Pi}{A - \bar a P_s}.\]
(18.10)

Points upfront and cash settlement. The points upfront \(U\) are the clean amount the buyer pays on the cash settlement date, as a fraction of the notional; the cash settlement amount \(C\) is what the holder receives on that date for entering the CDS at its model value:

\[U = -\frac{V^{\mathrm{clean}}}{N P_s} = \frac{(1 - R)\,\Pi - c\,(A - \bar a P_s)}{P_s}, \qquad C = -\frac{V}{P_s} = N\,(U - c\,\bar a).\]
(18.11)

\(U\) is positive when the coupon is below the par spread. A seller receives the upfront less the accrued premium it pays back.

18.8 Quote styles

A credit curve (CdsCurveConvention, for example KSA-USD-SNRFOR-CR14-CDS) names the reference entity, the currency, the seniority, the documentation clause, the recovery rate, the standard coupon, the tenors quoted and the quote style. Its quotes are named <curve> <tenor> | <field>, for example KSA-USD-SNRFOR-CR14-CDS 5Y | Mid, as decimals. Three styles exist:

  • Par spread: the quote is the par spread of a CDS of that tenor.
  • Upfront: the quote is the points upfront \(U\) at the standard coupon.
  • Conventional spread (the market's quoted spread): the quote is turned into an upfront at the standard coupon \(c\) on a flat curve. Let \(\lambda_q\) be the flat hazard rate at which the par spread of the CDS is the quote \(q\); the quote stands for
\[U_q = U\bigl(c;\, \lambda \equiv \lambda_q\bigr) \quad\text{where}\quad s^{\mathrm{par}}(\lambda \equiv \lambda_q) = q.\]
(18.12)

The flat curve exists only to convert the quote; the bootstrap then reprices the upfronts \(U_q\) on the real curve, as a CDS quoted this way trades.

18.9 Bootstrapping a survival curve

One standard CDS per tenor is traded on the valuation date, with unit notional, and the survival curve has one node at each maturity \(t_k\): the hazard rate is \(\lambda_k\) on \((t_{k-1}, t_k]\) and the last one continues after the last node. Instrument \(k\) reprices its quote when

\[F_k = c_k\,(A_k - \bar a P_s) - (1 - R)\,\Pi_k + U_k P_s = 0,\]
(18.13)

the seller's clean value plus the upfront it receives, where \((c_k, U_k) = (q_k, 0)\) for a par spread, \((c, q_k)\) for an upfront and \((c, U_{q_k})\) for a conventional spread. \(F_k\) depends on \(\lambda_1, \dots, \lambda_k\) only, so the nodes are solved in turn: each by Brent's method on \([0, \bar\lambda]\), the earlier rates fixed and the later nodes given the trial rate. The upper end \(\bar\lambda\) starts at 1 and is widened ten times at a time up to 1,000 per year. A quote that needs a negative hazard rate is an error, never clipped: it means the quotes allow an arbitrage, or the recovery rate does not fit them.

18.10 Sensitivities

The bootstrap defines the hazard rates \(\lambda\) as functions of the quotes \(q\) and the recovery rate \(R\) through \(F(\lambda, q, R) = 0\). By the implicit function theorem, with the Jacobian \(J = \partial F/\partial\lambda\) evaluated exactly at the solution by one adjoint sweep per instrument (lower triangular),

\[\frac{\partial \lambda}{\partial q} = -J^{-1}\,\frac{\partial F}{\partial q},\]
(18.14)

where \(\partial F_k/\partial q_k = A_k - \bar a P_s\) for a par spread, \(P_s\) for an upfront and \(P_s\, dU_{q}/dq\) for a conventional spread, the last through the flat rate: \(dU_q/dq = (\partial U/\partial\lambda)\, (d\lambda_q/dq)\) with \(d\lambda_q/dq = -(A - \bar a P_s)/(\partial G/\partial\lambda)\) and \(G = q\,(A - \bar a P_s) - (1 - R)\Pi\) on the flat curve. The quotes being held, the recovery rate moves the curve too:

\[\frac{\partial \lambda}{\partial R} = -J^{-1}\,\frac{\partial F}{\partial R}, \qquad \frac{dV}{dR} = \frac{\partial V}{\partial R} + \sum_i \frac{\partial V}{\partial \lambda_i}\,\frac{\partial \lambda_i}{\partial R},\]
(18.15)

with \(\partial F_k/\partial R = \Pi_k\) plus, for a conventional spread, \(P_s\,dU_q/dR\) through the flat rate. A value \(V\) computed on the curve gets its sensitivities to the hazard rates by one adjoint sweep, and

\[\frac{dV}{dq_j} = \sum_i \frac{\partial V}{\partial \lambda_i}\,\frac{\partial \lambda_i}{\partial q_j}, \qquad \mathrm{CS01}_j = 10^{-4}\,\frac{dV}{dq_j}, \qquad \mathrm{CS01} = \sum_j \mathrm{CS01}_j.\]
(18.16)

In words: the CS01 of quote \(j\) is the change in value when that quote rises by one basis point and the curve is bootstrapped again; the parallel CS01, all quotes up by one basis point, is their sum, exact to first order. These are reported like curve deltas (QuoteRisk rows named after the instruments, Section 7.4). The discount curve is held fixed; its own risk is the curve delta of Section 7.4.

18.11 Credit curves in a market

A market definition (Section 15.2) lists its credit curves under CreditCurves; its requirements then name every quote of every tenor of each curve on the market's field. The builder bootstraps each curve on the default discount curve of its currency, after the curve group, and the market context serves the survival curve under the credit curve's identifier (SurvivalCurve(id)). A full build throws when a credit quote is missing; a partial build leaves the curve out and names it (credit curve <id>), like a volatility grid. The pricer reads the CDS's discount and survival curves from the market.

The shipped defaults hold the standard USD contract USD-CDS and two credit curves of test data only, DUMMY-SOVEREIGN-USD-SNRFOR-CR14-CDS and DUMMY-BANK-USD-SNRFOR-CR14-CDS (40% recovery, 100 basis point coupon, conventional spreads, 6M to 10Y), in a market definition of their own, DUMMY-CREDIT, so that the real market does not depend on them. Their quotes are made up: two years of them ship with the CSV provider (Samples/dummy-cds-quotes.csv) for the tests. The front ends never build DUMMY-CREDIT; credit curves join the one market once real CDS quotes are stored.

18.12 Edge cases and limits

  • Zero hazard rate. The protection leg and the accrual on default vanish, and the CDS is a strip of coupons; the series of Equation (18.7) keep the integrals exact.
  • Seasoned trades. Periods paid on or before the valuation date are left out, and the step-in and settlement dates count from the valuation date. After the maturity the CDS has no value.
  • Discount curve. The standard model is specified with its own ISDA rate curve, flat-forward between nodes; the library discounts on the market's discount curve of the currency (for USD, the SOFR OIS curve), whose default style is log-linear in discount factors, that is flat-forward too. The difference between the two curves is the main expected difference from a standard-model calculator.
  • Recovery. One recovery rate per credit curve, used both by the quotes and by pricing; a recovery rate per entity and seniority, and a recovery swap market, come later.
  • No proxy curves yet. Counterparties without CDS quotes need a proxy curve (by rating, sector and region); this comes later.

18.13 Worked example

Valuation on Friday 16 October 2026, a flat continuously compounded discount rate of 4%, and the dummy bank's conventional spreads at a 100 basis point coupon and 40% recovery:

Tenor 6M 1Y 2Y 3Y 4Y 5Y 7Y 10Y
Spread (bp) 50 58 70 82 92 100 118 135
Maturity 2027-06-20 2027-12-20 2028-12-20 2029-12-20 2030-12-20 2031-12-20 2033-12-20 2036-12-20
Hazard rate (%) 0.8403 1.1628 1.4289 1.8603 2.1499 2.3350 2.9526 3.2059

The survival probability to 20 December 2031 is 0.914575. A buyer of 5Y protection on 10,000,000 at the 100 basis point coupon accrues from Monday 21 September 2026 (the 20th is a Sunday): its legs are \(A = 4.628145\), \(\Pi = 0.075933\) and \(P_s = 0.999452\) for settlement on 21 October, with \(\bar a = 26/360\). The 5Y quote equals the coupon, so the points upfront are zero; the value is \(V = -7{,}218.27\), the accrued premium discounted, and the buyer receives \(C = 7{,}222.22\), the 26 days of premium, on the settlement date. Its CS01 is 4,526.88 to the 5Y quote and zero to every other quote, because the 5Y CDS is the instrument that fixes the curve to its maturity; its recovery sensitivity is zero for the same reason. The test SurvivalCurveBootstrapperTests.Calibrate_WorkedExample_MatchesMethodology pins these numbers.

References

  • International Swaps and Derivatives Association (2009). 2009 ISDA Credit Derivatives Determinations Committees, Auction Settlement and Restructuring Supplement ("Big Bang" Protocol). ISDA publication.
  • International Swaps and Derivatives Association (2014). 2014 ISDA Credit Derivatives Definitions. ISDA publication.
  • International Swaps, Derivatives Association and Markit (2009). The ISDA CDS Standard Model: documentation of the standard upfront and spread conventions. https://www.cdsmodel.com
  • Dominic O'Kane (2008). Modelling Single-name and Multi-name Credit Derivatives. Wiley.

Reconnecting Connection paused Could not reconnect Could not resume Session expired

The connection to the server was lost. Trying to restore it. Next attempt in 0s. The connection was paused. It will resume on its own. The server did not answer. Your work is still here. The paused session could not be resumed. The server could not restore this session. Reloading will start a new one.

An unhandled error has occurred. Reload 🗙