{"record":{"id":"7c7800100b63b6ac","repo":"nautechsystems/nautilus_trader","slug":"invalid-futures-funding-rate-at-e","errorCode":null,"errorMessage":"invalid Futures funding rate at {}: {e}","messagePattern":"invalid Futures funding rate at (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/http/client.rs","lineNumber":3348,"sourceCode":"        low,\n        close,\n        volume,\n        quote_volume,\n        count,\n        taker_buy_base_volume,\n        taker_buy_quote_volume,\n        ts_event,\n        ts_init,\n    ))\n}\n\nfn parse_futures_funding_rate_update(\n    rate: &BinanceFundingRate,\n    instrument_id: InstrumentId,\n    ts_init: UnixNanos,\n) -> anyhow::Result<FundingRateUpdate> {\n    let funding_rate = rate.funding_rate.parse::<Decimal>().map_err(|e| {\n        anyhow::anyhow!(\"invalid Futures funding rate at {}: {e}\", rate.funding_time)\n    })?;\n    let ts_event = parse_millis(rate.funding_time, \"Futures funding time\")?;\n\n    Ok(FundingRateUpdate::new(\n        instrument_id,\n        funding_rate,\n        None, // Funding interval is not provided by the history endpoint\n        None, // Next funding time is not provided by the history endpoint\n        ts_event,\n        ts_init,\n    ))\n}\n\nfn parse_futures_commission_rates(\n    response: &BinanceFuturesCommissionRate,\n) -> anyhow::Result<(Decimal, Decimal)> {\n    Ok((\n        response.maker_commission_rate.parse()?,","sourceCodeStart":3330,"sourceCodeEnd":3366,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/http/client.rs#L3330-L3366","documentation":"Raised when a Binance Futures funding rate entry's funding_rate string cannot be parsed into a Decimal while producing a FundingRateUpdate. The parser (parse_futures_funding_rate_update) requires a valid decimal string; malformed input aborts the conversion. funding_time is included in the message to identify the entry.","triggerScenarios":"Funding rate REST response (premiumIndex/fundingRate endpoints) where rate.funding_rate is empty or not a decimal literal; triggered during futures funding rate polling via BinanceFuturesHttpClient.","commonSituations":"Fixtures missing the funding_rate field, Binance API schema changes, proxy corruption, or pointing the client at an endpoint that returns a different shape (e.g. mark price stream without fundingRate).","solutions":["Log the raw funding rate entry at the reported funding_time and inspect funding_rate.","Ensure fixtures/mocks include funding_rate as a numeric string (e.g. \"0.00010000\").","Confirm the client queries the current futures funding-info endpoint and the adapter schema matches it.","Treat individual bad entries as skippable in polling loops, logging instead of failing the whole fetch."],"exampleFix":"// before (fixture)\n{\"fundingTime\": 1700000000000}\n// after\n{\"fundingTime\": 1700000000000, \"fundingRate\": \"0.00010000\"}","handlingStrategy":"validation","validationCode":"let _rate: Decimal = rate.funding_rate.parse()\n    .map_err(|_| format!(\"bad funding_rate at {}: {}\", rate.funding_time, rate.funding_rate))?;","typeGuard":null,"tryCatchPattern":"match parse_funding_update(&rate, instrument_id, ts_init) {\n    Ok(update) => emit(update),\n    Err(e) if e.to_string().contains(\"invalid Futures funding rate\") => skip_and_log(e),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Check funding_rate is present and a decimal string before processing.","Keep fixtures in sync with the live funding endpoint schema.","Skip-and-log individual bad entries in polling loops."],"tags":["binance","futures","funding-rate","decimal-parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}