nautechsystems/nautilus_trader · error

Funding rates not available for {product_type} instruments

Error message

Funding rates not available for {product_type} instruments

What it means

This error is raised when funding rates are requested for Spot or Option instruments. Funding rates only exist for perpetual (Linear) and Inverse derivatives on Bybit, so the adapter bails out before issuing the REST request.

Source

Thrown at crates/adapters/bybit/src/data.rs:1936

    fn request_funding_rates(&self, request: RequestFundingRates) -> anyhow::Result<()> {
        let http = self.http_client.clone();
        let sender = self.data_sender.clone();
        let instrument_id = request.instrument_id;
        let start = request.start;
        let end = request.end;
        let limit = request.limit.map(|n| n.get() as u32);
        let request_id = request.request_id;
        let client_id = request.client_id.unwrap_or(self.client_id);
        let params = request.params;
        let clock = self.clock;
        let start_nanos = datetime_to_unix_nanos(start);
        let end_nanos = datetime_to_unix_nanos(end);

        let product_type = BybitProductType::from_suffix(instrument_id.symbol.as_str())
            .unwrap_or(BybitProductType::Linear);

        if product_type == BybitProductType::Spot || product_type == BybitProductType::Option {
            anyhow::bail!("Funding rates not available for {product_type} instruments");
        }

        self.spawn_command(async move {
            match http
                .request_funding_rates(product_type, instrument_id, start, end, limit)
                .await
                .context("failed to request funding rates from Bybit")
            {
                Ok(funding_rates) => {
                    let response = DataResponse::FundingRates(FundingRatesResponse::new(
                        request_id,
                        client_id,
                        instrument_id,
                        funding_rates,
                        start_nanos,
                        end_nanos,
                        clock.get_time_ns(),
                        params,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Request funding rates only for perpetual/inverse instrument IDs (e.g. BTCUSDT-PERP.SBYBIT)
  2. Filter Spot and Option instruments out of funding-rate request batches
  3. Verify instrument_id symbol suffix resolves to the intended product type

Example fix

// before
client.request_funding_rates(InstrumentId::from("BTCUSDT.SBYBIT"), start, end, None); // Spot -> error
// after
client.request_funding_rates(InstrumentId::from("BTCUSDT-PERP.SBYBIT"), start, end, None);
Defensive patterns

Strategy: validation

Validate before calling

let product = BybitProductType::from_suffix(instrument_id.symbol.as_str());
if matches!(product, Some(BybitProductType::Spot) | Some(BybitProductType::Option)) {
    // funding rates only exist for perpetuals/inverse
    return Ok(());
}
client.request_funding_rates(instrument_id, start, end, limit)?;

Try / catch

match client.request_funding_rates(instrument_id, start, end, limit) {
    Err(e) if e.to_string().contains("Funding rates not available") => {
        // skip; funding rates do not apply to this product type
    }
    r => r?,
}

Prevention

When it happens

Trigger: Calling request_funding_rates with an instrument_id whose symbol suffix (BybitProductType::from_suffix) maps to Spot or Option.

Common situations: Batch historical data requests that include Spot pairs or option symbols; misconfigured instrument IDs where the suffix implies the wrong product type.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/3e6547c8476bd332. Report an issue: GitHub.