hypercall_db/types/instruments.rs
1//! Instrument and market types.
2//!
3//! Domain records for options instruments and their parent markets.
4
5use hypercall_types::api_models::InstrumentStatus;
6use hypercall_types::{OptionType, WalletAddress};
7use rust_decimal::Decimal;
8use serde::{Deserialize, Serialize};
9
10/// An options instrument (e.g. BTC-20260115-100000-C).
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct InstrumentRecord {
13 /// Auto-incrementing numeric ID assigned by the database.
14 pub instrument_numeric_id: i32,
15 /// Symbol string, e.g. "BTC-20260115-100000-C".
16 pub id: String,
17 /// Underlying asset, e.g. "BTC".
18 pub underlying: String,
19 /// Strike price.
20 pub strike: Decimal,
21 /// Expiry date as YYYYMMDD integer.
22 pub expiry: i64,
23 pub option_type: OptionType,
24 /// On-chain ERC-20 address for this option token, if deployed.
25 pub option_token_address: Option<WalletAddress>,
26 pub status: InstrumentStatus,
27 /// "orderbook" or "rfq".
28 pub trading_mode: String,
29}