Skip to main content

note_z_spread_with

Function note_z_spread_with 

pub fn note_z_spread_with<R: Scalar>(
    note: &StructuredNote,
    view: &PricingView<'_, R>,
    dirty_price: f64,
) -> Result<f64, PricingError>
Expand description

The z-spread implied by a structured note’s dirty price per 100 of face — the flat continuously-compounded spread s over the note’s discounting for which Σ aᵢ·DF(tᵢ)·exp(−s·τᵢ) reprices it: the note’s twin of z_spread_with, and a passive solve as that is.

Each amount is projected through the spread-free view, so the coupons fix where they would unmarked. The discounting is the note’s own: a note marked with a security spread solves the residual over it. The issuer’s credit is not read — a z-spread is a spread over discounting. τ is FlatSpread’s measure, so pinning the result as a flat security spread reprices the quote exactly.

§Errors

PricingError::UnbracketedSolve when no spread in the bracket reprices the quote; PricingError::SolverUnconverged on the cap; the fixing and curve errors otherwise.