Skip to main content

WebsocketEvents

Enum WebsocketEvents 

Source
pub enum WebsocketEvents {
Show 17 variants OrderBookEvent(OrderBookUpdate), RPIOrderBookEvent(RPIOrderbookUpdate), TradeEvent(TradeUpdate), TickerEvent(WsTicker), LiquidationEvent(Liquidation), AllLiquidationEvent(AllLiquidationUpdate), KlineEvent(WsKline), InsurancePoolEvent(InsurancePoolUpdate), PriceLimitEvent(PriceLimitUpdate), ADLAlertEvent(ADLAlertUpdate), PositionEvent(PositionEvent), ExecutionEvent(Execution), OrderEvent(OrderEvent), Wallet(WalletEvent), TradeStream(TradeStreamEvent), FastExecEvent(FastExecution), SystemStatusEvent(SystemStatusUpdate),
}
Expand description

Enum representing various WebSocket event types.

Encapsulates different types of WebSocket events, such as order book updates, trades, and position changes, received from Bybit’s WebSocket API. Bots use this to handle real-time market and account data for trading strategies.

Variants§

§

OrderBookEvent(OrderBookUpdate)

An order book update event.

Contains real-time updates to the order book for a trading pair. Bots use this for market depth analysis and liquidity monitoring.

§

RPIOrderBookEvent(RPIOrderbookUpdate)

An RPI (Real-time Price Improvement) order book update event.

Contains real-time updates to the RPI order book for a trading pair, including RPI sizes. RPI orders can provide price improvement for takers. Bots use this for market depth analysis with RPI information and improved liquidity monitoring.

§

TradeEvent(TradeUpdate)

A trade event.

Contains details of executed trades in the market. Bots use this for price discovery and trade signal generation.

§

TickerEvent(WsTicker)

A ticker event.

Contains real-time ticker data, such as last price and volume. Bots use this for monitoring market conditions and technical analysis.

§

LiquidationEvent(Liquidation)

A liquidation event.

Contains details of liquidation events in the market. Bots use this to assess market risk and volatility.

§

AllLiquidationEvent(AllLiquidationUpdate)

An all liquidation event.

Contains details of all liquidation events occurring across Bybit markets. This stream covers USDT contracts, USDC contracts, and inverse contracts. Bots use this for comprehensive market risk assessment and volatility monitoring.

§

KlineEvent(WsKline)

A kline (candlestick) event.

Contains real-time candlestick data for a trading pair. Bots use this for technical analysis and trend detection.

§

InsurancePoolEvent(InsurancePoolUpdate)

An insurance pool update event.

Contains real-time updates to insurance pool balances for various symbols. Insurance pools are used to cover losses when positions are liquidated below bankruptcy price. Bots use this to monitor exchange stability and counterparty risk.

§

PriceLimitEvent(PriceLimitUpdate)

A price limit update event.

Contains real-time updates to order price limits for trading symbols. These limits define the highest bid price (buyLmt) and lowest ask price (sellLmt) allowed. Bots use this for risk management and order validation.

§

ADLAlertEvent(ADLAlertUpdate)

An ADL (Auto-Deleveraging) alert update event.

Contains real-time ADL alert information for various trading pairs. ADL is a risk management mechanism that automatically closes positions when insurance pool balance reaches certain thresholds to prevent systemic risk. Bots use this to monitor market stability and potential forced liquidations.

§

PositionEvent(PositionEvent)

A position update event.

Contains updates to the account’s positions. Bots use this to track position changes and manage risk in real time.

§

ExecutionEvent(Execution)

An execution event.

Contains details of order executions for the account. Bots use this to confirm trade executions and update order status.

§

OrderEvent(OrderEvent)

An order update event.

Contains updates to the account’s orders. Bots use this to monitor order status and implement dynamic order management.

§

Wallet(WalletEvent)

A wallet update event.

Contains updates to the account’s wallet balance and margin. Bots use this to monitor account health and manage capital.

§

TradeStream(TradeStreamEvent)

A trade stream event.

Contains real-time trade stream data, typically for high-frequency trading. Bots use this for low-latency trade monitoring.

§

FastExecEvent(FastExecution)

A fast execution event.

Contains minimal execution data for low-latency processing. Bots use this for high-frequency trading and rapid execution confirmation.

§

SystemStatusEvent(SystemStatusUpdate)

A system status update event.

Contains real-time system status and maintenance information from Bybit. Bots use this to monitor platform health, maintenance schedules, and service incidents.

Trait Implementations§

Source§

impl Clone for WebsocketEvents

Source§

fn clone(&self) -> WebsocketEvents

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WebsocketEvents

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for WebsocketEvents

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for WebsocketEvents

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,