CQF Quantitative Finance Cheatsheet

Comprehensive Reference with Credit Risk Focus
CQF CORE SUMMARY

Stochastic Foundations

Wiener Process \(W_t\)

  • \(W_0 = 0\), independent increments, \(W_t - W_s \sim \mathcal{N}(0, t-s)\)
  • \(\mathbb{E}[W_t] = 0\), \(\text{Var}(W_t) = t\), \([W, W]_t = t\)

Itô's Lemma

For \(dX = \mu dt + \sigma dW\) and \(f(X,t)\):

$$df = \left(\frac{\partial f}{\partial t} + \mu\frac{\partial f}{\partial X} + \frac{1}{2}\sigma^2\frac{\partial^2 f}{\partial X^2}\right)dt + \sigma\frac{\partial f}{\partial X}dW$$

Key SDEs

GBM: \(dS = \mu S dt + \sigma S dW\)

Solution: \(S_t = S_0 \exp\left[(\mu - \frac{\sigma^2}{2})t + \sigma W_t\right]\)

Ornstein-Uhlenbeck: \(dX = \kappa(\theta - X)dt + \sigma dW\)

CIR: \(dr = \kappa(\theta - r)dt + \sigma\sqrt{r}dW\)

  • Feller condition: \(2\kappa\theta \geq \sigma^2\) ensures \(r > 0\)

Black-Scholes Framework

BS PDE

$$\frac{\partial V}{\partial t} + rS\frac{\partial V}{\partial S} + \frac{1}{2}\sigma^2 S^2\frac{\partial^2 V}{\partial S^2} = rV$$

European Options

Call: \(C = S_0N(d_1) - Ke^{-rT}N(d_2)\)

Put: \(P = Ke^{-rT}N(-d_2) - S_0N(-d_1)\)

$$d_1 = \frac{\ln(S_0/K) + (r + \sigma^2/2)T}{\sigma\sqrt{T}}, \quad d_2 = d_1 - \sigma\sqrt{T}$$

Put-Call Parity: \(C - P = S_0 - Ke^{-rT}\)

