Function cds_option
pub fn cds_option(
underlying: &CreditDefaultSwap,
expiry: NaiveDate,
strike: f64,
vol: f64,
kind: SwaptionKind,
short: bool,
market: &MarketContext,
) -> Result<CdsOptionValue, PricingError>Expand description
A single-name CDS option under Black’s model on the forward spread: the
right at expiry to enter underlying — the CDS the option exercises
into, its protection starting after expiry — a payer (the right to pay
the strike spread, buying protection) or a receiver (the right to
receive it). short is the seller’s side: the same option, its value
negated.
V = A(0)·Black(F, K, σ, T), F = protection/annuity of the
underlying valued today on its entity’s curve and A(0) its risky annuity.
The annuity is survival-weighted from today, so a default before expiry
leaves the option worthless — the standard single-name knockout. T is
ACT/365F from the valuation date to expiry. Index options (front-end
protection, no knockout, exercise-price adjustment) are not this.
§Errors
PricingError::Curve for an expiry on or before the valuation date, an
underlying whose protection starts on or before expiry, or a strike or vol
that is not positive; the resolution’s and the pricer’s errors otherwise.