Back to Nautilus Trader

Index Instrument

docs/concepts/instruments/index_instrument.md

1.228.03.8 KB
Original Source

Index Instrument

IndexInstrument represents a reference index such as an equity index, volatility index, or benchmark price series. It carries precision and increment metadata so Nautilus can store and route prices consistently, but it is not a directly tradable contract.

Examples include SPX.XCBO, VIX.XCBO, and venue-specific reference indexes.

Fields

FieldRust typePython typeRequired/defaultNotes
instrument_idInstrumentIdInstrumentIdRequiredStored as id in Rust.
raw_symbolSymbolSymbolRequiredNative venue symbol.
currencyCurrencyCurrencyRequiredReference currency for quoted values.
price_precisionu8intRequiredDecimal places allowed for prices.
size_precisionu8intRequiredDecimal places allowed for quantities.
price_incrementPricePriceRequiredSmallest valid price step.
size_incrementQuantityQuantityRequiredSmallest valid size step.
ts_eventUnixNanosintRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosintRequiredInitialization timestamp in nanoseconds.
tick_scheme_nameN/Astr | NoneNoneRegistered variable tick scheme name.
infoOption<Params>dict | NoneNoneAdapter metadata.

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

Behavior

  • IndexInstrument has asset class Index and instrument class Spot.
  • It is a reference instrument and should not be used for order submission.
  • It has no limits, margins, fees, contract multiplier, expiry, or settlement currency.
  • Use option or futures types for tradable derivatives whose underlyings are indexes.

Example

rust
use nautilus_core::UnixNanos;
use nautilus_model::{
    identifiers::{InstrumentId, Symbol},
    instruments::IndexInstrument,
    types::{Currency, Price, Quantity},
};

let spx = IndexInstrument::new(
    InstrumentId::from("SPX.XCBO"),
    Symbol::from("SPX"),
    Currency::from("USD"),
    2,
    0,
    Price::from("0.01"),
    Quantity::from("1"),
    None,
    UnixNanos::default(),
    UnixNanos::default(),
);
python
from nautilus_trader.model.currencies import USD
from nautilus_trader.model.identifiers import InstrumentId
from nautilus_trader.model.identifiers import Symbol
from nautilus_trader.model.instruments import IndexInstrument
from nautilus_trader.model.objects import Price
from nautilus_trader.model.objects import Quantity

spx = IndexInstrument(
    instrument_id=InstrumentId.from_str("SPX.XCBO"),
    raw_symbol=Symbol("SPX"),
    currency=USD,
    price_precision=2,
    size_precision=0,
    price_increment=Price.from_str("0.01"),
    size_increment=Quantity.from_str("1"),
    ts_event=0,
    ts_init=0,
)

Adapters

Representative adapters that create or consume IndexInstrument instruments include: