NautilusTrader
ConceptsInstruments

Crypto Perpetual

CryptoPerpetual represents a crypto perpetual futures contract, also known as a perpetual swap. It has no expiry, tracks a crypto base asset, and settles in a crypto, stablecoin, or other venue-defined settlement currency.

Examples include ETHUSDT-PERP.BINANCE, XBTUSD.BITMEX, and BTC-USD-SWAP.OKX.

Fields

FieldRust typePython typeRequired/defaultNotes
instrument_idInstrumentIdInstrumentIdRequiredStored as id in Rust.
raw_symbolSymbolSymbolRequiredNative venue symbol.
base_currencyCurrencyCurrencyRequiredBase crypto asset.
quote_currencyCurrencyCurrencyRequiredPrice quote currency.
settlement_currencyCurrencyCurrencyRequiredCurrency used to settle PnL and fees.
is_inverseboolboolRequiredTrue when sizing/costing is inverse.
price_precisionu8intRequiredDecimal places allowed for prices.
size_precisionu8intRequiredDecimal places allowed for order sizes.
price_incrementPricePriceRequiredSmallest valid price step.
size_incrementQuantityQuantityRequiredSmallest valid size step.
ts_eventUnixNanosintRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosintRequiredInitialization timestamp in nanoseconds.
multiplierQuantityQuantity1Contract multiplier.
lot_sizeQuantityQuantity1Rounded lot or board size.
max_quantityOption<Quantity>Quantity | NoneNoneMaximum order quantity.
min_quantityOption<Quantity>Quantity | NoneNoneMinimum order quantity.
max_notionalOption<Money>Money | NoneNoneMaximum order notional value.
min_notionalOption<Money>Money | NoneNoneMinimum order notional value.
max_priceOption<Price>Price | NoneNoneMaximum valid quote or order price.
min_priceOption<Price>Price | NoneNoneMinimum valid quote or order price.
margin_initOption<Decimal>Decimal | None0Initial margin rate.
margin_maintOption<Decimal>Decimal | None0Maintenance margin rate.
maker_feeOption<Decimal>Decimal | None0Maker fee rate. Negative values rebate.
taker_feeOption<Decimal>Decimal | None0Taker fee rate. Negative values rebate.
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

  • CryptoPerpetual has asset class Cryptocurrency and instrument class Swap.
  • It has no activation or expiration timestamp.
  • Linear contracts typically set is_inverse=False and settle in the quote currency.
  • Inverse contracts set is_inverse=True and typically settle in the base currency.
  • Quanto contracts settle in a third currency that differs from both base and quote.
  • The cost currency is base for inverse contracts, settlement for quanto contracts, and quote otherwise.

Funding payments are not fields on the instrument. They arrive as data, such as FundingRateUpdate, and reference the instrument ID.

Example

use nautilus_core::UnixNanos;
use nautilus_model::{
    identifiers::{InstrumentId, Symbol},
    instruments::{CryptoPerpetual, InstrumentAny},
    types::{Currency, Money, Price, Quantity},
};
use rust_decimal_macros::dec;

let ethusdt_perp = CryptoPerpetual::new(
    InstrumentId::from("ETHUSDT-PERP.BINANCE"),
    Symbol::from("ETHUSDT"),
    Currency::from("ETH"),
    Currency::from("USDT"),
    Currency::from("USDT"),
    false,
    2,
    3,
    Price::from("0.01"),
    Quantity::from("0.001"),
    None,
    None,
    Some(Quantity::from("10000.000")),
    Some(Quantity::from("0.001")),
    None,
    Some(Money::from("10.00 USDT")),
    Some(Price::from("15000.00")),
    Some(Price::from("1.00")),
    Some(dec!(1.0)),
    Some(dec!(0.35)),
    Some(dec!(0.0002)),
    Some(dec!(0.0004)),
    None,
    UnixNanos::default(),
    UnixNanos::default(),
);

let instrument = InstrumentAny::CryptoPerpetual(ethusdt_perp);

Adapters

Representative adapters that create or consume CryptoPerpetual instruments include:

  • Binance for USD-M and COIN-M perpetual futures.
  • BitMEX for inverse and linear perpetual contracts.
  • Bybit for linear and inverse perpetual products.
  • dYdX for perpetual markets.
  • Hyperliquid for perpetual markets.
  • Kraken for futures venue perpetual markets.
  • OKX for swap markets.
  • Tardis for crypto perpetual metadata.
  • Data covers mark prices, index prices, and funding rate updates.
  • Options covers option-specific instrument types.
  • Execution explains precision and notional checks before orders reach a venue.

On this page