Class CreditSpreads
The Z-SPREAD is the single constant shift z added to every point of the risk-free zero curve that makes the bond's discounted cash flows equal its dirty price:
price = sum cf_i * exp(-(z(t_i) + z) * t_i)
It is the honest successor to "yield spread over the 10y": a yield
spread compares one bond's YTM to one government point and mixes curve
shape into the number; the Z-spread strips the entire risk-free curve
out first, so what remains is compensation for credit and liquidity.
A desk triangulates it against the same name's CDS: zSpread -
cdsParSpread is the CDS-BOND BASIS, the classic relative-value trade
(negative basis: buy the bond, buy CDS protection, collect the
difference — a trade that famously blew through funding constraints
in 2008, which is why the basis is not free money).
Solving is bisection on z in [-50%, +500%] with an explicit bracket
check: a price outside what that range can explain throws rather than
returning an endpoint (the house rule for every solver since the YTM
incident). Annual-fraction period grid i/frequency, cash flows
of a standard fixed-coupon bond. Research lane, deterministic.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublepriceWithZSpread(double face, double couponRate, int frequency, double yearsToMaturity, YieldCurve curve, double z) Bond PV under the curve shifted by a constant z (cc).static doublezSpread(double dirtyPrice, double face, double couponRate, int frequency, double yearsToMaturity, YieldCurve curve) The Z-spread (continuously compounded, decimal) of a fixed-coupon bond overcurve.
-
Method Details
-
zSpread
public static double zSpread(double dirtyPrice, double face, double couponRate, int frequency, double yearsToMaturity, YieldCurve curve) The Z-spread (continuously compounded, decimal) of a fixed-coupon bond overcurve.- Parameters:
dirtyPrice- market dirty price perfaceface- face value, > 0couponRate- annual coupon rate (decimal)frequency- coupons per year, ≥ 1yearsToMaturity- whole periods assumed, > 0
-
priceWithZSpread
public static double priceWithZSpread(double face, double couponRate, int frequency, double yearsToMaturity, YieldCurve curve, double z) Bond PV under the curve shifted by a constant z (cc).
-