pub struct MarketStatistics {
pub currency: String,
pub volume_24h: f64,
pub volume_30d: f64,
pub volume_usd_24h: f64,
pub volume_usd_30d: f64,
pub trades_count_24h: i64,
pub trades_count_30d: i64,
pub open_interest: f64,
pub timestamp: i64,
}Expand description
Market statistics
Fields§
§currency: StringCurrency
volume_24h: f64Total volume 24h
volume_30d: f64Total volume 30d
volume_usd_24h: f64Volume in USD 24h
volume_usd_30d: f64Volume in USD 30d
trades_count_24h: i64Number of trades 24h
trades_count_30d: i64Number of trades 30d
open_interest: f64Open interest
timestamp: i64Timestamp (milliseconds since Unix epoch)
Implementations§
Source§impl MarketStatistics
impl MarketStatistics
Sourcepub fn with_volume(
self,
vol_24h: f64,
vol_30d: f64,
vol_usd_24h: f64,
vol_usd_30d: f64,
) -> Self
pub fn with_volume( self, vol_24h: f64, vol_30d: f64, vol_usd_24h: f64, vol_usd_30d: f64, ) -> Self
Set volume data
Sourcepub fn with_trades(self, trades_24h: i64, trades_30d: i64) -> Self
pub fn with_trades(self, trades_24h: i64, trades_30d: i64) -> Self
Set trade counts
Sourcepub fn with_open_interest(self, oi: f64) -> Self
pub fn with_open_interest(self, oi: f64) -> Self
Set open interest
Sourcepub fn avg_trade_size_24h(&self) -> f64
pub fn avg_trade_size_24h(&self) -> f64
Calculate average trade size 24h
Sourcepub fn avg_trade_size_30d(&self) -> f64
pub fn avg_trade_size_30d(&self) -> f64
Calculate average trade size 30d
Sourcepub fn volume_growth_rate(&self) -> f64
pub fn volume_growth_rate(&self) -> f64
Calculate volume growth (30d vs 24h annualized)
Trait Implementations§
Source§impl Clone for MarketStatistics
impl Clone for MarketStatistics
Source§fn clone(&self) -> MarketStatistics
fn clone(&self) -> MarketStatistics
Returns a duplicate 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 MarketStatistics
impl Debug for MarketStatistics
Source§impl<'de> Deserialize<'de> for MarketStatistics
impl<'de> Deserialize<'de> for MarketStatistics
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MarketStatistics
impl Display for MarketStatistics
Source§impl PartialEq for MarketStatistics
impl PartialEq for MarketStatistics
Source§impl Serialize for MarketStatistics
impl Serialize for MarketStatistics
impl StructuralPartialEq for MarketStatistics
Auto Trait Implementations§
impl Freeze for MarketStatistics
impl RefUnwindSafe for MarketStatistics
impl Send for MarketStatistics
impl Sync for MarketStatistics
impl Unpin for MarketStatistics
impl UnwindSafe for MarketStatistics
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
Mutably borrows from an owned value. Read more