Struct OpenRepo
pub struct OpenRepo {
pub repo: Repo,
pub calendar: String,
}Expand description
An open repo: booked with no far date, either side able to end it on a business day’s notice. On any day it is the repo that ends on the next business day of its calendar — the cash and its interest from the start, back the day after — and is valued, risked and tabled as that repo.
Fields§
§repo: RepoThe repo as booked, ending on the business day after its start.
calendar: StringThe calendar, by code, its next business day is counted on.
Implementations§
§impl OpenRepo
impl OpenRepo
pub fn new(repo: Repo, calendar: impl Into<String>) -> Result<Self, RepoError>
pub fn new(repo: Repo, calendar: impl Into<String>) -> Result<Self, RepoError>
repo held open, its far date rolled on calendar (a calendar code).
The booked far date is replaced: the repo ends on the business day
after its start until a later valuation moves it.
§Errors
RepoError::Malformed for interim interest dates, which an open repo
has none of; otherwise as rebuilding the repo to that end.
Trait Implementations§
§impl<R: Scalar> Priceable<R> for OpenRepo
impl<R: Scalar> Priceable<R> for OpenRepo
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The repo ending on the next business day after the valuation.
§fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The rate at which that repo is worth nothing.
§fn par_spread(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
That repo’s par spread.
§impl PricingRiskFactors for OpenRepo
impl PricingRiskFactors for OpenRepo
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
The repo’s own: its far date changes nothing it reads.
§impl Product for OpenRepo
impl Product for OpenRepo
§fn restruck_at_rate(&self, rate: f64) -> Option<AnyInstrument>
fn restruck_at_rate(&self, rate: f64) -> Option<AnyInstrument>
rate — the scalar a par
calibration rung on it is quoted in — or None for a product that
carries no such scalar. What a quote scenario moves a rung to.§fn currency(&self) -> Currency
fn currency(&self) -> Currency
§fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
(name, date) pairs —
exactly the dates its stated constructor takes, so a product built
through a derived form can be read back and rebuilt through the stated
one. Empty for a product with no stated form. No default: every
product states which it is — see AnyInstrument::contract_dates.§fn legs(&self) -> Option<Vec<&Leg>>
fn legs(&self) -> Option<Vec<&Leg>>
None
for a product that holds none — see AnyInstrument::legs. No
default: every product states which it is.§fn final_payment_date(&self) -> Option<NaiveDate>
fn final_payment_date(&self) -> Option<NaiveDate>
None for a product no ladder is built from.§fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
spread on its spread
leg, or None for a product that quotes none.