finance_query/models/options/
chain.rs

1use super::contract::OptionContract;
2use serde::{Deserialize, Serialize};
3
4/// Options chain data for a specific expiration
5///
6/// Note: This struct cannot be manually constructed - use `Ticker::options()` to obtain options data.
7#[non_exhaustive]
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct OptionChain {
11    /// Expiration date (Unix timestamp)
12    pub expiration_date: i64,
13
14    /// Whether all data is fetched
15    pub has_mini_options: Option<bool>,
16
17    /// Call options
18    pub calls: Vec<OptionContract>,
19
20    /// Put options
21    pub puts: Vec<OptionContract>,
22}
23
24/// Quote data included with options response
25///
26/// Note: This struct cannot be manually constructed - obtain via `Ticker::options()`.
27#[non_exhaustive]
28#[derive(Debug, Clone, Serialize, Deserialize)]
29#[cfg_attr(feature = "dataframe", derive(crate::ToDataFrame))]
30#[serde(rename_all = "camelCase")]
31pub struct OptionsQuote {
32    /// Symbol
33    pub symbol: String,
34
35    /// Short name
36    pub short_name: Option<String>,
37
38    /// Regular market price
39    pub regular_market_price: Option<f64>,
40
41    /// Regular market time (Unix timestamp)
42    pub regular_market_time: Option<i64>,
43}