pub struct OracleManager;Implementations§
Source§impl OracleManager
impl OracleManager
Sourcepub fn validate_price(price_data: &PriceData, current_slot: u64) -> Result<()>
pub fn validate_price(price_data: &PriceData, current_slot: u64) -> Result<()>
Validate oracle price and confidence
Sourcepub fn aggregate_prices(
prices: &[PriceData],
config: &OracleConfig,
) -> Result<PriceData>
pub fn aggregate_prices( prices: &[PriceData], config: &OracleConfig, ) -> Result<PriceData>
Aggregate prices from multiple oracle sources
Sourcepub fn check_circuit_breaker(
previous_price: u64,
new_price: u64,
max_change_bps: u16,
) -> Result<bool>
pub fn check_circuit_breaker( previous_price: u64, new_price: u64, max_change_bps: u16, ) -> Result<bool>
Check if price movement exceeds circuit breaker threshold
Sourcepub fn normalize_price(
price: u64,
from_decimals: u8,
to_decimals: u8,
) -> Result<u64>
pub fn normalize_price( price: u64, from_decimals: u8, to_decimals: u8, ) -> Result<u64>
Calculate normalized price with specified decimals
Auto Trait Implementations§
impl Freeze for OracleManager
impl RefUnwindSafe for OracleManager
impl Send for OracleManager
impl Sync for OracleManager
impl Unpin for OracleManager
impl UnsafeUnpin for OracleManager
impl UnwindSafe for OracleManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more