{"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":1453,"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":1435,"sourceCodeEnd":1471,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/common/parse.rs#L1435-L1471","documentation":"This error is raised by bar_spec_to_binance_interval when a Day-aggregated bar spec uses a step other than 1 or 3, the only daily klines Binance offers (1d, 3d). The conversion cannot proceed and subscription fails.","triggerScenarios":"subscribe_bars or unsubscribe_bars with BarAggregation::Day and step not in {1,3}, e.g. a 2-DAY or 7-DAY bar spec.","commonSituations":"Weekly-equivalent requests expressed as 7-DAY bars instead of 1-WEEK; copy-pasted bar specs from other exchanges that support arbitrary day counts.","solutions":["Use step 1 or 3 for day bars","Express the desired period as a supported interval (7 days = 1 week, 30 days = 1 month)","Aggregate 1d bars internally to synthesize other day multiples"],"exampleFix":"// before\nBarSpec::new(instrument_id, BAR_SPEC_2_DAY, PriceType::Last)\n// after\nBarSpec::new(instrument_id, BAR_SPEC_1_DAY, PriceType::Last)","handlingStrategy":"validation","validationCode":"fn is_supported_day_step(step: u64) -> bool { matches!(step, 1 | 3) }\nassert!(is_supported_day_step(bar_spec.aggregation_step), \"Binance day bars must be 1d or 3d\");","typeGuard":"fn is_supported_day_step(step: u64) -> bool { matches!(step, 1 | 3) }","tryCatchPattern":"match client.subscribe_bars(bar_spec) {\n    Err(e) if e.to_string().contains(\"Unsupported day interval\") => {\n        log::warn!(\"using 1d bars instead\");\n    }\n    r => r?,\n}","preventionTips":["Express 7-day periods as 1-WEEK and 30-day periods as 1-MONTH","Validate bar specs at config-load time, not at subscribe time","Consult Binance kline interval docs when defining new bar specs"],"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"}