Skip to content

Commit 0481cfb

Browse files
committed
Added OptionInstrument struct to options.rs with combined instrument and ticker data; updated Instrument with optional price_index.
1 parent f3f4feb commit 0481cfb

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/model/instrument.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ pub enum InstrumentType {
5050
pub struct Instrument {
5151
/// Instrument name (e.g., "BTC-PERPETUAL", "ETH-25JUL25-3000-C")
5252
pub instrument_name: String,
53+
/// Price index used for mark price calculation
54+
#[serde(skip_serializing_if = "Option::is_none")]
55+
pub price_index: Option<String>,
5356
/// Instrument kind
5457
#[serde(skip_serializing_if = "Option::is_none")]
5558
pub kind: Option<InstrumentKind>,

src/model/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pub mod funding;
3333
pub mod instrument;
3434
/// Market data structures
3535
pub mod market_data;
36+
/// Options-related data structures and types
37+
pub mod options;
3638
/// Order-related data structures and types
3739
pub mod order;
3840
/// Order management operations and requests

src/model/options.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/******************************************************************************
2+
Author: Joaquín Béjar García
3+
Email: jb@taunais.com
4+
Date: 9/9/25
5+
******************************************************************************/
6+
use crate::prelude::{Instrument, TickerData};
7+
use serde::{Deserialize, Serialize};
8+
9+
/// Combined option instrument data with ticker information
10+
#[derive(Clone, Serialize, Deserialize)]
11+
pub struct OptionInstrument {
12+
/// The instrument details
13+
pub instrument: Instrument,
14+
/// Real-time ticker data for the option
15+
pub ticker: TickerData,
16+
}

0 commit comments

Comments
 (0)