ig_client/presentation/
instrument.rs

1use pretty_simple_display::{DebugPretty, DisplaySimple};
2use serde::{Deserialize, Serialize};
3
4#[derive(
5    DebugPretty, DisplaySimple, Copy, Clone, Deserialize, Serialize, PartialEq, Eq, Hash, Default,
6)]
7#[serde(rename_all = "UPPERCASE")]
8/// Types of financial instruments available in the IG Markets API
9pub enum InstrumentType {
10    /// Binary options
11    Binary,
12    /// Bungee capped instruments
13    #[serde(rename = "BUNGEE_CAPPED")]
14    BungeeCapped,
15    /// Bungee commodities instruments
16    #[serde(rename = "BUNGEE_COMMODITIES")]
17    BungeeCommodities,
18    /// Bungee currencies instruments
19    #[serde(rename = "BUNGEE_CURRENCIES")]
20    BungeeCurrencies,
21    /// Bungee indices instruments
22    #[serde(rename = "BUNGEE_INDICES")]
23    BungeeIndices,
24    /// Commodities instruments
25    Commodities,
26    /// Currency pairs
27    Currencies,
28    /// Market indices
29    Indices,
30    /// Knockouts commodities instruments
31    #[serde(rename = "KNOCKOUTS_COMMODITIES")]
32    KnockoutsCommodities,
33    /// Knockouts currencies instruments
34    #[serde(rename = "KNOCKOUTS_CURRENCIES")]
35    KnockoutsCurrencies,
36    /// Knockouts indices instruments
37    #[serde(rename = "KNOCKOUTS_INDICES")]
38    KnockoutsIndices,
39    /// Knockouts shares instruments
40    #[serde(rename = "KNOCKOUTS_SHARES")]
41    KnockoutsShares,
42    /// Options on commodities
43    #[serde(rename = "OPT_COMMODITIES")]
44    OptCommodities,
45    /// Options on currencies
46    #[serde(rename = "OPT_CURRENCIES")]
47    OptCurrencies,
48    /// Options on indices
49    #[serde(rename = "OPT_INDICES")]
50    OptIndices,
51    /// Options on rates
52    #[serde(rename = "OPT_RATES")]
53    OptRates,
54    /// Options on shares
55    #[serde(rename = "OPT_SHARES")]
56    OptShares,
57    /// Interest rates
58    Rates,
59    /// Market sectors
60    Sectors,
61    /// Stocks and shares
62    Shares,
63    /// Sprint market instruments
64    #[serde(rename = "SPRINT_MARKET")]
65    SprintMarket,
66    /// Test market instruments
67    #[serde(rename = "TEST_MARKET")]
68    TestMarket,
69    /// Unknown instrument type
70    Unknown,
71    /// Options
72    #[default]
73    Options,
74}