finance_query/models/futures/mod.rs
1//! Futures market data models.
2//!
3//! Canonical public types for futures contracts and quotes,
4//! shared across Polygon and other futures data providers.
5
6use serde::{Deserialize, Serialize};
7
8/// A futures contract quote.
9///
10/// Obtain via [`Ticker::quote`](crate::Ticker::quote) using the futures symbol (e.g., `"GC=F"`).
11#[derive(Debug, Clone, Serialize, Deserialize)]
12#[non_exhaustive]
13pub struct FuturesQuote {
14 /// Contract ticker symbol (e.g., `"ESM26"` for E-mini S&P June 2026)
15 pub symbol: String,
16 /// Human-readable contract name
17 pub name: Option<String>,
18 /// Underlying asset (e.g., `"S&P 500"`, `"Crude Oil"`)
19 pub underlying: Option<String>,
20 /// Exchange where the contract trades
21 pub exchange: Option<String>,
22 /// Contract expiration date as YYYY-MM-DD
23 pub expiration_date: Option<String>,
24 /// Current contract price
25 pub price: Option<f64>,
26 /// Price change
27 pub change: Option<f64>,
28 /// Price change percentage
29 pub change_percent: Option<f64>,
30 /// Open interest (number of outstanding contracts)
31 pub open_interest: Option<u64>,
32 /// Trading volume
33 pub volume: Option<u64>,
34 /// Unix timestamp of the last update
35 pub timestamp: Option<i64>,
36}