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,
) -> BookSummary
pub fn new( instrument_name: String, base_currency: String, quote_currency: String, mark_price: f64, creation_timestamp: i64, ) -> BookSummary
Create a new book summary
Sourcepub fn with_volume(self, volume: f64, volume_usd: f64) -> BookSummary
pub fn with_volume(self, volume: f64, volume_usd: f64) -> BookSummary
Set volume information
Sourcepub fn with_prices(
self,
bid: Option<f64>,
ask: Option<f64>,
last: Option<f64>,
high: Option<f64>,
low: Option<f64>,
) -> BookSummary
pub fn with_prices( self, bid: Option<f64>, ask: Option<f64>, last: Option<f64>, high: Option<f64>, low: Option<f64>, ) -> BookSummary
Set price information
Sourcepub fn with_open_interest(self, open_interest: f64) -> BookSummary
pub fn with_open_interest(self, open_interest: f64) -> BookSummary
Set open interest
Sourcepub fn with_price_change(self, price_change: f64) -> BookSummary
pub fn with_price_change(self, price_change: f64) -> BookSummary
Set price change percentage
Sourcepub fn with_iv(self, mark_iv: f64) -> BookSummary
pub fn with_iv(self, mark_iv: f64) -> BookSummary
Set implied volatility (for options)
Sourcepub fn with_funding(self, current: f64, funding_8h: f64) -> BookSummary
pub fn with_funding(self, current: f64, funding_8h: f64) -> BookSummary
Set funding rates (for perpetuals)
Sourcepub fn with_delivery_price(self, price: f64) -> BookSummary
pub fn with_delivery_price(self, price: f64) -> BookSummary
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 more