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

<Tabs items={["Rust", "Python"]}>

FieldTypeRequired/defaultNotes
instrument_idInstrumentIdRequiredStored as id in Rust.
raw_symbolSymbolRequiredNative venue symbol.
asset_classAssetClassRequiredAsset class of the underlying strategy.
exchangeOption<Ustr>NoneExchange MIC or venue code when known.
underlyingUstrRequiredUnderlying asset, future, or index.
strategy_typeUstrRequiredVenue strategy type, such as vertical.
activation_nsUnixNanosRequiredStrategy activation timestamp.
expiration_nsUnixNanosRequiredStrategy expiration timestamp.
currencyCurrencyRequiredPremium quote and settlement currency.
price_precisionu8RequiredDecimal places allowed for prices.
price_incrementPriceRequiredSmallest valid price step.
size_precisionu80Option spreads trade in whole contracts.
size_incrementQuantity1Minimum contract size step.
multiplierQuantityRequiredStrategy multiplier.
lot_sizeQuantityRequiredRounded lot or contract lot size.
margin_initOption<Decimal>0Initial margin rate.
margin_maintOption<Decimal>0Maintenance margin rate.
maker_feeOption<Decimal>0Maker fee rate. Negative values rebate.
taker_feeOption<Decimal>0Taker fee rate. Negative values rebate.
max_quantityOption<Quantity>NoneMaximum order quantity.
min_quantityOption<Quantity>1Minimum order quantity.
max_priceOption<Price>NoneMaximum valid quote or order price.
min_priceOption<Price>NoneMinimum valid quote or order price.
tick_schemeOption<Ustr>NoneRegistered variable tick scheme name.
infoOption<Params>NoneAdapter metadata.
ts_eventUnixNanosRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosRequiredInitialization timestamp in nanoseconds.
FieldTypeRequired/defaultNotes
instrument_idInstrumentIdRequired
raw_symbolSymbolRequiredNative venue symbol.
asset_classAssetClassRequiredAsset class of the underlying strategy.
exchangestr | NoneNoneExchange MIC or venue code when known.
underlyingstrRequiredUnderlying asset, future, or index.
strategy_typestrRequiredVenue strategy type, such as vertical.
activation_nsintRequiredStrategy activation timestamp.
expiration_nsintRequiredStrategy expiration timestamp.
currencyCurrencyRequiredPremium quote and settlement currency.
price_precisionintRequiredDecimal places allowed for prices.
price_incrementPriceRequiredSmallest valid price step.
size_precisionint0Option spreads trade in whole contracts.
size_incrementQuantity1Minimum contract size step.
multiplierQuantityRequiredStrategy multiplier.
lot_sizeQuantityRequiredRounded lot or contract lot size.
margin_initDecimal | None0Initial margin rate.
margin_maintDecimal | None0Maintenance margin rate.
maker_feeDecimal | None0Maker fee rate. Negative values rebate.
taker_feeDecimal | None0Taker fee rate. Negative values rebate.
max_quantityQuantity | NoneNoneMaximum order quantity.
min_quantityQuantity | None1Minimum order quantity.
max_pricePrice | NoneNoneMaximum valid quote or order price.
min_pricePrice | NoneNoneMinimum valid quote or order price.
tick_schemestr | NoneNoneRegistered variable tick scheme name.
infodict | NoneNoneAdapter metadata.
ts_eventintRequiredEvent timestamp in nanoseconds.
ts_initintRequiredInitialization 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::builder()
    .instrument_id(InstrumentId::from("UD:U$: GN 2534559.GLBX"))
    .raw_symbol(Symbol::from("UD:U$: GN 2534559"))
    .asset_class(AssetClass::FX)
    .exchange(Ustr::from("XCME"))
    .underlying(Ustr::from("SR3"))
    .strategy_type(Ustr::from("GN"))
    .activation_ns(UnixNanos::from(activation.timestamp_nanos_opt().unwrap() as u64))
    .expiration_ns(UnixNanos::from(expiration.timestamp_nanos_opt().unwrap() as u64))
    .currency(Currency::from("USD"))
    .price_precision(2)
    .price_increment(Price::from("0.01"))
    .multiplier(Quantity::from("1"))
    .lot_size(Quantity::from("1"))
    .ts_event(UnixNanos::default())
    .ts_init(UnixNanos::default())
    .build()
    .unwrap();

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