pub struct AggTrade {
pub agg_trade_id: i64,
pub price: FixedPoint,
pub volume: FixedPoint,
pub first_trade_id: i64,
pub last_trade_id: i64,
pub timestamp: i64,
pub is_buyer_maker: bool,
pub is_best_match: Option<bool>,
}Expand description
Aggregate trade data from Binance markets
Represents a single AggTrade record which aggregates multiple individual exchange trades that occurred at the same price within ~100ms timeframe.
Fields§
§agg_trade_id: i64Aggregate trade ID (unique per AggTrade record)
price: FixedPointPrice as fixed-point integer
volume: FixedPointVolume as fixed-point integer (total quantity across all individual trades)
first_trade_id: i64First individual trade ID in this aggregation
last_trade_id: i64Last individual trade ID in this aggregation
timestamp: i64Timestamp in microseconds (preserves maximum precision)
is_buyer_maker: boolWhether buyer is market maker (true = sell pressure, false = buy pressure) Critical for order flow analysis and market microstructure
is_best_match: Option<bool>Whether trade was best price match (Spot market only) None for futures markets, Some(bool) for spot markets
Implementations§
Source§impl AggTrade
impl AggTrade
Sourcepub fn individual_trade_count(&self) -> i64
pub fn individual_trade_count(&self) -> i64
Number of individual exchange trades in this aggregated record
Each AggTrade record represents multiple individual trades that occurred at the same price within the same ~100ms window on the exchange. Issue #96: #[inline] for per-trade hot path (called in OpenDeviationBar::new + update_with_trade)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AggTrade
impl<'de> Deserialize<'de> for AggTrade
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AggTrade, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AggTrade, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<&AggTrade> for TradeSnapshot
impl From<&AggTrade> for TradeSnapshot
Source§fn from(trade: &AggTrade) -> TradeSnapshot
fn from(trade: &AggTrade) -> TradeSnapshot
Source§impl Serialize for AggTrade
impl Serialize for AggTrade
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for AggTrade
impl RefUnwindSafe for AggTrade
impl Send for AggTrade
impl Sync for AggTrade
impl Unpin for AggTrade
impl UnsafeUnpin for AggTrade
impl UnwindSafe for AggTrade
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