Skip to main content

anbima_yield_from_price

Function anbima_yield_from_price 

pub fn anbima_yield_from_price(
    bond: &InflationLinkedBond,
    convention: LinkerConvention,
    price: f64,
    settlement: NaiveDate,
    vna: f64,
    calendar: &dyn Calendar,
) -> Result<f64, LinkerQuoteError>
Expand description

The real yield implied by an ANBIMA unit price, by bisection over the exact truncation chain.

The chain makes the price a step function of the yield, so the solve lands on the step containing the quote rather than on a point where the residual vanishes. That is the market’s own arithmetic and not a defect: a quotation truncated to four places cannot distinguish yields finer than its last step.

§Errors

LinkerQuoteError::WrongFamily outside the ANBIMA convention; LinkerQuoteError::Solve when no yield reproduces the price.