{"record":{"id":"3e6547c8476bd332","repo":"nautechsystems/nautilus_trader","slug":"funding-rates-not-available-for-product-type-ins","errorCode":null,"errorMessage":"Funding rates not available for {product_type} instruments","messagePattern":"Funding rates not available for (.+?) instruments","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/bybit/src/data.rs","lineNumber":1936,"sourceCode":"    fn request_funding_rates(&self, request: RequestFundingRates) -> anyhow::Result<()> {\n        let http = self.http_client.clone();\n        let sender = self.data_sender.clone();\n        let instrument_id = request.instrument_id;\n        let start = request.start;\n        let end = request.end;\n        let limit = request.limit.map(|n| n.get() as u32);\n        let request_id = request.request_id;\n        let client_id = request.client_id.unwrap_or(self.client_id);\n        let params = request.params;\n        let clock = self.clock;\n        let start_nanos = datetime_to_unix_nanos(start);\n        let end_nanos = datetime_to_unix_nanos(end);\n\n        let product_type = BybitProductType::from_suffix(instrument_id.symbol.as_str())\n            .unwrap_or(BybitProductType::Linear);\n\n        if product_type == BybitProductType::Spot || product_type == BybitProductType::Option {\n            anyhow::bail!(\"Funding rates not available for {product_type} instruments\");\n        }\n\n        self.spawn_command(async move {\n            match http\n                .request_funding_rates(product_type, instrument_id, start, end, limit)\n                .await\n                .context(\"failed to request funding rates from Bybit\")\n            {\n                Ok(funding_rates) => {\n                    let response = DataResponse::FundingRates(FundingRatesResponse::new(\n                        request_id,\n                        client_id,\n                        instrument_id,\n                        funding_rates,\n                        start_nanos,\n                        end_nanos,\n                        clock.get_time_ns(),\n                        params,","sourceCodeStart":1918,"sourceCodeEnd":1954,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bybit/src/data.rs#L1918-L1954","documentation":"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.","triggerScenarios":"Calling request_funding_rates with an instrument_id whose symbol suffix (BybitProductType::from_suffix) maps to Spot or Option.","commonSituations":"Batch historical data requests that include Spot pairs or option symbols; misconfigured instrument IDs where the suffix implies the wrong product type.","solutions":["Request funding rates only for perpetual/inverse instrument IDs (e.g. BTCUSDT-PERP.SBYBIT)","Filter Spot and Option instruments out of funding-rate request batches","Verify instrument_id symbol suffix resolves to the intended product type"],"exampleFix":"// before\nclient.request_funding_rates(InstrumentId::from(\"BTCUSDT.SBYBIT\"), start, end, None); // Spot -> error\n// after\nclient.request_funding_rates(InstrumentId::from(\"BTCUSDT-PERP.SBYBIT\"), start, end, None);","handlingStrategy":"validation","validationCode":"let product = BybitProductType::from_suffix(instrument_id.symbol.as_str());\nif matches!(product, Some(BybitProductType::Spot) | Some(BybitProductType::Option)) {\n    // funding rates only exist for perpetuals/inverse\n    return Ok(());\n}\nclient.request_funding_rates(instrument_id, start, end, limit)?;","typeGuard":null,"tryCatchPattern":"match client.request_funding_rates(instrument_id, start, end, limit) {\n    Err(e) if e.to_string().contains(\"Funding rates not available\") => {\n        // skip; funding rates do not apply to this product type\n    }\n    r => r?,\n}","preventionTips":["Only request funding rates for PERP/Linear and Inverse instruments","Batch historical requests per product type with separate handling","Verify symbol suffixes map to the product types you expect"],"tags":["bybit","funding-rates","spot","options","rest"],"backgroundTag":"unsupported-operation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}