Struct devol_accounts_kit::accounts::oracles::oracles_data::OracleData
source · #[repr(C)]pub struct OracleData {
pub base_ticker: [u8; 8],
pub relative_ticker: [u8; 8],
pub configured: bool,
pub use_relative_oracle: bool,
pub relative_oracle_num: u8,
pub reserved: u8,
pub max_price_deviation: u32,
pub params: [OracleParams; 3],
}Fields§
§base_ticker: [u8; 8]§relative_ticker: [u8; 8]§configured: bool§use_relative_oracle: bool§relative_oracle_num: u8§reserved: u8§max_price_deviation: u32§params: [OracleParams; 3]Implementations§
source§impl OracleData
impl OracleData
sourcepub fn get_asset_price(
&self,
ext_oracles_accounts: &[AccountInfo<'_>]
) -> Result<f64, DvlError>
pub fn get_asset_price( &self, ext_oracles_accounts: &[AccountInfo<'_>] ) -> Result<f64, DvlError>
Calculates the asset price based on oracle data Returns Result<(f64, DvlError), ProgramError> where f64 is the average price
Trait Implementations§
source§impl Clone for OracleData
impl Clone for OracleData
source§fn clone(&self) -> OracleData
fn clone(&self) -> OracleData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<'de> Deserialize<'de> for OracleData
impl<'de> Deserialize<'de> for OracleData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for OracleData
impl Serialize for OracleData
impl Copy for OracleData
Auto Trait Implementations§
impl Freeze for OracleData
impl RefUnwindSafe for OracleData
impl Send for OracleData
impl Sync for OracleData
impl Unpin for OracleData
impl UnwindSafe for OracleData
Blanket Implementations§
source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, digester: &mut AbiDigester ) -> Result<AbiDigester, DigestError>
source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester ) -> Result<AbiDigester, DigestError>
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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