NautilusTrader
ConceptsInstruments

Option Spread

OptionSpread represents an exchange-defined options strategy with more than one leg. The venue publishes the strategy as a single instrument with its own symbol, tick size, expiration, and execution rules.

Examples include listed vertical spreads, calendar spreads, and other option strategies.

Fields

FieldRust typePython typeRequired/defaultNotes
instrument_idInstrumentIdInstrumentIdRequiredStored as id in Rust.
raw_symbolSymbolSymbolRequiredNative venue symbol.
asset_classAssetClassAssetClassRequiredAsset class of the underlying strategy.
exchangeOption<Ustr>str | NoneNoneExchange MIC or venue code when known.
underlyingUstrstrRequiredUnderlying asset, future, or index.
strategy_typeUstrstrRequiredVenue strategy type, such as vertical.
activation_nsUnixNanosintRequiredStrategy activation timestamp.
expiration_nsUnixNanosintRequiredStrategy expiration timestamp.
currencyCurrencyCurrencyRequiredPremium quote and settlement currency.
price_precisionu8intRequiredDecimal places allowed for prices.
price_incrementPricePriceRequiredSmallest valid price step.
size_precisionu8int0Option spreads trade in whole contracts.
size_incrementQuantityQuantity1Minimum contract size step.
multiplierQuantityQuantityRequiredStrategy multiplier.
lot_sizeQuantityQuantityRequiredRounded lot or contract lot size.
margin_initOption<Decimal>Decimal | None0Initial margin rate.
margin_maintOption<Decimal>Decimal | None0Maintenance margin rate.
maker_feeOption<Decimal>Decimal | None0Maker fee rate. Negative values rebate.
taker_feeOption<Decimal>Decimal | None0Taker fee rate. Negative values rebate.
max_quantityOption<Quantity>Quantity | NoneNoneMaximum order quantity.
min_quantityOption<Quantity>Quantity | None1Minimum order quantity.
max_priceOption<Price>Price | NoneNoneMaximum valid quote or order price.
min_priceOption<Price>Price | NoneNoneMinimum valid quote or order price.
tick_scheme_nameN/Astr | NoneNoneRegistered variable tick scheme name.
infoOption<Params>dict | NoneNoneAdapter metadata.
ts_eventUnixNanosintRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosintRequiredInitialization timestamp in nanoseconds.

Note: Python constructors use instrument_id; Rust stores the same value as id.

Behavior

  • OptionSpread has instrument class OptionSpread.
  • The venue publishes the spread as a single tradable instrument.
  • It trades in whole contracts with size precision 0 and size increment 1.
  • Store venue-specific leg details in info when the adapter provides them.

Example

use chrono::{TimeZone, Utc};
use nautilus_core::UnixNanos;
use nautilus_model::{
    enums::AssetClass,
    identifiers::{InstrumentId, Symbol},
    instruments::OptionSpread,
    types::{Currency, Price, Quantity},
};
use ustr::Ustr;

let activation = Utc.with_ymd_and_hms(2023, 11, 6, 20, 54, 7).unwrap();
let expiration = Utc.with_ymd_and_hms(2024, 2, 23, 22, 59, 0).unwrap();

let sr3_spread = OptionSpread::new(
    InstrumentId::from("UD:U$: GN 2534559.GLBX"),
    Symbol::from("UD:U$: GN 2534559"),
    AssetClass::FX,
    Some(Ustr::from("XCME")),
    Ustr::from("SR3"),
    Ustr::from("GN"),
    UnixNanos::from(activation.timestamp_nanos_opt().unwrap() as u64),
    UnixNanos::from(expiration.timestamp_nanos_opt().unwrap() as u64),
    Currency::from("USD"),
    2,
    Price::from("0.01"),
    Quantity::from("1"),
    Quantity::from("1"),
    None,
    None,
    None,
    None,
    None,
    None,
    None,
    None,
    None,
    UnixNanos::default(),
    UnixNanos::default(),
);

Adapters

Representative adapters that create or consume OptionSpread instruments include:

  • Option Contract covers single-leg option contracts.
  • Options covers option data, Greeks, and chain subscriptions.

On this page