ConceptsInstruments
Futures Spread
FuturesSpread represents an exchange-defined futures strategy with more than one leg,
such as a calendar spread or inter-commodity spread. The venue defines the strategy,
symbol, tick size, and expiry.
Examples include listed futures calendar spreads and exchange-supported spread markets.
Fields
| Field | Rust type | Python type | Required/default | Notes |
|---|---|---|---|---|
instrument_id | InstrumentId | InstrumentId | Required | Stored as id in Rust. |
raw_symbol | Symbol | Symbol | Required | Native venue symbol. |
asset_class | AssetClass | AssetClass | Required | Asset class of the underlying strategy. |
exchange | Option<Ustr> | str | None | None | Exchange MIC or venue code when known. |
underlying | Ustr | str | Required | Underlying product or product family. |
strategy_type | Ustr | str | Required | Venue strategy type, such as calendar. |
activation_ns | UnixNanos | int | Required | Strategy activation timestamp. |
expiration_ns | UnixNanos | int | Required | Strategy expiration timestamp. |
currency | Currency | Currency | Required | Quote and settlement currency. |
price_precision | u8 | int | Required | Decimal places allowed for prices. |
price_increment | Price | Price | Required | Smallest valid price step. |
size_precision | u8 | int | 0 | Futures spreads trade in whole contracts. |
size_increment | Quantity | Quantity | 1 | Minimum contract size step. |
multiplier | Quantity | Quantity | Required | Strategy multiplier. |
lot_size | Quantity | Quantity | Required | Rounded lot or contract lot size. |
margin_init | Option<Decimal> | Decimal | None | 0 | Initial margin rate. |
margin_maint | Option<Decimal> | Decimal | None | 0 | Maintenance margin rate. |
maker_fee | Option<Decimal> | Decimal | None | 0 | Maker fee rate. Negative values rebate. |
taker_fee | Option<Decimal> | Decimal | None | 0 | Taker fee rate. Negative values rebate. |
max_quantity | Option<Quantity> | Quantity | None | None | Maximum order quantity. |
min_quantity | Option<Quantity> | Quantity | None | 1 | Minimum order quantity. |
max_price | Option<Price> | Price | None | None | Maximum valid quote or order price. |
min_price | Option<Price> | Price | None | None | Minimum valid quote or order price. |
tick_scheme_name | N/A | str | None | None | Registered variable tick scheme name. |
info | Option<Params> | dict | None | None | Adapter metadata. |
ts_event | UnixNanos | int | Required | Event timestamp in nanoseconds. |
ts_init | UnixNanos | int | Required | Initialization timestamp in nanoseconds. |
Note: Python constructors use instrument_id; Rust stores the same value as id.
Behavior
FuturesSpreadhas instrument classFuturesSpread.- The venue publishes the spread as a single tradable instrument.
- It trades in whole contracts with size precision
0and size increment1. - Use leg data from the adapter metadata when a strategy needs venue-specific leg details.
Example
use chrono::{TimeZone, Utc};
use nautilus_core::UnixNanos;
use nautilus_model::{
enums::AssetClass,
identifiers::{InstrumentId, Symbol},
instruments::FuturesSpread,
types::{Currency, Price, Quantity},
};
use ustr::Ustr;
let activation = Utc.with_ymd_and_hms(2022, 6, 21, 13, 30, 0).unwrap();
let expiration = Utc.with_ymd_and_hms(2024, 6, 21, 13, 30, 0).unwrap();
let es_spread = FuturesSpread::new(
InstrumentId::from("ESM4-ESU4.GLBX"),
Symbol::from("ESM4-ESU4"),
AssetClass::Index,
Some(Ustr::from("XCME")),
Ustr::from("ES"),
Ustr::from("EQ"),
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 FuturesSpread instruments include:
- Databento for listed futures spread markets.
- Interactive Brokers for exchange-defined futures strategies.
Related guides
- Futures Contract covers single-leg futures.
- Continuous Futures covers roll-adjusted futures series.