pub struct WsOrderBook {
pub symbol: String,
pub asks: Vec<Ask>,
pub bids: Vec<Bid>,
pub update_id: u64,
pub seq: u64,
}Expand description
Structure for WebSocket order book data.
Contains the bids, asks, and sequence numbers for a trading pair’s order book. Bots use this to maintain an up-to-date view of market depth and liquidity.
Fields§
§symbol: StringThe trading pair symbol (e.g., “BTCUSDT”).
Identifies the perpetual futures contract for the order book. Bots use this to verify the correct market.
asks: Vec<Ask>A list of ask prices and quantities.
Contains the current ask levels in the order book, sorted by price. Bots use this to assess selling pressure and liquidity on the ask side.
bids: Vec<Bid>A list of bid prices and quantities.
Contains the current bid levels in the order book, sorted by price. Bots use this to assess buying pressure and liquidity on the bid side.
update_id: u64The update ID for the order book.
A unique identifier for the order book update. Bots use this to ensure updates are processed in the correct order.
seq: u64The sequence number for the update.
A monotonically increasing number for ordering updates. Bots use this to detect missing or out-of-order updates and maintain order book consistency.
Trait Implementations§
Source§impl Clone for WsOrderBook
impl Clone for WsOrderBook
Source§fn clone(&self) -> WsOrderBook
fn clone(&self) -> WsOrderBook
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more