pub struct BookSummary {Show 22 fields
pub instrument_name: String,
pub base_currency: String,
pub quote_currency: String,
pub volume: f64,
pub volume_usd: f64,
pub open_interest: f64,
pub price_change: Option<f64>,
pub mark_price: f64,
pub mark_iv: Option<f64>,
pub bid_price: Option<f64>,
pub ask_price: Option<f64>,
pub mid_price: Option<f64>,
pub last: Option<f64>,
pub high: Option<f64>,
pub low: Option<f64>,
pub estimated_delivery_price: Option<f64>,
pub current_funding: Option<f64>,
pub funding_8h: Option<f64>,
pub creation_timestamp: i64,
pub underlying_index: Option<String>,
pub underlying_price: Option<f64>,
pub interest_rate: Option<f64>,
}Expand description
Book summary information for an instrument
Fields§
§instrument_name: StringInstrument name
base_currency: StringBase currency
quote_currency: StringQuote currency (usually USD)
volume: f6424h trading volume
volume_usd: f6424h trading volume in USD
open_interest: f64Open interest
price_change: Option<f64>24h price change percentage
mark_price: f64Current mark price
mark_iv: Option<f64>Mark implied volatility (options only)
bid_price: Option<f64>Best bid price
ask_price: Option<f64>Best ask price
mid_price: Option<f64>Mid price (bid + ask) / 2
last: Option<f64>Last trade price
high: Option<f64>24h high price
low: Option<f64>24h low price
estimated_delivery_price: Option<f64>Estimated delivery price
current_funding: Option<f64>Current funding rate (perpetuals only)
funding_8h: Option<f64>8h funding rate (perpetuals only)
creation_timestamp: i64Creation timestamp (milliseconds since Unix epoch)
underlying_index: Option<String>Underlying index name
underlying_price: Option<f64>Underlying price
interest_rate: Option<f64>Interest rate
Implementations§
Source§impl BookSummary
impl BookSummary
Sourcepub fn new(
instrument_name: String,
base_currency: String,
quote_currency: String,
mark_price: f64,
creation_timestamp: i64,
) -> Self
pub fn new( instrument_name: String, base_currency: String, quote_currency: String, mark_price: f64, creation_timestamp: i64, ) -> Self
Create a new book summary
Sourcepub fn with_volume(self, volume: f64, volume_usd: f64) -> Self
pub fn with_volume(self, volume: f64, volume_usd: f64) -> Self
Set volume information
Sourcepub fn with_prices(
self,
bid: Option<f64>,
ask: Option<f64>,
last: Option<f64>,
high: Option<f64>,
low: Option<f64>,
) -> Self
pub fn with_prices( self, bid: Option<f64>, ask: Option<f64>, last: Option<f64>, high: Option<f64>, low: Option<f64>, ) -> Self
Set price information
Sourcepub fn with_open_interest(self, open_interest: f64) -> Self
pub fn with_open_interest(self, open_interest: f64) -> Self
Set open interest
Sourcepub fn with_price_change(self, price_change: f64) -> Self
pub fn with_price_change(self, price_change: f64) -> Self
Set price change percentage
Sourcepub fn with_funding(self, current: f64, funding_8h: f64) -> Self
pub fn with_funding(self, current: f64, funding_8h: f64) -> Self
Set funding rates (for perpetuals)
Sourcepub fn with_delivery_price(self, price: f64) -> Self
pub fn with_delivery_price(self, price: f64) -> Self
Set estimated delivery price
Sourcepub fn spread_percentage(&self) -> Option<f64>
pub fn spread_percentage(&self) -> Option<f64>
Get spread percentage
Sourcepub fn is_perpetual(&self) -> bool
pub fn is_perpetual(&self) -> bool
Check if this is a perpetual contract
Sourcepub fn price_change_absolute(&self) -> Option<f64>
pub fn price_change_absolute(&self) -> Option<f64>
Get 24h price change in absolute terms
Trait Implementations§
Source§impl Clone for BookSummary
impl Clone for BookSummary
Source§fn clone(&self) -> BookSummary
fn clone(&self) -> BookSummary
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BookSummary
impl Debug for BookSummary
Source§impl<'de> Deserialize<'de> for BookSummary
impl<'de> Deserialize<'de> for BookSummary
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 Display for BookSummary
impl Display for BookSummary
Source§impl PartialEq for BookSummary
impl PartialEq for BookSummary
Source§impl Serialize for BookSummary
impl Serialize for BookSummary
impl StructuralPartialEq for BookSummary
Auto Trait Implementations§
impl Freeze for BookSummary
impl RefUnwindSafe for BookSummary
impl Send for BookSummary
impl Sync for BookSummary
impl Unpin for BookSummary
impl UnwindSafe for BookSummary
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.