Back to Nautilus Trader

IndexPriceUpdate

docs/concepts/data/index_price_update.md

1.231.02.0 KB
Original Source

IndexPriceUpdate

IndexPriceUpdate represents an external index price used by a derivatives market. Venues often use index prices to calculate mark prices, funding, or settlement values.

Fields

FieldRust typePython typeRequired/defaultNotes
instrument_idInstrumentIdInstrumentIdRequiredInstrument for the index price.
valuePricePriceRequiredCurrent index price.
ts_eventUnixNanosintRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosintRequiredInitialization timestamp in nanoseconds.

Behavior

  • Index prices are reference data and do not imply a trade occurred.
  • Perpetual and futures venues may publish both mark and index prices.
  • The catalog stores index prices with instrument ID and price precision metadata.

Example

rust
use nautilus_core::UnixNanos;
use nautilus_model::{
    data::IndexPriceUpdate,
    identifiers::InstrumentId,
    types::Price,
};

let index = IndexPriceUpdate::new(
    InstrumentId::from("BTCUSDT-PERP.BINANCE"),
    Price::from("64995.50"),
    UnixNanos::from(1_000_000_000),
    UnixNanos::from(1_000_000_100),
);
python
from nautilus_trader.model import IndexPriceUpdate
from nautilus_trader.model import InstrumentId
from nautilus_trader.model import Price

index = IndexPriceUpdate(
    instrument_id=InstrumentId.from_str("BTCUSDT-PERP.BINANCE"),
    value=Price.from_str("64995.50"),
    ts_event=1_000_000_000,
    ts_init=1_000_000_100,
)