pub struct L2Update {
pub product_id: String,
pub time: String,
pub changes: Vec<[String; 3]>,
}Expand description
Level 2 (L2) order book update from Coinbase Advanced Trading API.
This structure represents incremental changes to the order book that should be applied to maintain a real-time view of the market depth. Updates can include new orders, order cancellations, or order modifications.
§WebSocket Channel
This data is received via the level2 channel subscription.
§Update Processing
Changes should be applied in sequence order to maintain book integrity. A size of “0” indicates the price level should be removed from the book.
Fields§
§product_id: StringThe trading pair identifier (e.g., “BTC-USD”, “ETH-USD”)
time: StringISO 8601 timestamp when the update occurred
changes: Vec<[String; 3]>Array of changes as [side, price, size] tuples
- side: “buy” or “sell” indicating bid or ask side
- price: The price level being updated
- size: The new size at this price level (“0” means remove the level)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for L2Update
impl<'de> Deserialize<'de> for L2Update
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
Auto Trait Implementations§
impl Freeze for L2Update
impl RefUnwindSafe for L2Update
impl Send for L2Update
impl Sync for L2Update
impl Unpin for L2Update
impl UnwindSafe for L2Update
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