Struct switchboard_utils::protos::oracle_job::OracleTask
source · 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 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 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
source§fn eq(&self, other: &OracleTask) -> bool
fn eq(&self, other: &OracleTask) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for OracleTask
Auto Trait Implementations§
impl RefUnwindSafe for OracleTask
impl Send for OracleTask
impl Sync for OracleTask
impl Unpin for OracleTask
impl UnwindSafe for OracleTask
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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