pub struct OrderEvent {
pub id: String,
pub topic: String,
pub creation_time: u64,
pub data: Vec<OrderData>,
}Expand description
Represents an event containing order updates from Bybit’s WebSocket API.
This struct is used to receive real-time order updates via Bybit’s private WebSocket stream (https://bybit-exchange.github.io/docs/v5/websocket/private/order). In perpetual futures trading, real-time order events are critical for bots to react to market changes, manage positions, and execute strategies dynamically.
Fields§
§id: StringUnique identifier for the WebSocket event.
This ID allows bots to track and correlate WebSocket messages, ensuring no events are missed or duplicated.
Bot Implication: Bots use id to maintain message integrity and debug WebSocket connectivity issues.
topic: StringThe WebSocket topic, e.g., “order”.
This identifies the type of data in the event, allowing bots to route messages to the appropriate handler (https://bybit-exchange.github.io/docs/v5/websocket/private/order).
Bot Implication: Bots filter on topic to process order updates efficiently, ignoring irrelevant streams.
creation_time: u64Timestamp of the event, in milliseconds since Unix epoch.
This records when the event was generated by Bybit, critical for latency analysis and event sequencing (https://bybit-exchange.github.io/docs/v5/websocket/private/order).
Bot Implication: Bots use creation_time to measure system performance and ensure timely processing of order updates.
data: Vec<OrderData>List of order data updates included in the event.
This contains one or more OrderData structs, each representing an updated order (https://bybit-exchange.github.io/docs/v5/websocket/private/order).
Bot Implication: Bots iterate through data to process multiple order updates in a single event, optimizing performance in high-frequency trading.
Trait Implementations§
Source§impl Clone for OrderEvent
impl Clone for OrderEvent
Source§fn clone(&self) -> OrderEvent
fn clone(&self) -> OrderEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more