Skip to main content

VolOracle

Trait VolOracle 

Source
pub trait VolOracle: Send + Sync {
    // Required methods
    fn get_iv(
        &self,
        underlying: &str,
        strike: f64,
        expiry_ts: i64,
    ) -> Result<f64, VolLookupError>;
    fn statuses(&self) -> Vec<VolOracleStatus>;

    // Provided methods
    fn get_surface_snapshot(
        &self,
        _underlying: &str,
    ) -> Option<VolSurfaceSnapshot> { ... }
    fn supports_surface_snapshots(&self) -> bool { ... }
}

Required Methods§

Source

fn get_iv( &self, underlying: &str, strike: f64, expiry_ts: i64, ) -> Result<f64, VolLookupError>

Source

fn statuses(&self) -> Vec<VolOracleStatus>

Provided Methods§

Source

fn get_surface_snapshot(&self, _underlying: &str) -> Option<VolSurfaceSnapshot>

Return a full snapshot of the vol surface for the given underlying.

Source

fn supports_surface_snapshots(&self) -> bool

Whether this oracle can produce surface snapshots once its feeds are ready.

This is capability, not current readiness. Startup wiring must not depend on whether a feed has already populated a surface at builder time.

Implementors§