pub struct OracleTask {
pub pyth_allowed_confidence_interval: Option<f64>,
pub aggregator_address: Option<AggregatorAddress>,
}
Expand description
Fetch the current price of a Solana oracle protocol.
Input: None
Returns: The current price of an on-chain oracle.
Example: The Switchboard SOL/USD oracle price.
{ "oracleTask": { "switchboardAddress": "GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR" } }
Example: The Pyth SOL/USD oracle price.
{ "oracleTask": { "pythAddress": "H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG" } }
Example: The Chainlink SOL/USD oracle price.
{ "oracleTask": { "chainlinkAddress": "CcPVS9bqyXbD9cLnTbhhHazLsrua8QMFUHTutPtjyDzq" } }
Fields§
§pyth_allowed_confidence_interval: Option<f64>
/ Value (as a percentage) that the lower bound confidence interval is of the actual value. / Confidence intervals that are larger that this treshold are rejected.
aggregator_address: Option<AggregatorAddress>
Implementations§
Source§impl OracleTask
impl OracleTask
Sourcepub fn pyth_allowed_confidence_interval(&self) -> f64
pub fn pyth_allowed_confidence_interval(&self) -> f64
Returns the value of pyth_allowed_confidence_interval
, or the default value if pyth_allowed_confidence_interval
is unset.
Trait Implementations§
Source§impl Clone for OracleTask
impl Clone for OracleTask
Source§fn clone(&self) -> OracleTask
fn clone(&self) -> OracleTask
Returns a duplicate 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 Debug for OracleTask
impl Debug for OracleTask
Source§impl Default for OracleTask
impl Default for OracleTask
Source§impl Message for OracleTask
impl Message for OracleTask
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes a length-delimited instance of the message from buffer, and
merges it into
self
.Source§impl PartialEq for OracleTask
impl PartialEq for OracleTask
impl StructuralPartialEq for OracleTask
Auto Trait Implementations§
impl Freeze for OracleTask
impl RefUnwindSafe for OracleTask
impl Send for OracleTask
impl Sync for OracleTask
impl Unpin for OracleTask
impl UnwindSafe for OracleTask
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