Credit Course

Credit Default Swaps: Pricing from First Principles

Price CDS contracts from hazard rates, compute CS01 and IR01, and implement the ISDA upfront convention.

Intermediate – Advanced~10 hours10 lessonsUpdated May 2026

Enrol now

$149one-time payment
  • Lifetime access — all lessons & updates
  • 10 lessons across 2 structured parts
  • Fully worked Jupyter notebooks
  • Market datasets + published benchmark prices
  • Free lesson previews before you buy
  • 14-day money-back guarantee

Secured by a no-questions-asked 14-day refund.

Overview

Introduction

The credit default swap is the central instrument of the credit derivatives market, yet most practitioners who use CDS — for hedging, speculation or index trading — could not price one from first principles. This course builds that understanding from the ground up. You derive the protection and premium legs as integrals over the survival curve, write the closed-form expressions, and turn them into a working Python pricer.

The 2009 ISDA Big Bang changed how CDS trades. Standard coupons of 100 bps and 500 bps replaced running-spread quotes, and upfront payments became the norm. Most introductory treatments still describe the pre-2009 world. This course teaches the modern market convention first, derives the upfront formula from the fundamental pricing equation, and shows you how to convert between par spread and upfront using the risky annuity.

Beyond single-name pricing the course covers the key sensitivities — CS01 (credit sensitivity) and IR01 (rate sensitivity) — and their applications in hedging. It also covers seasoned CDS mark-to-market and intrinsic CDX index valuation, so by the end you have the toolkit to think rigorously about credit risk across the most liquid instruments in the market.

Hands-on

The project you'll build

The project begins with a flat hazard rate and an OIS discount curve. You first implement the protection leg — the expected present value of the loss given default — as a numerical integral over the term structure of default probability, correctly handling the recovery rate and discounting. You then implement the premium leg under the ISDA accrual convention, which accounts for the partial coupon accrued when default occurs mid-period.

With both legs in place you derive the par spread formula (protection PV equals premium PV at par) and the risky PV01 — also called the risky annuity or RPVBP — which is the dollar sensitivity of the premium leg to a one-basis-point change in running spread. You then implement the post-2009 upfront convention: given a standard coupon (100 bps or 500 bps) and a par spread, solve for the upfront payment using the RPVBP, and verify the round-trip conversion.

In the final stage you compute a CS01 term structure — the sensitivity of each instrument in a CDS portfolio to a one-basis-point shift in the hazard rate at each maturity — and an IR01 (the sensitivity to a parallel shift in the risk-free curve). You then price a CDX index as the intrinsic spread (the notional-weighted average of its single-name constituents), discuss index basis, and wrap the entire pricer into a clean, reusable Python module.

Outcomes

What you'll learn

CDS contract mechanics

Describe the roles of protection buyer and seller, reference entity, notional, premium and recovery, and what constitutes a credit event.

Protection leg pricing

Derive and implement the protection leg as the expected present value of loss given default, integrating over the default probability density.

Premium leg pricing

Implement the premium leg under the ISDA accrual convention, correctly accounting for partial coupon accrual at the time of default.

Par spread & risky annuity

Derive the par spread from the fundamental pricing equation and compute the RPVBP as a dollar measure of spread sensitivity.

ISDA upfront convention

Implement the post-2009 upfront payment formula for 100 bps and 500 bps standard coupons and verify the par-spread to upfront round-trip.

CS01 and IR01 computation

Compute the credit sensitivity (CS01) and interest-rate sensitivity (IR01) of a single-name CDS position and a portfolio of CDS.

Seasoned CDS mark-to-market

Value a seasoned (off-market) CDS using the current hazard rate curve and the trade's original coupon, producing the correct mark-to-market P&L.

CDX intrinsic spread

Price a CDS index as the notional-weighted average of its single-name constituents and discuss the drivers of index-to-intrinsic basis.

Stack

Tools & technology

The course teaches a workflow, not just a toolset — here is what we use and what you could swap in.

ToolUsed forAlternatives
Python 3All pricing engines, leg implementations and sensitivity calculationsJulia, MATLAB, C++
NumPyVectorised cash-flow schedules, survival probability arrays and integral approximationsPure Python, JAX
SciPyNumerical integration for the protection leg (quad) and root-finding for the par spread solverSimpson rule or trapezoidal quadrature implemented from scratch
pandasCDS portfolio tables, sensitivity term structures and mark-to-market outputNumPy structured arrays, polars
MatplotlibSurvival curve visualisation, CS01 term structure bar charts and P&L attributionPlotly, seaborn
JupyterNotebook-driven development with step-by-step derivation and implementation side by sideVS Code, plain .py scripts

