Enum PricingError
#[non_exhaustive]pub enum PricingError {
Show 39 variants
Curve(CurveError),
MarketData(MarketDataError),
MissingCurve {
key: String,
detail: Box<MissingCurveDetail>,
},
Undated,
NoSnapshot {
as_of: NaiveDate,
},
MissingVolSurface {
pair: String,
},
MissingSwaptionVols {
currency: Currency,
},
MissingBondYieldVols {
key: String,
},
MissingCapVols {
currency: Currency,
},
MissingCreditVols {
credit: CreditCurveId,
},
MissingYoyInflationVols {
index: String,
},
MissingCpiInflationVols {
index: String,
},
MissingExogenous {
label: String,
},
AmbiguousHullWhiteSigma {
flat: String,
dated: String,
},
RepoChainCycle {
keys: Vec<String>,
},
TriangulatedChain {
key: String,
source: String,
},
TriangulatedRead {
key: String,
},
RepoBasisMismatch {
first: String,
second: String,
},
MissingBaseCorrelation {
index: CreditIndexId,
},
MissingBasketCorrelation {
basket: String,
},
MissingCmsSpreadCorrelation {
first: String,
second: String,
},
MissingRecoveryFloor {
index: CreditIndexId,
},
MissingCopulaDof {
index: CreditIndexId,
},
GridReadOfSabr {
surface: String,
},
SeasonedReset {
product: &'static str,
reset: NaiveDate,
},
AgreedRate {
agreed: f64,
expected: f64,
quoted: Currency,
other: Currency,
},
UnfixedFunding {
product: &'static str,
start: NaiveDate,
},
MissingFuturePrice {
contract: ListedFutureId,
},
MissingEquitySpot {
name: String,
},
MissingEquityVols {
name: String,
},
MissingFutureOptionVols {
contract: ListedFutureId,
},
DegenerateAnnuity {
entry_point: &'static str,
product: &'static str,
},
MixedCurrencyBook {
first: Currency,
second: Currency,
},
UnsupportedForProduct {
entry_point: &'static str,
product: &'static str,
},
MalformedDeclaration {
product: &'static str,
detail: String,
},
UnbracketedSolve {
lo: f64,
hi: f64,
},
SolverUnconverged {
solver: &'static str,
residual: f64,
iterations: usize,
},
UndeclaredProjection {
index: String,
},
InTrade {
trade: String,
source: Box<PricingError>,
},
}Expand description
A pricing call that cannot be answered.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Curve(CurveError)
A curve could not answer a query.
MarketData(MarketDataError)
A market-data lookup could not be answered.
MissingCurve
The market held no curve under a key the product asked for.
Fields
detail: Box<MissingCurveDetail>What the market holds instead, and what the valuation needed —
boxed, as it is read only on this failure and would otherwise
widen every pricing Result.
Undated
The market has no date, so it holds no snapshot to value against.
NoSnapshot
The book carries no market, or none holding a snapshot at the date
asked for; a Rust book fetches only through fetch_market_data.
MissingVolSurface
A declared FX vol surface is not carried by the market.
MissingSwaptionVols
A declared swaption vol surface is not carried by the market.
MissingBondYieldVols
A declared bond yield vol surface is not carried by the market.
MissingCapVols
A declared cap vol surface is not carried by the market.
MissingCreditVols
A declared credit vol surface is not carried by the market.
Fields
credit: CreditCurveIdThe credit identity asked for.
MissingYoyInflationVols
A declared year-on-year inflation optionlet vol surface is not carried by the market.
MissingCpiInflationVols
A declared zero-coupon CPI option vol surface is not carried by the market.
MissingExogenous
A declared exogenous market input has no value pinned under its label.
AmbiguousHullWhiteSigma
A currency’s Hull-White volatility is pinned under both spellings — the flat label and dated per-piece labels — so which one prices is not the market’s to guess.
Fields
RepoChainCycle
A repo key’s base chain returns to a key already in it, so no base ends it.
TriangulatedChain
A triangulated discount key reads a source that is itself triangulated: one hop is supported.
Fields
TriangulatedRead
A triangulated discount key was asked for its stored curve: it holds none, being composed from its sources at pricing.
RepoBasisMismatch
Two repo spreads in one chain accrue on different bases, so their simple spreads do not add.
MissingBaseCorrelation
A product requiring base correlation found no curve under its index.
Fields
index: CreditIndexIdThe index asked for.
MissingBasketCorrelation
A basket on a market correlation found none under its key.
MissingCmsSpreadCorrelation
A CMS spread on a market correlation found no mark for its pair of swap indices.
Fields
MissingRecoveryFloor
A tranche on a market recovery floor found none for its index.
Fields
index: CreditIndexIdThe credit index asked for.
MissingCopulaDof
A tranche on market copula degrees of freedom found none for its index.
Fields
index: CreditIndexIdThe credit index asked for.
GridReadOfSabr
A grid read asked of a registry that holds a SABR surface.
SeasonedReset
A trade asked to value a period that began at a past reset whose struck price is a fact of the trade the market does not hold.
AgreedRate
A cross-currency swap’s agreed FX rate is not a positive finite number, or reads as the market’s rate inverted: more than ten times away from it while its reciprocal is within ten times.
Fields
UnfixedFunding
A floating funding period under way names no index, so the rate it fixed at is a fact the market does not hold.
Fields
MissingFuturePrice
An option on a listed future found no quoted price for its contract.
Fields
contract: ListedFutureIdThe contract asked for.
MissingEquitySpot
An equity product found no quoted spot for its equity.
MissingEquityVols
An equity option found no vol surface for its equity.
MissingFutureOptionVols
An option on a listed future found no option vol surface for its contract.
Fields
contract: ListedFutureIdThe underlying contract asked for.
DegenerateAnnuity
A par measure was asked of a trade with no annuity to solve against — a
matured trade, or one whose coupons all pay on or before the valuation
date. Reported rather than divided by: x / 0.0 is Ok(NaN) or
Ok(±inf), a successful-looking result that poisons whatever consumes it.
Fields
MixedCurrencyBook
A book whose trades pay in more than one currency was aggregated without a declared reporting currency. Amounts in different currencies do not add, so the sum is refused rather than produced in mixed units.
Fields
UnsupportedForProduct
The product’s market data exceeds what RiskFactors can express, or
the entry point does not apply to it.
Named rather than answered: a product that needs two discount curves and an FX rate cannot report a single-curve shape, and fabricating one would resolve the wrong data and price successfully against it.
Fields
MalformedDeclaration
A product’s declaration is internally inconsistent, so the identifiers it would cross the seam with cannot be decoded as it intends them.
Distinct from UnsupportedForProduct,
which says a product’s needs exceed an entry point. This says the
declaration itself does not hold together, and it exists because the
alternative is worse than an error: a variadic slot crosses the seam as a
flat list carrying no arity, so a list that does not match the shape its
declarer will decode is read as market data that happens to be absent —
which several slots treat as a documented fall back. Refused where the
declaration is made, it is a typed failure; allowed through, it is a
silent mispricing.
Fields
UnbracketedSolve
An implied-spread solve found no root inside its bracket: the quoted price is outside the range the instrument can reprice.
SolverUnconverged
A passive solve reached its iteration cap without meeting tolerance.
Fields
UndeclaredProjection
A product asked its view for the projection curve of an index it did not declare. The view answers only from the declaration it was resolved for, so this names a defect in the product’s declaration rather than a curve the market lacks.
InTrade
One trade of a book could not be resolved or valued. Names the trade,
so a caller holding hundreds need not bisect the book to find it;
root is the refusal itself.
Implementations§
§impl PricingError
impl PricingError
pub fn root(&self) -> &PricingError
pub fn root(&self) -> &PricingError
The refusal underneath any trade it is reported against — what a caller matches on.
pub fn missing_input(&self) -> Option<(&'static str, String)>
pub fn missing_input(&self) -> Option<(&'static str, String)>
The market input this refusal found missing, as the (kind, key) row
MarketContext::contents
lists once it is supplied — so the row reads as the builder call that
would put it back. None for a refusal that is not a missing input.
Read through any trade the refusal is reported against. Exhaustive, so a new variant does not compile until someone decides; a binding raises a missing input as its own exception class.
pub fn is_unsolved(&self) -> bool
pub fn is_unsolved(&self) -> bool
Whether this refusal is a solve that found no answer — no root in its
bracket, or no convergence within its budget — read through any trade
it is reported against. Exhaustive, as
missing_input is.
§impl PricingError
impl PricingError
pub fn missing_cms_spread_correlation(first: &str, second: &str) -> Self
pub fn missing_cms_spread_correlation(first: &str, second: &str) -> Self
The refusal of a CMS spread correlation the market or the view does
not hold for the swap indices first and second, naming the pair in
the market’s order.
Trait Implementations§
§impl Clone for PricingError
impl Clone for PricingError
§fn clone(&self) -> PricingError
fn clone(&self) -> PricingError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for PricingError
impl Debug for PricingError
§impl Display for PricingError
impl Display for PricingError
§impl Error for PricingError
impl Error for PricingError
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()