Class SwapPricer
YieldCurve — the
missing middle between the curve (which the bootstrap builds FROM par
swaps) and RatesOptions (which prices options ON forward
swaps): the PV, par rate and DV01 of an actual swap position.
Single-curve identities (annual fixed leg, matching the bootstrap's convention):
annuity = sum DF(t_i) i = 1..T (annual, tau = 1) parRate = (1 - DF(T)) / annuity spot-starting payerPv = annuity * (parRate - K) pay fixed K, receive float receiverPv = -payerPv
The float leg needs no forecasting in a single-curve world: it is
worth par at inception, i.e. 1 - DF(T) per unit notional —
which is exactly why the par rate has that closed form. DV01 is the
bump-and-reprice sensitivity to a parallel 1bp shift of the zero
curve: for a fresh par swap on a flat cc curve it is
annuity * e^z * 1bp * notional (the tests pin exactly that;
the desk shorthand annuity * 1bp is the sensitivity to the
SIMPLE par rate, a different derivative, ~e^z away). A swap struck at
the par rate must PV to zero — an identity, tested at 1e-12.
Stated simplifications: single curve (no OIS/projection split), annual fixed leg, spot start. Research lane, deterministic.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleannuity(YieldCurve curve, int tenorYears) PV of the annual fixed-leg annuity, per unit notional.static doubledv01(YieldCurve curve, int tenorYears, double fixedRate) DV01 per unit notional: the payer swap's PV change for a +1bp parallel shift of the zero curve (positive — rates up helps the fixed payer).static doubleparRate(YieldCurve curve, int tenorYears) The spot-starting par swap rate fortenorYears.static doublepayerPv(YieldCurve curve, int tenorYears, double fixedRate) PV per unit notional of a PAYER swap (pay fixedfixedRate, receive float).
-
Method Details
-
annuity
PV of the annual fixed-leg annuity, per unit notional. -
parRate
The spot-starting par swap rate fortenorYears. -
payerPv
PV per unit notional of a PAYER swap (pay fixedfixedRate, receive float). Negate for the receiver. -
dv01
DV01 per unit notional: the payer swap's PV change for a +1bp parallel shift of the zero curve (positive — rates up helps the fixed payer).
-