pub struct ParsedFeedPayload {Show 14 fields
pub price_feed_id: PriceFeedId,
pub price: Option<Price>,
pub best_bid_price: Option<Price>,
pub best_ask_price: Option<Price>,
pub publisher_count: Option<u16>,
pub exponent: Option<i16>,
pub confidence: Option<Price>,
pub funding_rate: Option<Rate>,
pub funding_timestamp: Option<TimestampUs>,
pub funding_rate_interval: Option<DurationUs>,
pub market_session: Option<MarketSession>,
pub ema_price: Option<Price>,
pub ema_confidence: Option<Price>,
pub feed_update_timestamp: Option<TimestampUs>,
}Expand description
Parsed representation of a feed update.
Fields§
§price_feed_id: PriceFeedIdFeed ID.
price: Option<Price>For price feeds: main price. For funding rate feeds: funding price.
Only present if the price property was specified
in the SubscriptionRequest and the value is currently available for this price feed.
best_bid_price: Option<Price>Best bid price for this price feed. Only present if the bestBidPrice property
was specified in the SubscriptionRequest and this is a price feed and
the value is currently available for this price feed.
best_ask_price: Option<Price>Best ask price for this price feed. Only present if the bestAskPrice property was
specified in the SubscriptionRequest and this is a price feed and
the value is currently available for this price feed.
publisher_count: Option<u16>Number of publishers contributing to this feed update. Only present if the publisherCount
property was specified in the SubscriptionRequest.
exponent: Option<i16>Exponent for this feed. Only present if the exponent property was specified
in the SubscriptionRequest. Each decimal field provided by the feed (price, fundingRate, etc)
returns the mantissa of the value. The actual value can be calculated as
mantissa * 10^exponent.
confidence: Option<Price>Confidence for this price feed. Only present if the confidence property was
specified in the SubscriptionRequest and this is a price feed and
the value is currently available for this price feed.
funding_rate: Option<Rate>Perpetual future funding rate for this feed.
Only present if the fundingRate property was specified in the SubscriptionRequest
and this is a funding rate feed
and the value is currently available for this price feed.
funding_timestamp: Option<TimestampUs>Most recent perpetual future funding rate timestamp for this feed.
Only present if the fundingTimestamp property was specified in the SubscriptionRequest
and this is a funding rate feed
and the value is currently available for this price feed.
funding_rate_interval: Option<DurationUs>Duration, in microseconds, between consecutive funding rate updates for this price feed.
Only present if the fundingRateInterval property was requested in the SubscriptionRequest
and this is a funding rate feed and the value is defined for that feed.
market_session: Option<MarketSession>Market session for this price feed. Only present if the marketSession property was specified
in the SubscriptionRequest.
ema_price: Option<Price>Exponential moving average of the main price for this price feeds.
Only present if the emaPrice property was specified
in the SubscriptionRequest and this is a price feed
and the value is currently available for this price feed.
ema_confidence: Option<Price>Exponential moving average of the confidence for this price feeds.
Only present if the emaConfidence property was specified
in the SubscriptionRequest and this is a price feed
and the value is currently available for this price feed.
feed_update_timestamp: Option<TimestampUs>Implementations§
Source§impl ParsedFeedPayload
impl ParsedFeedPayload
pub fn new( price_feed_id: PriceFeedId, data: &AggregatedPriceFeedData, properties: &[PriceFeedProperty], ) -> Self
pub fn new_full( price_feed_id: PriceFeedId, exponent: Option<i16>, data: &AggregatedPriceFeedData, ) -> Self
Trait Implementations§
Source§impl Clone for ParsedFeedPayload
impl Clone for ParsedFeedPayload
Source§fn clone(&self) -> ParsedFeedPayload
fn clone(&self) -> ParsedFeedPayload
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParsedFeedPayload
impl Debug for ParsedFeedPayload
Source§impl<'de> Deserialize<'de> for ParsedFeedPayload
impl<'de> Deserialize<'de> for ParsedFeedPayload
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>,
Source§impl Hash for ParsedFeedPayload
impl Hash for ParsedFeedPayload
Source§impl PartialEq for ParsedFeedPayload
impl PartialEq for ParsedFeedPayload
Source§impl Serialize for ParsedFeedPayload
impl Serialize for ParsedFeedPayload
impl Eq for ParsedFeedPayload
impl StructuralPartialEq for ParsedFeedPayload
Auto Trait Implementations§
impl Freeze for ParsedFeedPayload
impl RefUnwindSafe for ParsedFeedPayload
impl Send for ParsedFeedPayload
impl Sync for ParsedFeedPayload
impl Unpin for ParsedFeedPayload
impl UnsafeUnpin for ParsedFeedPayload
impl UnwindSafe for ParsedFeedPayload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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