Credit Default Swaps (CDS) and Credit Derivatives › CDS Valuation After Inception
Quantitative FinanceAll chapters Credit Default Swaps (CDS) and Credit Derivatives › CDS Valuation After InceptionOne section · Sections in this chapter10 / 16 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Once a CDS is traded, its value changes as credit spreads and interest rates move. The mark-to-market value for the protection buyer is:
where:
- : mark-to-market value for the protection buyer
- : current present value of potential protection payments
- : current present value of remaining premium payments
This valuation approach follows the same logic as valuing a swap after inception: the value is the difference between what you receive and what you pay, where both amounts are recomputed using current market parameters. At inception, this value is zero by construction (assuming the trade was executed at the fair spread), but subsequent market movements cause the value to deviate from zero.
If credit spreads have widened since inception (the reference entity has become riskier), the protection is worth more than originally paid, and the protection buyer has a positive value. Conversely, if spreads have tightened, the protection buyer shows a loss. This mark-to-market behavior is essential for risk management and accounting purposes, even if the ultimate outcome depends on whether default occurs.
import numpy as np
def price_cds(
notional,
spread_bps,
hazard_rate,
recovery_rate,
risk_free_rate,
maturity_years,
payments_per_year=4,
):
"""
Calculate CDS value for protection buyer.
Returns dictionary with fair spread and value given contracted spread.
"""
# Generate payment schedule
num_payments = maturity_years * payments_per_year
payment_times = np.array(
[(i + 1) / payments_per_year for i in range(num_payments)]
)
delta_t = 1 / payments_per_year
# Survival and discount factors
survival_probs = np.exp(-hazard_rate * payment_times)
discount_factors = np.exp(-risk_free_rate * payment_times)
# Default probabilities per period
survival_probs_prev = np.concatenate([[1.0], survival_probs[:-1]])
default_probs = survival_probs_prev - survival_probs
# Premium and protection legs
risky_annuity = np.sum(delta_t * survival_probs * discount_factors)
protection_leg_factor = np.sum(discount_factors * default_probs)
# Fair spread
loss_given_default = 1 - recovery_rate
fair_spread = (loss_given_default * protection_leg_factor) / risky_annuity
fair_spread_bps = fair_spread * 10000
# Value calculations
contracted_spread = spread_bps / 10000
pv_premium = contracted_spread * notional * risky_annuity
pv_protection = loss_given_default * notional * protection_leg_factor
value = pv_protection - pv_premium
return {
"fair_spread_bps": fair_spread_bps,
"risky_annuity": risky_annuity,
"pv_premium": pv_premium,
"pv_protection": pv_protection,
"value": value,
}# Scenario: We entered a CDS at 100 bps, now spreads have widened
contracted_spread = 100 # bps at inception
current_hazard_rate = 0.03 # Hazard rate has increased from 2% to 3%
result = price_cds(
notional=10_000_000,
spread_bps=contracted_spread,
hazard_rate=current_hazard_rate,
recovery_rate=0.40,
risk_free_rate=0.04,
maturity_years=5,
)CDS Mark-to-Market Analysis ================================================== Contracted spread: 100 bps Current fair spread: 180.68 bps PV of premium leg: $418,193.53 PV of protection leg: $755,578.22 Value (protection buyer): $337,384.70
The protection buyer benefits when spreads widen because the protection they purchased at 100 bps is now worth more in the market. The value represents the profit they would realize if they closed the position.
