{"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":1439,"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":1421,"sourceCodeEnd":1457,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/common/parse.rs#L1421-L1457","documentation":"Binance minute klines exist only for fixed steps: 1, 3, 5, 15, and 30 minutes. When a BarSpecification requests Minute aggregation with any other step, bar_spec_to_binance_interval cannot map it to a BinanceKlineInterval and throws this error.","triggerScenarios":"subscribe_bars / unsubscribe_bars (or bar_spec_to_binance_interval) called with BarAggregation::Minute and a step not in {1, 3, 5, 15, 30} — e.g. 2-MINUTE, 10-MINUTE, or 45-MINUTE bars on a Binance venue.","commonSituations":"Strategy configs reused across venues (many crypto venues support 2m/10m; Binance does not); programmatic generation of bar specs at arbitrary steps; migrating a config from an exchange with 10-minute candles to Binance.","solutions":["Change the bar step to a supported value: 1, 3, 5, 15, or 30 minutes","Request a finer supported interval (e.g. 1-MINUTE) and resample to the target period inside the strategy","Validate bar specs against the supported interval list at config load time","Use a venue adapter that supports the desired minute step if the exact period is required"],"exampleFix":"// before\nlet bar_spec = BarSpecification::new(10, BarAggregation::Minute, PriceType::Last);\n// after\nlet bar_spec = BarSpecification::new(15, BarAggregation::Minute, PriceType::Last); // supported by Binance","handlingStrategy":"validation","validationCode":"const SUPPORTED_MINUTE_STEPS: [u64; 5] = [1, 3, 5, 15, 30];\nfn is_supported_minute_step(step: u64) -> bool {\n    SUPPORTED_MINUTE_STEPS.contains(&step)\n}\n// assert step is supported before building a Minute BarSpecification for Binance","typeGuard":null,"tryCatchPattern":"let interval = bar_spec_to_binance_interval(bar_spec)\n    .unwrap_or_else(|e| panic!(\"config error: {e}\")); // fail fast at startup, not at subscribe time","preventionTips":["Restrict bar specs to Binance-supported steps: 1m, 3m, 5m, 15m, 30m","Resample from a supported finer interval for steps like 2m or 10m","Check venue support when porting strategy configs from other exchanges"],"tags":["binance","bars","interval","bar-aggregation","unsupported-value"],"backgroundTag":"invalid-argument-value","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"}