pub enum DeriveTickerData {
Envelope {
timestamp: i64,
instrument_ticker: DeriveTicker,
},
SlimEnvelope {
timestamp: i64,
instrument_ticker: DeriveTickerSnapshot,
},
Ticker(DeriveTicker),
}Expand description
Ticker payload shape pushed by the Derive ticker channels.
Variants§
Envelope
Full ticker shape with a feed timestamp and nested ticker snapshot.
Fields
instrument_ticker: DeriveTickerFull instrument ticker snapshot.
SlimEnvelope
Compact ticker shape with a feed timestamp and nested ticker snapshot.
Fields
instrument_ticker: DeriveTickerSnapshotCompact instrument ticker snapshot.
Ticker(DeriveTicker)
Legacy shape where params.data is the ticker object itself.
Implementations§
Source§impl DeriveTickerData
impl DeriveTickerData
Sourcepub fn instrument_name(&self) -> &Ustr
pub fn instrument_name(&self) -> &Ustr
Returns the ticker instrument name.
Sourcepub fn best_ask_price(&self) -> Decimal
pub fn best_ask_price(&self) -> Decimal
Returns the best ask price.
Sourcepub fn best_bid_price(&self) -> Decimal
pub fn best_bid_price(&self) -> Decimal
Returns the best bid price.
Sourcepub fn best_ask_amount(&self) -> Decimal
pub fn best_ask_amount(&self) -> Decimal
Returns the best ask amount.
Sourcepub fn best_bid_amount(&self) -> Decimal
pub fn best_bid_amount(&self) -> Decimal
Returns the best bid amount.
Sourcepub fn mark_price(&self) -> Decimal
pub fn mark_price(&self) -> Decimal
Returns the current mark price.
Sourcepub fn index_price(&self) -> Decimal
pub fn index_price(&self) -> Decimal
Returns the current index price.
Sourcepub fn funding_rate(&self) -> Option<Decimal>
pub fn funding_rate(&self) -> Option<Decimal>
Returns the current funding rate when the ticker carries one.
Sourcepub fn option_pricing(&self) -> Option<&DeriveOptionPricing>
pub fn option_pricing(&self) -> Option<&DeriveOptionPricing>
Returns option pricing fields when the ticker carries them.
Sourcepub fn stats(&self) -> Option<&DeriveAggregateTradingStats>
pub fn stats(&self) -> Option<&DeriveAggregateTradingStats>
Returns 24-hour aggregate statistics when the ticker carries them.
Sourcepub fn apply_channel_context(&mut self, channel: &str) -> Result<(), String>
pub fn apply_channel_context(&mut self, channel: &str) -> Result<(), String>
Fills compact ticker context that the venue omits from ticker_slim.
§Errors
Returns an error when a compact ticker is received on an invalid channel.
Sourcepub fn instrument_id(&self) -> InstrumentId
pub fn instrument_id(&self) -> InstrumentId
Returns the Nautilus instrument ID for this Derive symbol.
Trait Implementations§
Source§impl Clone for DeriveTickerData
impl Clone for DeriveTickerData
Source§fn clone(&self) -> DeriveTickerData
fn clone(&self) -> DeriveTickerData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeriveTickerData
impl Debug for DeriveTickerData
Source§impl<'de> Deserialize<'de> for DeriveTickerData
impl<'de> Deserialize<'de> for DeriveTickerData
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>,
Auto Trait Implementations§
impl Freeze for DeriveTickerData
impl RefUnwindSafe for DeriveTickerData
impl Send for DeriveTickerData
impl Sync for DeriveTickerData
impl Unpin for DeriveTickerData
impl UnsafeUnpin for DeriveTickerData
impl UnwindSafe for DeriveTickerData
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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