pub struct PositionEvent {
pub id: String,
pub topic: String,
pub creation_time: u64,
pub data: Vec<PositionData>,
}Expand description
Represents a position event in Bybit’s perpetual futures market.
This struct is used in WebSocket streams to provide updates about a user’s open positions, including size, leverage, and profit/loss.
§Bybit API Reference
The Bybit API (https://bybit-exchange.github.io/docs/v5/websocket/private/position) provides position data via WebSocket.
§Perpetual Futures Context
Positions in perpetual futures represent a trader’s exposure to a market. Bots monitor position updates to manage risk, adjust leverage, or trigger stop-loss/take-profit orders.
Fields§
§id: StringThe unique identifier for the position event.
Used to track specific position updates. Bots can use this to correlate events with internal state.
topic: StringThe WebSocket topic (e.g., “position”).
Identifies the position data stream. Bots use this to filter relevant messages.
creation_time: u64The timestamp when the event was created (in milliseconds).
Indicates when the position update occurred. Bots use this for time-based analysis.
data: Vec<PositionData>The position data for the event.
Contains details about the user’s positions. Bots process this to manage open trades.
Trait Implementations§
Source§impl Clone for PositionEvent
impl Clone for PositionEvent
Source§fn clone(&self) -> PositionEvent
fn clone(&self) -> PositionEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more