Syllabus

Course curriculum

10 lessons across 2 parts. Lessons marked Free preview can be read before you enrol.

Before you start

Prerequisites

  • Corporate Bond Spreads (or equivalent): risky bond pricing, hazard rates, exponential survival probabilities and Z-spread.
  • Government Bond Analytics (or equivalent): discount curves, DV01, and numerical root-finding.
  • Comfortable with Python and SciPy; numerical integration (scipy.integrate.quad) is used extensively in the protection-leg calculation.
  • Basic probability: probability density functions, expectations. No measure theory is required.

Fit

Who this course is for

Credit derivatives practitioners

You trade or hedge with CDS and want to understand the pricing mathematics well enough to build your own pricer and validate your system's numbers.

Credit quant candidates

You are targeting a credit quant or structuring role and need a rigorous, first-principles implementation of CDS pricing including the ISDA upfront convention.

Risk managers in credit

You manage CDS or CDX exposures and want a thorough understanding of CS01, IR01 and seasoned mark-to-market to challenge your risk system output.

Quant-finance students

You have studied fixed income and want to extend into credit derivatives with a course that reaches the modern ISDA market convention, not just the pre-2009 textbook version.

Faculty

Your instructor

QuantIndex Faculty

QuantIndex Faculty are practising quantitative analysts with experience in credit derivatives pricing and risk at tier-one banks and hedge funds. This course was written by quants who have built single-name and index CDS pricers in production environments — where ISDA convention compliance is non-negotiable — and reviewed for mathematical accuracy and code quality before publication.

Benchmarked & verified

Every price you compute is checked against published results from leading textbooks and market data. You do not finish the course hoping your model is right — you finish it knowing.

Questions

Frequently asked questions

Why does the premium leg need an accrual correction?

If default occurs on day 15 of a 90-day coupon period, the protection buyer owes 15 days of accrued premium to the seller before the contract terminates. Ignoring accrual underprices the premium leg by several basis points for high-spread names. The ISDA standard model requires the accrual correction, so any production pricer must include it.

What is the practical significance of the risky annuity (RPVBP)?

The RPVBP is the dollar change in CDS value per one-basis-point change in par spread. It is the primary tool for converting between upfront and running-spread quotes, for hedging a CDS position (notional × RPVBP = CS01), and for computing break-even spread moves. Knowing the RPVBP cold is essential for any practitioner who trades or hedges CDS.

When did the standard coupon convention change, and why?

The ISDA 2009 Big Bang standardised North American CDS coupons at 100 bps (investment grade) and 500 bps (high yield) for all new trades. The motivation was to facilitate central clearing — standardised coupons mean standardised payment schedules, which simplifies portfolio compression and netting at a CCP. Upfront payments adjust for the difference between the standard coupon and the market par spread at trade inception.

Is the CDX pricing in this course the same as how a dealer prices it?

The intrinsic pricing method — notional-weighted average of constituent par spreads — is a close approximation and is standard for relative-value analysis. Dealers who market-make CDX also account for the index coupon, the roll schedule and the index basis (the difference between the observed index spread and its intrinsic value). The course derives intrinsic pricing rigorously and discusses basis qualitatively; a dedicated structured-credit course would go deeper on CDX mechanics.

How does this course relate to the CDS Curve Bootstrapping course?

This course prices CDS with a flat (constant) hazard rate assumption — simple, clean, and sufficient to understand all the contract mechanics and sensitivities. The CDS Curve Bootstrapping course replaces the flat hazard rate with a piecewise-constant term structure calibrated to the full CDS term structure. Take this course first; bootstrapping builds directly on it.

Is there a refund policy?

Yes — a 14-day, no-questions-asked money-back guarantee. If the course is not right for you, contact us within 14 days of purchase and we will refund you in full.

Ready to start?

$149one-time payment
  • Lifetime access — all lessons & updates
  • 10 lessons across 2 structured parts
  • Fully worked Jupyter notebooks
  • Market datasets + published benchmark prices
  • Free lesson previews before you buy
  • 14-day money-back guarantee

Secured by a no-questions-asked 14-day refund.