pub struct TradeStreamEvent {
pub req_id: Option<String>,
pub ret_code: i32,
pub ret_msg: String,
pub op: String,
pub data: OrderStatus,
pub header: Header,
pub conn_id: String,
}Expand description
Structure for trade stream events received via WebSocket.
Contains real-time trade stream data, including order status updates and API rate limit metadata. Bots use this for high-frequency trading and low-latency order monitoring in perpetual futures markets.
Fields§
§req_id: Option<String>The request ID for the trade stream event (optional).
A unique identifier for the request that triggered this event, if applicable. Bots use this to correlate events with specific requests.
ret_code: i32The return code for the event.
Indicates the status of the event (e.g., 0 for success). Bots should check this to handle errors or confirm successful updates.
ret_msg: StringA message describing the event.
Provides context for the ret_code, such as "OK" or an error description. Bots should log this for debugging.
op: StringThe operation type (e.g., “trade”).
Specifies the type of trade stream event, typically "trade". Bots use this to confirm the event type.
data: OrderStatusThe order status data for the event.
Contains detailed order status updates, such as filled or cancelled orders. Bots use this to track order progress in real time.
header: HeaderThe API response header.
Contains rate limit and timing metadata for the API response. Bots use this to manage API usage and ensure compliance with rate limits.
conn_id: StringThe WebSocket connection ID.
A unique identifier for the WebSocket connection. Bots use this to track specific connections in multi-connection setups.
Trait Implementations§
Source§impl Clone for TradeStreamEvent
impl Clone for TradeStreamEvent
Source§fn clone(&self) -> TradeStreamEvent
fn clone(&self) -> TradeStreamEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more