{"record":{"id":"14d08df3ae49e1f5","repo":"nautechsystems/nautilus_trader","slug":"unsupported-lighter-candle-minute-step-step","errorCode":null,"errorMessage":"unsupported Lighter candle minute step: {step}","messagePattern":"unsupported Lighter candle minute step: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/common/enums.rs","lineNumber":268,"sourceCode":"        anyhow::ensure!(\n            value.aggregation_source() == AggregationSource::External,\n            \"Lighter candles only support EXTERNAL aggregation\",\n        );\n\n        let spec = value.spec();\n        anyhow::ensure!(\n            spec.price_type == PriceType::Last,\n            \"Lighter candles only support LAST price type\",\n        );\n\n        let step = spec.step.get();\n        match spec.aggregation {\n            BarAggregation::Minute => match step {\n                1 => Ok(Self::OneMinute),\n                5 => Ok(Self::FiveMinute),\n                15 => Ok(Self::FifteenMinute),\n                30 => Ok(Self::ThirtyMinute),\n                _ => anyhow::bail!(\"unsupported Lighter candle minute step: {step}\"),\n            },\n            BarAggregation::Hour => match step {\n                1 => Ok(Self::OneHour),\n                4 => Ok(Self::FourHour),\n                12 => Ok(Self::TwelveHour),\n                _ => anyhow::bail!(\"unsupported Lighter candle hour step: {step}\"),\n            },\n            BarAggregation::Day => match step {\n                1 => Ok(Self::OneDay),\n                _ => anyhow::bail!(\"unsupported Lighter candle day step: {step}\"),\n            },\n            BarAggregation::Week => match step {\n                1 => Ok(Self::OneWeek),\n                _ => anyhow::bail!(\"unsupported Lighter candle week step: {step}\"),\n            },\n            other => anyhow::bail!(\"unsupported Lighter candle aggregation: {other}\"),\n        }\n    }","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/common/enums.rs#L250-L286","documentation":"This error comes from the TryFrom conversion that maps a Nautilus bar specification (BarAggregation::Minute plus a step) to a Lighter WS candle interval. Lighter only exposes 1, 5, 15, and 30 minute candles, so any other minute step is rejected with this message. It is a configuration-time validation guard, raised before any network request is made.","triggerScenarios":"Calling the (BarSpec, ...) -> LighterCandleInterval try_from with aggregation=Minute and a step not in {1, 5, 15, 30}, e.g. BarSpec step 2, 3, 10, 60 (60 belongs to Hour aggregation), when subscribing to bars or requesting historical bars from the Lighter data client.","commonSituations":"Requesting 2-minute or 10-minute bars in a config file; mapping another exchange's interval list onto Lighter; using a step of 60 minutes assuming minutes roll into hours; a programmatically generated BarSpec (e.g. from timedelta) not matching Lighter's fixed intervals.","solutions":["Change the bar aggregation step to one Lighter supports: 1, 5, 15, or 30 minutes.","If you need e.g. 60-minute bars, switch the BarSpec aggregation from Minute to Hour with step 1.","Resample locally: subscribe to 1-minute Lighter bars and aggregate to the desired step in your strategy.","If the step is dynamic, pre-validate it against {1,5,15,30} before constructing the subscription."],"exampleFix":"// before\nBarSpec::new(instrument_id, bar_spec, BarAggregation::Minute, Price::from(\"2\")) // step 2\n// after\nBarSpec::new(instrument_id, bar_spec, BarAggregation::Minute, Price::from(\"5\")) // step 5","handlingStrategy":"validation","validationCode":"const LIGHTER_MINUTE_STEPS: [u32; 4] = [1, 5, 15, 30];\nassert!(LIGHTER_MINUTE_STEPS.contains(&bar_spec.step), \"Lighter minute bars support steps 1/5/15/30, got {}\", bar_spec.step);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a table of Lighter-supported intervals (1/5/15/30m, 1/4/12h, 1d, 1w) and validate bar specs against it at config load time.","Do not map another venue's interval list onto Lighter configs.","For non-native intervals, plan client-side resampling from 1-minute bars."],"tags":["rust","adapter","bar-aggregation","configuration"],"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-14T05:17:10.506Z"}