Skip to main content

PollingVolOracle

Trait PollingVolOracle 

Source
pub trait PollingVolOracle: Send + Sync {
    // Required methods
    fn start_polling(self: Arc<Self>) -> JoinHandle<()>;
    fn get_vol<'life0, 'life1, 'async_trait>(
        &'life0 self,
        symbol: &'life1 str,
        strike: f64,
        expiry: i64,
    ) -> Pin<Box<dyn Future<Output = Option<f64>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn get_atm_vol<'life0, 'life1, 'async_trait>(
        &'life0 self,
        symbol: &'life1 str,
        expiry: i64,
    ) -> Pin<Box<dyn Future<Output = Option<f64>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn is_healthy<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn last_update_timestamp<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<i64>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Provider runtime trait for polling or streaming live volatility data.

This is intentionally separate from the engine-facing risk-vol lookup trait. Startup and provider implementations use this for provider lifecycle and direct surface inspection.

Required Methods§

Source

fn start_polling(self: Arc<Self>) -> JoinHandle<()>

Start the WebSocket connection and begin receiving volatility updates.

Source

fn get_vol<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, strike: f64, expiry: i64, ) -> Pin<Box<dyn Future<Output = Option<f64>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get the implied volatility for a specific point on the surface.

Source

fn get_atm_vol<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, expiry: i64, ) -> Pin<Box<dyn Future<Output = Option<f64>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get the ATM volatility for a symbol at a given expiry.

Source

fn is_healthy<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Check if the oracle is healthy.

Source

fn last_update_timestamp<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<i64>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get the last update timestamp in milliseconds.

Implementors§