binance_client/websocket/event/
depth.rs

1//!
2//! The depth data, received via WebSocket.
3//!
4
5use serde::Deserialize;
6
7use crate::http_api_v3::data::depth_element::DepthElement;
8
9///
10/// The depth data, received via WebSocket.
11///
12#[derive(Debug, Deserialize, Clone)]
13pub struct Depth {
14    /// The trade event type. Usually equal to `depthUpdate`.
15    #[serde(rename = "e")]
16    pub event_type: String,
17    /// The trade event time in milliseconds since Unix epoch.
18    #[serde(rename = "E")]
19    pub event_time: i64,
20    /// The trading symbol name.
21    #[serde(rename = "s")]
22    pub symbol: String,
23    /// The first update ID.
24    #[serde(rename = "U")]
25    pub first_update_id: i64,
26    /// The last update ID.
27    #[serde(rename = "u")]
28    pub last_update_id: i64,
29    /// The orders below the current price.
30    #[serde(rename = "b")]
31    pub bids: Vec<DepthElement>,
32    /// The orders above the current price.
33    #[serde(rename = "a")]
34    pub asks: Vec<DepthElement>,
35}