Enum QuoteKind
#[non_exhaustive]pub enum QuoteKind {
Par,
Priced {
money_per_quote: f64,
settlement: Option<NaiveDate>,
},
Spread,
}Expand description
The two are not interchangeable and the difference is not cosmetic: a par rung’s instrument is worth nothing at its quote, while a priced rung’s is worth its quote. The solver’s target, the Jacobian’s read, and the check that a rung reprices at what it declared all follow from this one choice, so they cannot disagree.
The kind is declared, never inferred from whether an instrument happens
to support par_rate. Inferring it would make a ladder’s arithmetic depend
on which error a product returns, and would silently change every ladder
containing a product that later gained one.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Par
The instrument is at par: the residual is its value, driven to zero, and the quote is its par rate. Every deposit, swap, FRA and CDS rung.
Priced
The instrument trades at a price: the residual is its value less that price, and the quote is the price. A bond.
Carries the scale between the quote’s units and the instrument’s
money — for a bond quoted per 100 face, face/100 — and not the target
itself. The target is then quote × scale, so the two cannot disagree
and the quote read back at the solution is npv / scale.
That the scale is a property of the instrument and not of the declared quote is what makes the verification mean anything. Carrying a target alongside the quote, and scaling the Jacobian read by their ratio, makes the declared quote cancel out — the check then passes for every quote, including wrong ones.
Fields
settlement: Option<NaiveDate>The date the price is for, when that is not the curve’s reference: a bond quoted for T+1 settlement.
The price is then compared with the instrument’s value forwarded to
that date on the curve under solve — its flows after settlement,
over DF(settlement) — rather than with its value today. The
forwarding cannot be done before the solve, because DF(settlement)
is on the curve being built. None, or a date at or before the
reference, compares with today’s value, and is bit-identical to a
rung that never carried one.
Spread
The instrument is at par, but what the market quotes is a spread:
the residual is its value driven to zero exactly as for Par, and the
quote is read back through par_spread rather than par_rate. A tenor
basis swap, a cross-currency basis swap, an averaged-versus-compounded
overnight basis.
The residual is the same quantity as Par’s, and this is not a
duplicate variant for that reason: what differs is the quantity the
Jacobian column is with respect to. A basis rung’s sensitivity is
per unit of spread, and reading par_rate on a basis swap would
differentiate a fixed rate the ladder never solved — the same failure
Priced exists to prevent, one instrument along.