{"record":{"id":"66f5659f2b4686cb","repo":"nautechsystems/nautilus_trader","slug":"unsupported-day-interval-step-d","errorCode":null,"errorMessage":"Unsupported day interval: {step}d","messagePattern":"Unsupported day interval: (.+?)d","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/common/parse.rs","lineNumber":1459,"sourceCode":"            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\"),\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","sourceCodeStart":1441,"sourceCodeEnd":1477,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/common/parse.rs#L1441-L1477","documentation":"bar_spec_to_binance_interval supports day steps 1 and 3 only, matching the venue's 1d and 3d kline intervals. Other day steps (2, 7, 14...) have no native interval and bail with this message; 7 days should be expressed as 1-WEEK.","triggerScenarios":"Requesting Binance bars with a day step outside {1, 3} — commonly 7-DAY or 2-DAY specifications.","commonSituations":"Weekly strategies written as 7-DAY instead of 1-WEEK; configs ported from venues with arbitrary daily klines; bi-weekly 14-DAY requests.","solutions":["Remap the step: 7-DAY becomes 1-WEEK; 2-DAY/14-DAY can be composed from 1-DAY bars.","Or use INTERNAL aggregation (e.g. 2-DAY-LAST-INTERNAL) to keep the exact step locally.","Validate BarType strings in config before startup."],"exampleFix":"// before\n// let bar_type = BarType::from(\"7-DAY-LAST-EXTERNAL\");\n// -> Unsupported day interval: 7d\n\n// after\n// let bar_type = BarType::from(\"1-WEEK-LAST-EXTERNAL\"); // same span, native interval","handlingStrategy":"validation","validationCode":"fn supported_day_step(step: u32) -> bool {\n    matches!(step, 1 | 3)\n}","typeGuard":"fn is_supported_day_bar(step: u32) -> bool {\n    matches!(step, 1 | 3)\n}","tryCatchPattern":"let bar_type = BarType::from(\"7-DAY-LAST-EXTERNAL\");\nif let Err(e) = data_client.subscribe_bars(bar_type) {\n    if e.to_string().contains(\"Unsupported day interval\") {\n        // fall back: 1-WEEK external (same span) or 7-DAY-LAST-INTERNAL\n    } else {\n        return Err(e);\n    }\n}","preventionTips":["Only day steps 1 and 3 exist; express 7 days as 1-WEEK.","Use INTERNAL aggregation or client-side composition for other day counts.","Validate BarType strings in config before startup."],"tags":["binance","bars","klines","day-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"}