Skip to main content

npv

Function npv 

pub fn npv(
    market: &MarketContext,
    book: &[AnyInstrument],
) -> Result<f64, PricingError>
Expand description

The value of one book against market, with no derivatives taken.

The value-only path: the passive lift borrows, the views borrow, and nothing per-curve is allocated for parameters.

The sum is a single-currency sum. A slice spanning currencies is refused — this entry point has no channel to declare a reporting currency, so use Book with reporting_in for a mixed book rather than getting a number in mixed units.

§Errors

PricingError from the resolution or the pricers, and PricingError::MixedCurrencyBook if the products disagree on currency.