Skip to main content

bybit/models/
instrument_info.rs

1use crate::prelude::*;
2
3/// Enum representing different types of instrument information.
4///
5/// This untagged enum allows the API to return different instrument details based on the category (Futures, Spot, Options). For perpetual futures, the `Futures` variant is most relevant, containing details like leverage and funding intervals.
6#[derive(Debug, Serialize, Deserialize, Clone)]
7#[serde(untagged)]
8pub enum InstrumentInfo {
9    /// Instrument information for futures (including perpetuals).
10    ///
11    /// Contains details for perpetual futures contracts, such as leverage filters and funding intervals. Bots use this to configure trading parameters and manage risk.
12    Futures(FuturesInstrumentsInfo),
13
14    /// Instrument information for spot markets.
15    ///
16    /// Contains details for spot trading pairs. Less relevant for perpetual futures but included for completeness.
17    Spot(SpotInstrumentsInfo),
18
19    /// Instrument information for options.
20    ///
21    /// Contains details for options contracts. Not typically used for perpetual futures trading.
22    Options(OptionsInstrument),
23}