Class CdsPricer
java.lang.Object
com.quantfinlib.credit.CdsPricer
CDS pricing off a
CreditCurve: the two legs, the par spread,
and the upfront that post-2009 standardized contracts actually
exchange.
A credit default swap is insurance with a running premium: the
protection BUYER pays spread per year (quarterly, accruing to
the default date) and receives 1 - R of notional if the name
defaults before maturity. The pricing identities, per unit notional:
riskyAnnuity = sum dt * DF(t_i) * Q(t_i) + accrual-on-default term
premiumLegPv = spread * riskyAnnuity
protectionPv = (1 - R) * sum DF(t_i) * (Q(t_{i-1}) - Q(t_i))
parSpread = protectionPv / riskyAnnuity (zero-upfront spread)
upfront(S_c) = protectionPv - S_c * riskyAnnuity
Positive upfront means the protection buyer pays points up front
(the contract's fixed coupon S_c is too small for the risk —
the standard 100bp coupon on a 300bp name). The risky annuity is also
the desk's "risky DV01": the PnL per 1bp of spread move, which is why
it gets its own accessor rather than living inside the leg. Same
quarterly discretization as the bootstrap, stated there. Research
lane, deterministic.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleparSpread(CreditCurve credit, YieldCurve discount, double maturityYears) The zero-upfront (par) spread for this maturity.static doublepremiumLegPv(CreditCurve credit, YieldCurve discount, double spread, double maturityYears) PV of the premium leg at the given running spread.static doubleprotectionLegPv(CreditCurve credit, YieldCurve discount, double maturityYears) PV of the protection leg: (1-R) paid at default.static doubleriskyAnnuity(CreditCurve credit, YieldCurve discount, double maturityYears) PV of 1bp-per-year premium stream per unit spread (the risky annuity / risky DV01 base).static doubleupfront(CreditCurve credit, YieldCurve discount, double contractSpread, double maturityYears) Upfront points (per unit notional) the protection BUYER pays on a contract with fixed running couponcontractSpread.
-
Method Details
-
riskyAnnuity
PV of 1bp-per-year premium stream per unit spread (the risky annuity / risky DV01 base). -
protectionLegPv
PV of the protection leg: (1-R) paid at default. -
parSpread
The zero-upfront (par) spread for this maturity. -
upfront
public static double upfront(CreditCurve credit, YieldCurve discount, double contractSpread, double maturityYears) Upfront points (per unit notional) the protection BUYER pays on a contract with fixed running couponcontractSpread.
-