{"record":{"id":"babf1ffdfa353027","repo":"nautechsystems/nautilus_trader","slug":"binance-futures-does-not-support-a-aggregation","errorCode":null,"errorMessage":"Binance Futures does not support {a:?} aggregation","messagePattern":"Binance Futures does not support (.+?) aggregation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/http/client.rs","lineNumber":2991,"sourceCode":"        limit: Option<u32>,\n    ) -> anyhow::Result<Vec<BinanceBar>> {\n        anyhow::ensure!(\n            bar_type.aggregation_source() == AggregationSource::External,\n            \"Only EXTERNAL aggregation is supported\"\n        );\n\n        let spec = bar_type.spec();\n        let step = spec.step.get();\n        let interval = match spec.aggregation {\n            BarAggregation::Second => {\n                anyhow::bail!(\"Binance Futures does not support second-level kline intervals\")\n            }\n            BarAggregation::Minute => format!(\"{step}m\"),\n            BarAggregation::Hour => format!(\"{step}h\"),\n            BarAggregation::Day => format!(\"{step}d\"),\n            BarAggregation::Week => format!(\"{step}w\"),\n            BarAggregation::Month => format!(\"{step}M\"),\n            a => anyhow::bail!(\"Binance Futures does not support {a:?} aggregation\"),\n        };\n\n        let instrument_id = bar_type.instrument_id();\n        let (symbol, price_precision, size_precision) =\n            self.cached_precisions_by_id(instrument_id)?;\n\n        let params = BinanceKlinesParams {\n            symbol,\n            interval,\n            start_time: start.map(|dt| dt.as_millisecond()),\n            end_time: end.map(|dt| dt.as_millisecond()),\n            limit,\n        };\n\n        let klines = self.inner.klines(&params).await?;\n        let now = self.clock.get_time_ns();\n\n        let mut result = Vec::with_capacity(klines.len());","sourceCodeStart":2973,"sourceCodeEnd":3009,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/http/client.rs#L2973-L3009","documentation":"Thrown inside request_binance_bars when the BarAggregation falls into the catch-all arm — i.e. anything other than Second/Minute/Hour/Day/Week/Month, with {a:?} naming the variant (Tick, Volume, Value, or future variants). These aggregation kinds are NautilusTrader-internal constructs with no Binance kline interval equivalent (e.g. 'Binance Futures does not support Tick aggregation'), so the client refuses to translate them.","triggerScenarios":"Requesting venue history for volume-aggregated bars ('...-100-VOLUME-MID-EXTERNAL'), tick bars, or value bars; generic request builders that iterate all BarAggregation variants; strategies migrating from an adapter/venue that exposes volume klines natively.","commonSituations":"Volume/tick-bar trading strategies attempting a historical warm-up from the venue; bar-type strings with the aggregation field misparsed (e.g. step value landing in the aggregation slot); shared data-request code that assumes every aggregation maps to an interval.","solutions":["Use a time-based aggregation (Minute/Hour/Day/Week/Month) for venue klines","For Tick/Volume/Value bars, download historical trades (request_agg_trades within 24h, or klines as an approximation) and run the internal aggregator over them","Skip-and-log non-time aggregations in generic loaders rather than erroring the batch"],"exampleFix":"// before\nlet bar_type: BarType = \"BTCUSDT.BINANCE_PERP-100-VOLUME-LAST-EXTERNAL\".parse()?;\nlet bars = client.request_binance_bars(bar_type, start, end, None).await?;\n\n// after\nlet trades = client.request_agg_trades(instrument_id, None, None, None).await?;\n// aggregate volume bars locally from trades","handlingStrategy":"type-guard","validationCode":"match bar_type.spec().aggregation {\n    BarAggregation::Minute\n    | BarAggregation::Hour\n    | BarAggregation::Day\n    | BarAggregation::Week\n    | BarAggregation::Month => { /* safe to request */ }\n    other => log::warn!(\"unsupported kline aggregation {other:?}; skipping\"),\n}","typeGuard":"fn is_supported_kline_aggregation(bar_type: &BarType) -> bool {\n    matches!(\n        bar_type.spec().aggregation,\n        BarAggregation::Minute\n            | BarAggregation::Hour\n            | BarAggregation::Day\n            | BarAggregation::Week\n            | BarAggregation::Month\n    )\n}","tryCatchPattern":"Skip-and-log: catch the bail, inspect {a:?} in the message, and continue with remaining bar types instead of failing the whole backfill.","preventionTips":["Map Tick/Volume/Value bars to local aggregation from trades","Validate the aggregation field of bar type strings early","Keep venue-vs-internal aggregation routing explicit in data loaders"],"tags":["binance","futures","bars","klines","aggregation","rust","nautilustrader"],"backgroundTag":"unsupported-bar-aggregation","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}