Skip to main content

Priceable

Trait Priceable 

pub trait Priceable<R: Scalar>: PricingRiskFactors {
    // Required methods
    fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>;
    fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>;

    // Provided method
    fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError> { ... }
}
Expand description

A product priced through the seam, in one mode.

One implementation per product, generic over R — never one per mode. A pricing body written against the mode is the whole point of the seam.

Required Methods§

fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>

Present value against the resolved market view.

§Errors

PricingError for a missing curve, an unresolvable key, an out-of-range query, or a product arm the entry point does not serve.

fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>

The par rate — the fixed rate at which the product is worth nothing.

§Errors

As npv.

Provided Methods§

fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>

The par (breakeven) floating-leg spread. Zero for a product with no floating leg.

§Errors

As npv.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl<R: Scalar> Priceable<R> for AnyInstrument

§

impl<R: Scalar> Priceable<R> for AssetSwap

§

impl<R: Scalar> Priceable<R> for BermudanSwaption

§

impl<R: Scalar> Priceable<R> for BondForward

§

impl<R: Scalar> Priceable<R> for BondFutureOption

§

impl<R: Scalar> Priceable<R> for BondFuturePosition

§

impl<R: Scalar> Priceable<R> for BondOption

§

impl<R: Scalar> Priceable<R> for BondTotalReturnSwap

§

impl<R: Scalar> Priceable<R> for CallableBond

§

impl<R: Scalar> Priceable<R> for CallableLoan

§

impl<R: Scalar> Priceable<R> for CallableSwap

§

impl<R: Scalar> Priceable<R> for CdoTranche

§

impl<R: Scalar> Priceable<R> for CmsSwap

§

impl<R: Scalar> Priceable<R> for CreditDefaultSwap

§

impl<R: Scalar> Priceable<R> for CreditDefaultSwapOption

§

impl<R: Scalar> Priceable<R> for CreditLinkedNote

§

impl<R: Scalar> Priceable<R> for CreditLinkedSwap

§

impl<R: Scalar> Priceable<R> for CrossCurrencyAssetSwap

§

impl<R: Scalar> Priceable<R> for CrossCurrencySwap

§

impl<R: Scalar> Priceable<R> for CurvePin

§

impl<R: Scalar> Priceable<R> for EquityOption

§

impl<R: Scalar> Priceable<R> for EquityTotalReturnSwap

§

impl<R: Scalar> Priceable<R> for EuropeanSwaption

§

impl<R: Scalar> Priceable<R> for Fee

§

impl<R: Scalar> Priceable<R> for FloatingRateNote

§

impl<R: Scalar> Priceable<R> for ForwardRateAgreement

§

impl<R: Scalar> Priceable<R> for FxForward

§

impl<R: Scalar> Priceable<R> for FxOption

§

impl<R: Scalar> Priceable<R> for FxSwap

§

impl<R: Scalar> Priceable<R> for IndexCreditDefaultSwap

§

impl<R: Scalar> Priceable<R> for InflationLinkedBond

§

impl<R: Scalar> Priceable<R> for InterestRateCapFloor

§

impl<R: Scalar> Priceable<R> for Loan

§

impl<R: Scalar> Priceable<R> for MoneyMarketDeposit

§

impl<R: Scalar> Priceable<R> for NthToDefaultSwap

§

impl<R: Scalar> Priceable<R> for OpenRepo

§

impl<R: Scalar> Priceable<R> for OvernightIndexedSwap

§

impl<R: Scalar> Priceable<R> for PaymentInKindBond

§

impl<R: Scalar> Priceable<R> for RateFuture

§

impl<R: Scalar> Priceable<R> for RepackNote

§

impl<R: Scalar> Priceable<R> for Repo

§

impl<R: Scalar> Priceable<R> for SecuritiesLoan

§

impl<R: Scalar> Priceable<R> for Straddle

§

impl<R: Scalar> Priceable<R> for StructuredNote

§

impl<R: Scalar> Priceable<R> for TenorBasisSwap

§

impl<R: Scalar> Priceable<R> for Trade

§

impl<R: Scalar> Priceable<R> for TriPartyRepo

§

impl<R: Scalar> Priceable<R> for VanillaSwap

§

impl<R: Scalar> Priceable<R> for YoyInflationCapFloor

§

impl<R: Scalar> Priceable<R> for YoyInflationSwap

§

impl<R: Scalar> Priceable<R> for ZeroCouponBond

§

impl<R: Scalar> Priceable<R> for ZeroCouponInflationCapFloor

§

impl<R: Scalar> Priceable<R> for ZeroCouponInflationSwap

§

impl<R: Scalar> Priceable<R> for ZeroCouponSwap