Greeks

  • \(\Delta = \partial V/\partial S\): Call \(N(d_1)\), Put \(N(d_1)-1\)
  • \(\Gamma = \partial^2 V/\partial S^2 = N'(d_1)/(S\sigma\sqrt{T})\)
  • \(\mathcal{V} = \partial V/\partial \sigma = S\sqrt{T}N'(d_1)\)
  • \(\Theta = \partial V/\partial t\), \(\rho = \partial V/\partial r\)

Risk Management

VaR (Value at Risk)

Parametric: \(\text{VaR}_\alpha = -(\mu + \sigma z_\alpha)\)

CVaR/ES: \(\text{CVaR}_\alpha = \mathbb{E}[L | L \geq \text{VaR}_\alpha]\)

GARCH(1,1)

$$\sigma_t^2 = \omega + \alpha \epsilon_{t-1}^2 + \beta \sigma_{t-1}^2$$

Long-run variance: \(\bar{\sigma}^2 = \omega/(1 - \alpha - \beta)\)

Interest Rate Models

Vasicek

\(dr = a(b - r)dt + \sigma dW\)

Bond: \(P(t,T) = A(t,T)e^{-B(t,T)r_t}\) where \(B = (1-e^{-a\tau})/a\)

Hull-White

\(dr = [\theta(t) - ar]dt + \sigma dW\)

Calibrates to initial yield curve


CREDIT RISK - OVERVIEW

Credit Risk Summary Table

ConceptFormula / Definition
Default Probability\(PD = \mathbb{P}(\tau \leq T)\)
Survival Probability\(Q(t,T) = \mathbb{P}(\tau > T | \tau > t)\)
Hazard Rate\(\lambda(t) = -\frac{d\ln Q(0,t)}{dt}\)
Recovery Rate\(R\) = fraction recovered at default
Loss Given Default\(LGD = 1 - R\)
Credit Spread\(s = (1-R)\lambda\) (approx)
Expected Loss\(EL = PD \times LGD \times EAD\)

Hazard Rate Framework

Intensity-Based Default

Default time \(\tau\) is first jump of a Poisson process with intensity \(\lambda(t)\):

$$\mathbb{P}(\tau > T) = Q(0,T) = \exp\left(-\int_0^T \lambda(s)ds\right)$$

Constant hazard rate \(\lambda\):

$$Q(0,T) = e^{-\lambda T}$$

Conditional default probability in \([t, t+dt]\):

$$\mathbb{P}(\tau \in [t, t+dt] | \tau > t) = \lambda(t)dt$$

Term Structure of Hazard Rates

Piecewise constant: Given hazard rates \(\lambda_1, \lambda_2, ...\) for periods \([0,T_1], [T_1,T_2], ...\):

$$Q(0,T_n) = \exp\left(-\sum_{i=1}^{n} \lambda_i (T_i - T_{i-1})\right)$$
Example - Survival Probability
Given: \(\lambda_1 = 1\%\) for [0,1], \(\lambda_2 = 1.5\%\) for [1,3], \(\lambda_3 = 2\%\) for [3,5]
\(Q(0,5) = e^{-0.01 \times 1} \times e^{-0.015 \times 2} \times e^{-0.02 \times 2}\)
\(Q(0,5) = e^{-0.01 - 0.03 - 0.04} = e^{-0.08} = \boxed{0.9231}\)

Relationship to Credit Spreads

$$\lambda \approx \frac{s}{1-R}$$
Example - Hazard Rate from Spread
Credit spread \(s = 200\) bps = 2%, Recovery \(R = 40\%\)
\(\lambda = \frac{0.02}{1 - 0.40} = \frac{0.02}{0.60} = \boxed{3.33\%}\) per annum

Structural Models

Merton Model (1974)

Firm value \(V_t\) follows GBM. Equity = call option on firm assets:

$$E_t = V_t N(d_1) - De^{-r(T-t)}N(d_2)$$ $$d_1 = \frac{\ln(V_t/D) + (r + \sigma_V^2/2)(T-t)}{\sigma_V\sqrt{T-t}}$$

Distance to Default:

$$DD = \frac{\ln(V_t/D) + (\mu - \sigma_V^2/2)(T-t)}{\sigma_V\sqrt{T-t}}$$

Default Probability: \(PD = N(-DD)\)


RISKY BOND PRICING

Fundamental Pricing Framework

Risk-Free vs Risky Bond

Risk-free zero-coupon bond:

$$P^{RF}(t,T) = e^{-r(T-t)}$$

Risky zero-coupon bond with default risk:

$$P^{Risky}(t,T) = e^{-r(T-t)} \times \left[Q(t,T) + (1-Q(t,T)) \times R\right]$$

Alternatively, using risk-adjusted discount rate:

$$P^{Risky}(t,T) = e^{-(r+s)(T-t)}$$

where \(s\) is the credit spread.

Key Pricing Equations

ModelRisky Bond Price
Constant \(\lambda\), \(R=0\)\(P = e^{-(r+\lambda)T}\)
Constant \(\lambda\), \(R>0\)\(P = e^{-rT}[e^{-\lambda T} + R(1-e^{-\lambda T})]\)
Time-varying \(\lambda(t)\)\(P = e^{-rT}\mathbb{E}^{\mathbb{Q}}[\mathbf{1}_{\tau>T} + R\mathbf{1}_{\tau\leq T}]\)

Zero Recovery Model

Simplest case: bondholder receives nothing if default occurs.

Risky Zero Price (R=0): $$\bar{P}(t,T) = e^{-r(T-t)} \times Q(t,T) = e^{-(r+\lambda)(T-t)}$$
Example - Zero Recovery Pricing
Given: Face = $100, \(r = 5\%\), \(\lambda = 2\%\), \(T = 3\) years

Risk-free price: \(P^{RF} = 100 \times e^{-0.05 \times 3} = 100 \times 0.8607 = \$86.07\)
Survival prob: \(Q(0,3) = e^{-0.02 \times 3} = e^{-0.06} = 0.9418\)
Risky price: \(P^{Risky} = 86.07 \times 0.9418 = \boxed{\$81.06}\)

Alternative: \(P^{Risky} = 100 \times e^{-(0.05+0.02) \times 3} = 100 \times e^{-0.21} = \boxed{\$81.06}\) ✓
Credit spread: \(s = \lambda = 200\) bps

Non-Zero Recovery Model

Bondholder recovers fraction \(R\) of face value at default.

Risky Zero Price (R > 0): $$\bar{P}(t,T) = e^{-r(T-t)} \times \left[Q(t,T) + R \times (1-Q(t,T))\right]$$

Equivalently:

$$\bar{P}(t,T) = e^{-r(T-t)} \times \left[R + (1-R)Q(t,T)\right]$$
Example - Non-Zero Recovery
Given: Face = $100, \(r = 4\%\), \(\lambda = 3\%\), \(R = 40\%\), \(T = 5\) years

Survival probability: \(Q = e^{-0.03 \times 5} = e^{-0.15} = 0.8607\)
Default probability: \(1 - Q = 0.1393\)
Risk-free discount: \(e^{-0.04 \times 5} = e^{-0.20} = 0.8187\)

Risky bond price:
\(P = 100 \times 0.8187 \times [0.8607 + 0.40 \times 0.1393]\)
\(P = 81.87 \times [0.8607 + 0.0557]\)
\(P = 81.87 \times 0.9164 = \boxed{\$75.02}\)

Credit spread: \(s = -\frac{1}{T}\ln(P/100) - r = -\frac{1}{5}\ln(0.7502) - 0.04\)
\(s = 0.0575 - 0.04 = 1.75\%\) = \boxed{175 \text{ bps}}

Risky Coupon Bond Pricing

General Formula

For a bond paying coupons \(c\) at times \(T_1, T_2, ..., T_n\) with face \(F\) at \(T_n\):

$$P = \sum_{i=1}^{n} c \cdot D(0,T_i) \cdot Q(0,T_i) + F \cdot D(0,T_n) \cdot Q(0,T_n) + R \cdot F \cdot \sum_{i=1}^{n} D(0,T_i) \cdot [Q(0,T_{i-1}) - Q(0,T_i)]$$

where \(D(0,T_i) = e^{-rT_i}\) is the risk-free discount factor.

Simplified Formula (No Recovery on Accrued)

$$P = \sum_{i=1}^{n} c \cdot D(0,T_i) \cdot Q(0,T_i) + F \cdot D(0,T_n) \cdot \left[R + (1-R)Q(0,T_n)\right]$$
Example - Risky Coupon Bond
Given: Face = $100, Annual coupon = $5 (5%), \(r = 3\%\), \(\lambda = 2\%\), \(R = 40\%\), T = 3 years

Discount factors:
\(D_1 = e^{-0.03} = 0.9704\), \(D_2 = e^{-0.06} = 0.9418\), \(D_3 = e^{-0.09} = 0.9139\)

Survival probabilities:
\(Q_1 = e^{-0.02} = 0.9802\), \(Q_2 = e^{-0.04} = 0.9608\), \(Q_3 = e^{-0.06} = 0.9418\)

Coupon PVs:
Year 1: \(5 \times 0.9704 \times 0.9802 = \$4.756\)
Year 2: \(5 \times 0.9418 \times 0.9608 = \$4.525\)
Year 3: \(5 \times 0.9139 \times 0.9418 = \$4.305\)
Total coupon PV = \$13.586

Principal PV:
\(100 \times 0.9139 \times [0.40 + 0.60 \times 0.9418] = 91.39 \times [0.40 + 0.5651]\)
\(= 91.39 \times 0.9651 = \$88.20\)

Total bond price = 13.586 + 88.20 = \boxed{\$101.79}

Credit Spread Relationships

Spread vs Hazard Rate

$$s \approx (1-R)\lambda$$

Exact relationship for risky zero:

$$e^{-sT} = Q(0,T) + R(1-Q(0,T))$$

Z-Spread

Constant spread \(z\) added to risk-free curve that prices the bond:

$$P_{market} = \sum_{i} CF_i \cdot e^{-(r_i + z)T_i}$$

Asset Swap Spread

Spread over LIBOR paid/received to convert fixed bond to floating.

OAS (Option-Adjusted Spread)

Spread after removing value of embedded options.

Example - Implied Hazard Rate
Given: 5-year risky zero trades at $72, Risk-free rate = 4%, Recovery = 40%

Risk-free 5Y zero: \(P^{RF} = 100 \times e^{-0.04 \times 5} = \$81.87\)
Risky/Risk-free ratio: \(72/81.87 = 0.8794\)

From \(0.8794 = R + (1-R)Q = 0.40 + 0.60 \times Q\):
\(Q = (0.8794 - 0.40)/0.60 = 0.7990\)

\(Q = e^{-\lambda \times 5} = 0.7990\)
\(\lambda = -\ln(0.7990)/5 = 0.2244/5 = \boxed{4.49\%}\)

Credit spread: \(s = (1-0.40) \times 0.0449 = \boxed{269 \text{ bps}}\)

CDS PRICING

CDS Structure

Key Components

  • Protection Buyer: Pays periodic premium (spread \(s\))
  • Protection Seller: Pays \((1-R)\) × Notional at default
  • Credit Event: Triggers protection payment
  • Notional: \(N\) (reference amount)

Cash Flows

LegPaymentTiming
Premium Leg\(s \times N \times \Delta\) per periodUntil default or maturity
Accrued PremiumProrated premium to default dateAt default
Protection Leg\((1-R) \times N\)At default

CDS Pricing Formulas

Premium Leg (PV of Spread Payments)

$$PV_{Premium} = s \times N \times \sum_{i=1}^{n} \Delta_i \cdot D(0,T_i) \cdot Q(0,T_i)$$

where \(\Delta_i\) is the day count fraction for period \(i\).

Protection Leg (PV of Contingent Payment)

$$PV_{Protection} = (1-R) \times N \times \sum_{i=1}^{n} D(0,T_i) \cdot [Q(0,T_{i-1}) - Q(0,T_i)]$$

Continuous approximation:

$$PV_{Protection} = (1-R) \times N \times \int_0^T D(0,t) \cdot Q(0,t) \cdot \lambda(t) dt$$

Risky PV01 (RPV01 or Risky Duration)

$$RPV01 = \sum_{i=1}^{n} \Delta_i \cdot D(0,T_i) \cdot Q(0,T_i)$$

This is the present value of 1 bp paid until default or maturity.

Par CDS Spread

At inception, CDS has zero value: \(PV_{Premium} = PV_{Protection}\)

Par Spread: $$s_{par} = \frac{(1-R) \times \sum_{i=1}^{n} D(0,T_i) \cdot [Q(0,T_{i-1}) - Q(0,T_i)]}{\sum_{i=1}^{n} \Delta_i \cdot D(0,T_i) \cdot Q(0,T_i)}$$

Simplified (constant \(\lambda\), continuous):

$$s_{par} \approx (1-R) \times \lambda$$

CDS Valuation Examples

Example 1 - Par CDS Spread Calculation
Given: 3-year CDS, Notional = $10M, \(r = 3\%\), \(\lambda = 2\%\), \(R = 40\%\), Quarterly payments

For simplicity, use annual payments:

Discount factors: \(D_1 = 0.9704\), \(D_2 = 0.9418\), \(D_3 = 0.9139\)
Survival probs: \(Q_1 = 0.9802\), \(Q_2 = 0.9608\), \(Q_3 = 0.9418\)

RPV01 = \(1 \times D_1 Q_1 + 1 \times D_2 Q_2 + 1 \times D_3 Q_3\)
= \(0.9704 \times 0.9802 + 0.9418 \times 0.9608 + 0.9139 \times 0.9418\)
= \(0.9512 + 0.9049 + 0.8607 = 2.7168\)

Protection PV per $1:
Year 1: \(D_1 \times [Q_0 - Q_1] = 0.9704 \times [1 - 0.9802] = 0.9704 \times 0.0198 = 0.01921\)
Year 2: \(D_2 \times [Q_1 - Q_2] = 0.9418 \times [0.9802 - 0.9608] = 0.9418 \times 0.0194 = 0.01827\)
Year 3: \(D_3 \times [Q_2 - Q_3] = 0.9139 \times [0.9608 - 0.9418] = 0.9139 \times 0.0190 = 0.01736\)
Total = 0.05484

Par spread: \(s = \frac{(1-0.40) \times 0.05484}{2.7168} = \frac{0.03290}{2.7168} = 0.01211 = \boxed{121 \text{ bps}}\)

Check: \(s \approx (1-R)\lambda = 0.60 \times 0.02 = 1.20\%\) ✓
Example 2 - CDS Mark-to-Market
Existing CDS: 5Y CDS bought 2 years ago at \(s_0 = 150\) bps
Current: 3Y CDS par spread = 200 bps, \(r = 4\%\), \(\lambda = 3.33\%\), \(R = 40\%\)
Notional = $10M

CDS MTM = (Current spread - Contract spread) × RPV01 × Notional

Calculate RPV01 (3Y remaining, annual):
\(D_1 = 0.9608\), \(D_2 = 0.9231\), \(D_3 = 0.8869\)
\(Q_1 = e^{-0.0333} = 0.9672\), \(Q_2 = 0.9357\), \(Q_3 = 0.9053\)
RPV01 = \(0.9608 \times 0.9672 + 0.9231 \times 0.9357 + 0.8869 \times 0.9053\)
= \(0.9293 + 0.8638 + 0.8029 = 2.596\)

MTM (protection buyer):
MTM = (0.0200 - 0.0150) × 2.596 × $10M
MTM = 0.0050 × 2.596 × $10M = \boxed{\$129,800} gain

Bootstrapping Hazard Rates from CDS

Procedure

  1. Start with shortest maturity CDS spread
  2. Assume constant hazard rate for first period
  3. Solve for \(\lambda_1\) such that par spread is matched
  4. Move to next maturity, solve for \(\lambda_2\), etc.
Example - Bootstrap from CDS Spreads
Given: 1Y CDS = 100 bps, 2Y CDS = 120 bps, 3Y CDS = 150 bps
\(r = 5\%\), \(R = 40\%\), annual payments

Step 1: Solve for \(\lambda_1\)
Using \(s_1 \approx (1-R)\lambda_1\):
\(\lambda_1 = 0.01/0.60 = 1.67\%\)
\(Q_1 = e^{-0.0167} = 0.9834\)

Step 2: Solve for \(\lambda_2\)
For 2Y CDS with spread 120 bps:
Premium PV = \(0.0120 \times [D_1 Q_1 + D_2 Q_2]\)
Protection PV = \(0.60 \times [D_1(1-Q_1) + D_2(Q_1-Q_2)]\)
With \(Q_2 = Q_1 \times e^{-\lambda_2}\), solve iteratively...
Result: \(\lambda_2 \approx 2.0\%\), \(Q_2 = 0.9834 \times e^{-0.020} = 0.9640\)

Step 3: Solve for \(\lambda_3\)
Similar procedure gives \(\lambda_3 \approx 3.0\%\)

CDS Greeks and Sensitivities

Credit DV01 (CS01)

Change in CDS value for 1 bp change in spread:

$$CS01 = \frac{\partial V_{CDS}}{\partial s} \approx RPV01 \times N$$
Example - CS01
Long protection on $10M notional, RPV01 = 4.2 years
CS01 = 4.2 × $10M × 0.0001 = \boxed{\$4,200} per bp

IR01

Sensitivity to 1 bp parallel shift in rates:

$$IR01 = \frac{\partial V_{CDS}}{\partial r} \times 0.0001$$

Recovery Sensitivity

$$\frac{\partial V_{CDS}}{\partial R} \approx -\frac{PV_{Protection}}{1-R}$$

Upfront vs Running CDS

Standard CDS Conventions

Post-2009 "Big Bang": CDS trade with standard coupons (100 or 500 bps) plus upfront:

$$\text{Upfront} = (s_{par} - s_{coupon}) \times RPV01 \times N$$
Example - Upfront Calculation
Par spread = 350 bps, Standard coupon = 500 bps, RPV01 = 4.5, Notional = $10M

Protection buyer receives upfront:
Upfront = (0.0350 - 0.0500) × 4.5 × $10M = -0.0150 × 4.5 × $10M
= \boxed{-\$675,000} (i.e., pays $675,000 to seller)

Since par spread < coupon, buyer "overpays" premium so compensated upfront

CDS vs Bond Basis

CDS-Bond Basis

$$\text{Basis} = \text{CDS Spread} - \text{Bond Z-Spread}$$

Positive basis: CDS spread > Bond spread (basis trade: short CDS, long bond)

Negative basis: CDS spread < Bond spread (basis trade: long CDS, short bond)

Drivers of Basis

  • Funding costs (repo, liquidity)
  • Counterparty risk in CDS
  • CTD option in physical settlement
  • Delivery squeeze risk

Quick Reference Formulas

FormulaExpression
Survival Prob (const λ)\(Q(T) = e^{-\lambda T}\)
Hazard from Spread\(\lambda = s/(1-R)\)
Par CDS Spread (approx)\(s \approx (1-R)\lambda\)
Risky Zero (R=0)\(P = e^{-(r+\lambda)T}\)
Risky Zero (R>0)\(P = e^{-rT}[R + (1-R)e^{-\lambda T}]\)
CDS MTM\((s_{mkt} - s_0) \times RPV01 \times N\)
Upfront\((s_{par} - s_{cpn}) \times RPV01 \times N\)
Interview Tips - Credit
  • \(s \approx (1-R)\lambda\) is the most important approximation
  • RPV01 ≈ sum of survival-weighted discount factors
  • Protection buyer benefits from spread widening
  • CDS vs bond basis driven by funding and liquidity
  • Upfront = (par spread - coupon) × RPV01 × Notional
  • CS01 ≈ RPV01 × Notional × 1 bp
Common Mistakes
  • Forgetting recovery rate in hazard rate conversion
  • Confusing survival probability with default probability
  • Wrong sign on upfront: buyer pays if par < coupon
  • Not discounting default payments to appropriate time
  • Mixing annualized spread with period spread