ConceptsData
Nightly docs
These docs track unreleased changes and may change without notice. Their code examples can use APIs that the latest release lacks, so run them with a development wheel or switch to the latest release docs.
MarkPriceUpdate
MarkPriceUpdate represents an instrument's mark price. Derivatives venues commonly use mark
prices for margining, liquidation checks, and unrealized PnL calculations.
Fields
| Field | Rust type | Python type | Required/default | Notes |
|---|---|---|---|---|
instrument_id | InstrumentId | InstrumentId | Required | Instrument for the mark price. |
value | Price | Price | Required | Current mark price. |
ts_event | UnixNanos | int | Required | Event timestamp in nanoseconds. |
ts_init | UnixNanos | int | Required | Initialization timestamp in nanoseconds. |
Behavior
- Mark prices are cached by instrument when received.
- Backtests can feed mark prices to align margin and PnL behavior with venues that publish reference prices separately from trades.
- The catalog stores mark prices with instrument ID and price precision metadata.
Example
use nautilus_core::UnixNanos;
use nautilus_model::{
data::MarkPriceUpdate,
identifiers::InstrumentId,
types::Price,
};
let mark = MarkPriceUpdate::new(
InstrumentId::from("BTCUSDT-PERP.BINANCE"),
Price::from("65000.10"),
UnixNanos::from(1_000_000_000),
UnixNanos::from(1_000_000_100),
);Related guides
- IndexPriceUpdate covers the index reference price.
- FundingRateUpdate covers perpetual funding metadata.
- Python API reference lists Python members.
Bar
Bar represents OHLCV price and volume data for a specific BarType. A venue or data provider can supply bars, or NautilusTrader can aggregate them from quote...
IndexPriceUpdate
IndexPriceUpdate represents an external index price used by a derivatives market. Venues often use index prices to calculate mark prices, funding, or...