NautilusTrader
ConceptsData
These docs track the unreleased nightly build and may change without notice. Switch to the latest stable docs.

FundingRateUpdate

FundingRateUpdate represents the current funding rate for a perpetual swap instrument. It can also include the funding interval and the next funding timestamp when the venue publishes them.

Fields

FieldRust typePython typeRequired/defaultNotes
instrument_idInstrumentIdInstrumentIdRequiredPerpetual instrument for the rate.
rateDecimalDecimalRequiredCurrent funding rate.
intervalOption<u16>int | NoneNoneFunding interval in minutes.
next_funding_nsOption<UnixNanos>int | NoneNoneNext funding timestamp in nanoseconds.
ts_eventUnixNanosintRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosintRequiredInitialization timestamp in nanoseconds.

Behavior

  • Equality and hashing use instrument ID, rate, interval, and next funding time.
  • Funding rates are reference data and do not imply a payment was applied.
  • Use interval and next_funding_ns only when the venue publishes them.

Example

use nautilus_core::UnixNanos;
use nautilus_model::{data::FundingRateUpdate, identifiers::InstrumentId};
use rust_decimal::Decimal;

let funding = FundingRateUpdate::new(
    InstrumentId::from("BTCUSDT-PERP.BINANCE"),
    Decimal::new(1, 4),
    Some(480),
    Some(UnixNanos::from(1_000_008_000)),
    UnixNanos::from(1_000_000_000),
    UnixNanos::from(1_000_000_100),
);

On this page