{"record":{"id":"dc9be10c7a993d90","repo":"nautechsystems/nautilus_trader","slug":"unsupported-month-interval-step-m","errorCode":null,"errorMessage":"Unsupported month interval: {step}M","messagePattern":"Unsupported month interval: (.+?)M","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/common/parse.rs","lineNumber":1461,"sourceCode":"            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\"),\n        },\n        BarAggregation::Month => match step {\n            1 => BinanceKlineInterval::Month1,\n            _ => anyhow::bail!(\"Unsupported month interval: {step}M\"),\n        },\n        agg => anyhow::bail!(\"Unsupported bar aggregation for Binance: {agg:?}\"),\n    };\n\n    Ok(interval)\n}\n\npub(crate) fn quote_to_l1_deltas(quote: QuoteTick, sequence: u64) -> OrderBookDeltas {\n    let bid_action = if quote.bid_size.is_zero() {\n        BookAction::Delete\n    } else {\n        BookAction::Update\n    };\n    let ask_action = if quote.ask_size.is_zero() {\n        BookAction::Delete\n    } else {\n        BookAction::Update\n    };","sourceCodeStart":1443,"sourceCodeEnd":1479,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/common/parse.rs#L1443-L1479","documentation":"Validation branch in bar_spec_to_binance_interval rejecting BarAggregation::Month steps other than 1: Binance klines have no month intervals beyond 1M, so a monthly bar spec with step > 1 cannot be mapped to a Binance interval.","triggerScenarios":"subscribe_bars or unsubscribe_bars with BarAggregation::Month and step != 1, e.g. a 3-MONTH or 6-MONTH bar spec.","commonSituations":"Requesting quarterly or semi-annual bars from Binance for long-horizon backtests or reporting.","solutions":["Change the bar spec to 1-MONTH","Aggregate 1M (or 1d) bars internally to construct quarter bars","Use another data provider that supports multi-month intervals"],"exampleFix":"// before\nBarSpec::new(instrument_id, BAR_SPEC_3_MONTH, PriceType::Last)\n// after\nBarSpec::new(instrument_id, BAR_SPEC_1_MONTH, PriceType::Last)","handlingStrategy":"validation","validationCode":"fn is_supported_month_step(step: u64) -> bool { step == 1 }\nassert!(is_supported_month_step(bar_spec.aggregation_step), \"Binance supports only 1M bars\");","typeGuard":"fn is_supported_month_step(step: u64) -> bool { step == 1 }","tryCatchPattern":"match client.subscribe_bars(bar_spec) {\n    Err(e) if e.to_string().contains(\"Unsupported month interval\") => {\n        log::warn!(\"subscribing 1M and aggregating quarters internally\");\n    }\n    r => r?,\n}","preventionTips":["Use step 1 for all monthly bar specs on Binance","Derive quarterly/annual bars via internal aggregation of 1M or 1d bars","Document the Binance interval matrix in your project's config guide"],"tags":["rust","binance","bar-aggregation","config"],"backgroundTag":"unsupported-enum-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"}