hypercall_vol_oracle/
lib.rs1use async_trait::async_trait;
27use std::sync::Arc;
28use tokio::task::JoinHandle;
29
30pub mod blockscholes_oracle;
31pub mod blockscholes_types;
32pub mod databento_oracle;
33pub mod deribit_oracle;
34pub mod derive_oracle;
35pub mod fixed_oracle;
36pub mod polygon_oracle;
37pub mod polymarket_oracle;
38pub mod realized_vol_oracle;
39pub mod risk_oracle;
40pub mod routed_oracle;
41pub mod sticky_moneyness_oracle;
42pub mod vol_surface_cache;
43
44#[async_trait]
50pub trait PollingVolOracle: Send + Sync {
51 fn start_polling(self: Arc<Self>) -> JoinHandle<()>;
53
54 async fn get_vol(&self, symbol: &str, strike: f64, expiry: i64) -> Option<f64>;
56
57 async fn get_atm_vol(&self, symbol: &str, expiry: i64) -> Option<f64>;
59
60 async fn is_healthy(&self) -> bool;
62
63 async fn last_update_timestamp(&self) -> Option<i64>;
65}
66
67pub use blockscholes_oracle::{
68 BlockScholesVolOracle, BlockScholesVolOracleConfig, DEFAULT_CACHE_TTL_MS,
69};
70pub use blockscholes_types::{
71 BlockScholesMessage, BlockScholesSubscribe, VolSurfacePoint, VolSurfaceUpdateMessage,
72};
73pub use databento_oracle::{DatabentoVolOracle, DatabentoVolOracleConfig};
74pub use deribit_oracle::{DeribitVolOracle, DeribitVolOracleConfig, DEFAULT_DERIBIT_BASE_URL};
75pub use derive_oracle::{DeriveVolOracle, DeriveVolOracleConfig, DEFAULT_DERIVE_BASE_URL};
76pub use fixed_oracle::FixedTestRiskVolOracle;
77pub use polygon_oracle::{
78 PlatformSpotPrices, PolygonUnderlyingConfig, PolygonVolOracle, PolygonVolOracleConfig,
79 DEFAULT_POLYGON_BASE_URL,
80};
81pub use polymarket_oracle::{PolymarketVolOracle, PolymarketVolOracleConfig};
82pub use realized_vol_oracle::{RealizedVolOracle, RealizedVolOracleConfig};
83pub use risk_oracle::{
84 RiskVolOracle, RiskVolOracle as VolOracle, SharedRiskVolOracle, SharedVolOracle,
85 VolLookupError, VolOracleStatus, VolProviderKind, VolSurfaceSnapshot,
86};
87pub use routed_oracle::RoutedVolOracle;
88pub use sticky_moneyness_oracle::{StickyMoneynessVolOracle, StickyMoneynessVolOracleConfig};
89pub use vol_surface_cache::{DeltaCurveExport, DeltaIvExport, VolPoint, VolatilitySurface};