Credit Course
Corporate Bond Spreads: Z-Spread, OAS & ASW
Price risky bonds using survival probabilities and compute Z-spread, OAS and asset swap spread.
Enrol now
- Lifetime access — all lessons & updates
- 9 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
A corporate bond trades at a spread to government rates because investors demand compensation for credit risk — but that spread can be measured in several non-equivalent ways, and confusing them leads to bad relative-value calls. This course gives you the mechanics of every major spread measure — Z-spread, option-adjusted spread, asset swap spread and I-spread — derived from first principles so you know exactly what each one is capturing and when to use it.
The Z-spread is the starting point: a parallel shift to the risk-free discount curve that matches a risky bond's market price. From there the course introduces survival-probability-adjusted discounting, the credit triangle that connects par CDS spread, hazard rate and recovery, and the calibration of a hazard rate directly from the CDS market. Understanding that linkage is what lets you identify when a bond is rich or cheap to its CDS hedge.
The course also covers the asset swap spread — the floating spread over SOFR that makes the swap package par — because ASW is the dominant spread measure for investment-grade practitioners who actually hedge with swaps. By the end you can decompose any IG corporate bond price into its risk-free component and its credit compensation, cross-check it against the CDS market, and build the toolkit to do the same for an entire portfolio.
Hands-on
The project you'll build
The project starts with a SOFR-based risk-free curve and a set of investment-grade corporate bonds at market prices. You first implement risky bond pricing using survival-probability-adjusted discounting: each cash flow is multiplied by the probability that the issuer has not defaulted before that payment date, and discounted at the risk-free rate plus an assumed recovery-adjusted loss rate.
You then build solvers for each of the four spread measures. The Z-spread solver uses Brent's method to find the parallel shift to the SOFR curve that reproduces the market price. The OAS solver additionally strips an embedded call option priced by a short-rate model before solving for the residual credit spread. The par ASW solver constructs the swap that exchanges the bond's fixed cash flows for SOFR-flat and solves for the floating margin that makes the package worth par.
In the final stage you calibrate hazard rates from the issuer's CDS par spreads — using the credit triangle approximation for a quick sanity check and a full NPV bootstrap for accuracy — then use those hazard rates to re-price the bond and compare the implied spread to your Z-spread. The completed toolkit flags rich/cheap signals across a portfolio of bonds and outputs a spread-comparison table that a credit analyst would find immediately usable.
Outcomes
What you'll learn
Risky bond pricing
Price corporate bonds by adjusting each discounted cash flow for the probability of survival to that payment date, incorporating an assumed recovery rate.
Hazard rates & survival probabilities
Derive the exponential survival function from a constant hazard rate and understand how to extend it to a term structure of credit risk.
Z-spread computation
Solve numerically for the parallel shift to the risk-free curve that equates a bond's model price to its market price.
Option-adjusted spread
Strip an embedded call option from a callable bond price using a short-rate model, then solve for the residual credit OAS.
Asset swap spread
Construct the par asset swap package and solve for the floating SOFR spread that makes it worth par, understanding why ASW and Z-spread diverge.
Hazard rate calibration from CDS
Use the credit triangle to obtain a quick hazard rate estimate and verify it with a full NPV calibration to the par CDS spread.
Spread measure comparison
Articulate when Z-spread, OAS, ASW and I-spread agree, when they diverge, and which is appropriate for a given bond type and hedging strategy.
Stack
Tools & technology
The course teaches a workflow, not just a toolset — here is what we use and what you could swap in.
| Tool | Used for | Alternatives |
|---|---|---|
| Python 3 | All pricing engines, spread solvers and hazard-rate calibration | Julia, MATLAB, C++ |
| NumPy | Vectorised cash-flow and survival-probability arrays | Pure Python, JAX |
| SciPy | Brent's method for Z-spread, OAS and ASW solvers | Newton-Raphson (implemented from scratch), bisection |
| pandas | Bond portfolio tables, cash-flow schedules and spread-comparison output | NumPy structured arrays, polars |
| Matplotlib | Spread-measure comparison charts and hazard rate calibration diagnostics | Plotly, seaborn |
| Jupyter | Notebook-driven development with step-by-step results and commentary | VS Code, plain .py scripts |
Syllabus
Course curriculum
9 lessons across 2 parts. Lessons marked Free preview can be read before you enrol.
Part 1 — Risky Bond PricingFrom survival probability to risky bond price.
- 1.From risk-free to risky discountingHow default risk and recovery are embedded in corporate bond prices.Free preview
- 2.Hazard rates and survival probabilityModel default intensity and compute Q(t) = exp(-λt).Free preview
- 3.Risky bond pricing with recoveryDiscount cash flows using survival-adjusted discount factors.
- 4.Z-spread: parallel shift to market priceSolve numerically for the spread that matches the observed price.
- 5.Option-Adjusted Spread (OAS)Strip the embedded option cost from the Z-spread.
Part 2 — Asset Swaps & CalibrationASW, I-spread and hazard rate calibration.
- 1.Asset swap spread (ASW)Compute the par ASW and interpret it as a funding spread.
- 2.I-spread and spread comparisonsCompare Z-spread, OAS, ASW and I-spread across bond types.
- 3.Calibrating hazard rates from CDSBack out λ from CDS par spreads using the credit triangle.
- 4.Conclusion & cross-asset spread relationshipsHow CDS, bond and asset swap spreads relate in practice.
Before you start
Prerequisites
- Government Bond Analytics (or equivalent): bond pricing from a discount curve, yield-to-maturity, modified duration and DV01.
- Comfortable with Python and NumPy; numerical root-finding (Brent or Newton-Raphson) is used — SciPy handles this, but you need to understand what it is solving for.
- Basic probability: what an expectation is, what an exponential distribution models. No measure theory is required.
- Familiarity with interest rate swaps at a conceptual level — what a fixed-for-floating swap is and how it is valued.
Fit
Who this course is for
Credit analysts
You work with corporate bonds and want to move beyond Bloomberg spreads to understand what each measure actually captures and how to use them for relative-value analysis.
Fixed-income quant candidates
You are targeting a credit quant or rates-credit hybrid role and need a rigorous, code-based understanding of spread measures and CDS-bond basis.
Portfolio managers in credit
You hedge bond positions with CDS and want to understand the basis between the two instruments at the level of the mathematics, not just the intuition.
Quant-finance students
You have covered rates and want to extend into credit — specifically the pricing mathematics that underlies the CDS-bond basis trade.
Faculty
Your instructor
QuantIndex Faculty
QuantIndex Faculty are practising quantitative analysts with experience in credit derivatives and fixed-income relative value at tier-one banks. This course was developed by quants who have built and maintained spread-analytics and CDS-bond basis systems in production, and reviewed for both mathematical rigour 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
What is the practical difference between Z-spread and OAS?
Z-spread is the parallel shift to the risk-free curve that matches a bond's market price, taking cash flows as given. OAS strips the value of any embedded option (typically a call) before solving for the spread, so it measures the pure credit compensation rather than the blended credit-plus-optionality premium. For bullet bonds with no optionality the two are equal by construction.
Why does the asset swap spread differ from the Z-spread for long-dated bonds?
The Z-spread discounts all cash flows at SOFR + Z, regardless of whether the bond is above or below par. The ASW is computed on a par basis — it measures the funding advantage or disadvantage of swapping the bond's fixed cash flows for floating — so the two diverge materially when the bond is significantly above or below par, which is the norm for long-dated bonds after a rate move.
Do I need to know options pricing for the OAS section?
A conceptual understanding is sufficient. The course uses a simple one-factor short-rate model (Hull-White) to value the embedded call, and the mechanics are explained from scratch. You do not need prior options pricing experience, but having it will let you move faster through that section.
Is this relevant for high-yield bonds or only investment grade?
The analytics are the same for both, but the assumptions break down differently at high hazard rates. The course uses IG examples where the credit triangle is a good approximation. The final lesson discusses where the approximations become unreliable for distressed credits and what adjustments practitioners make.
How does the CDS-bond basis arise and will this course explain it?
The basis is the difference between the CDS par spread and the bond Z-spread for the same reference entity. This course builds the toolkit to measure both, and the final project explicitly computes the basis for each bond in the portfolio. The economic drivers — funding, repo, supply/demand — are discussed qualitatively; a dedicated CDS course covers the pricing mechanics in depth.
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?
- Lifetime access — all lessons & updates
- 9 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.