bybit/models/ticker_data.rs
1use crate::prelude::*;
2
3/// Enum representing ticker data for different instrument types.
4///
5/// This untagged enum allows the API to return ticker data for either spot, futures (including perpetuals), or options.
6/// For perpetual futures, the `Futures` variant is most relevant, containing funding rate and open interest data.
7/// For options, the `Options` variant contains Greeks and implied volatility data.
8#[derive(Serialize, Deserialize, Clone, Debug)]
9#[serde(untagged)]
10pub enum TickerData {
11 /// Ticker data for spot markets.
12 ///
13 /// Contains market data for spot trading pairs. Not relevant for perpetual futures.
14 Spot(SpotTicker),
15
16 /// Ticker data for futures (including perpetuals).
17 ///
18 /// Contains market data for perpetual futures, including funding rates and open interest. Critical for bots monitoring market conditions and funding costs.
19 Futures(FuturesTicker),
20
21 /// Ticker data for options contracts.
22 ///
23 /// Contains market data for options contracts, including Greeks (delta, gamma, vega, theta),
24 /// implied volatility, and other options-specific metrics.
25 Options(OptionsTicker),
26}