{"record":{"id":"73aa65253dcb41bf","repo":"nautechsystems/nautilus_trader","slug":"unsupported-minute-interval-step-m","errorCode":null,"errorMessage":"Unsupported minute interval: {step}m","messagePattern":"Unsupported minute interval: (.+?)m","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/common/parse.rs","lineNumber":1445,"sourceCode":"///\n/// Returns an error if the bar specification does not map to a supported\n/// Binance kline interval.\npub fn bar_spec_to_binance_interval(\n    bar_spec: BarSpecification,\n) -> anyhow::Result<BinanceKlineInterval> {\n    let step = bar_spec.step.get();\n    let interval = match bar_spec.aggregation {\n        BarAggregation::Second => match step {\n            1 => BinanceKlineInterval::Second1,\n            _ => anyhow::bail!(\"Unsupported second interval: {step}s\"),\n        },\n        BarAggregation::Minute => match step {\n            1 => BinanceKlineInterval::Minute1,\n            3 => BinanceKlineInterval::Minute3,\n            5 => BinanceKlineInterval::Minute5,\n            15 => BinanceKlineInterval::Minute15,\n            30 => BinanceKlineInterval::Minute30,\n            _ => anyhow::bail!(\"Unsupported minute interval: {step}m\"),\n        },\n        BarAggregation::Hour => match step {\n            1 => BinanceKlineInterval::Hour1,\n            2 => BinanceKlineInterval::Hour2,\n            4 => BinanceKlineInterval::Hour4,\n            6 => BinanceKlineInterval::Hour6,\n            8 => BinanceKlineInterval::Hour8,\n            12 => BinanceKlineInterval::Hour12,\n            _ => anyhow::bail!(\"Unsupported hour interval: {step}h\"),\n        },\n        BarAggregation::Day => match step {\n            1 => BinanceKlineInterval::Day1,\n            3 => BinanceKlineInterval::Day3,\n            _ => anyhow::bail!(\"Unsupported day interval: {step}d\"),\n        },\n        BarAggregation::Week => match step {\n            1 => BinanceKlineInterval::Week1,\n            _ => anyhow::bail!(\"Unsupported week interval: {step}w\"),","sourceCodeStart":1427,"sourceCodeEnd":1463,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/common/parse.rs#L1427-L1463","documentation":"bar_spec_to_binance_interval supports minute steps 1, 3, 5, 15 and 30 — exactly the minute kline intervals Binance exposes (1m, 3m, 5m, 15m, 30m). Any other minute step (2, 10, 20, 45...) has no venue-side kline interval and bails with this message.","triggerScenarios":"Requesting Binance bars with a BarType whose minute step is not in {1, 3, 5, 15, 30} — commonly 10-MINUTE, 20-MINUTE, or 45-MINUTE specifications.","commonSituations":"Strategy configs assume the platform transparently aggregates any step; configs ported from venues supporting 10m klines; hand-written BarType strings with a mistyped step.","solutions":["Use the nearest supported external interval (1, 3, 5, 15, 30 minutes).","Or keep the exact step with INTERNAL aggregation (e.g. 10-MINUTE-LAST-INTERNAL), which aggregates locally instead of querying the venue.","Validate BarType strings in config before startup."],"exampleFix":"// before\n// let bar_type = BarType::from(\"10-MINUTE-LAST-EXTERNAL\");\n// -> Unsupported minute interval: 10m\n\n// after\n// let bar_type = BarType::from(\"10-MINUTE-LAST-INTERNAL\"); // aggregated locally\n// or\n// let bar_type = BarType::from(\"15-MINUTE-LAST-EXTERNAL\"); // nearest venue interval","handlingStrategy":"validation","validationCode":"fn supported_minute_step(step: u32) -> bool {\n    matches!(step, 1 | 3 | 5 | 15 | 30)\n}","typeGuard":"fn is_supported_minute_bar(step: u32) -> bool {\n    matches!(step, 1 | 3 | 5 | 15 | 30)\n}","tryCatchPattern":"let bar_type = BarType::from(\"10-MINUTE-LAST-EXTERNAL\");\nif let Err(e) = data_client.subscribe_bars(bar_type) {\n    if e.to_string().contains(\"Unsupported minute interval\") {\n        // fall back: 15-MINUTE external or 10-MINUTE-LAST-INTERNAL\n    } else {\n        return Err(e);\n    }\n}","preventionTips":["Hard-check minute steps against {1, 3, 5, 15, 30} during config validation.","Use INTERNAL aggregation to keep arbitrary steps like 10m.","Centralize BarType construction so unsupported specs fail one validated code path."],"tags":["binance","bars","klines","minute-interval","barspecification","rust"],"backgroundTag":"unsupported-bar-interval","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}