{"record":{"id":"c6602d1cf94ae03c","repo":"nautechsystems/nautilus_trader","slug":"unsupported-lighter-candle-hour-step-step","errorCode":null,"errorMessage":"unsupported Lighter candle hour step: {step}","messagePattern":"unsupported Lighter candle hour step: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/common/enums.rs","lineNumber":274,"sourceCode":"        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    }\n}\n\n/// Lighter historical funding resolution.\n#[derive(\n    Copy,\n    Clone,","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/common/enums.rs#L256-L292","documentation":"Raised by the same try_from conversion when the bar aggregation is Hour but the step is not 1, 4, or 12. Lighter only offers 1h, 4h, and 12h candles, so any other hour step is rejected locally before any request. It guards against impossible subscriptions.","triggerScenarios":"Calling try_from with aggregation=Hour and a step not in {1, 4, 12}, e.g. BarSpec with Hour/step 2, 3, 6, or 24, via subscribe_bars or request_bars on the Lighter adapter.","commonSituations":"Configuring 2-hour or 6-hour bars copied from an exchange that supports them; using Hour/step 24 for daily bars (should be Day/step 1); generated bar specs from generic time deltas.","solutions":["Use one of the supported hour steps: 1, 4, or 12.","For 24-hour bars use BarAggregation::Day with step 1.","For unsupported steps like 2h or 6h, subscribe to 1h bars and resample locally.","Validate the step against {1,4,12} before building the BarSpec."],"exampleFix":"// before\nBarSpec { aggregation: BarAggregation::Hour, step: 6, .. }\n// after\nBarSpec { aggregation: BarAggregation::Hour, step: 12, .. } // or resample from 1h bars","handlingStrategy":"validation","validationCode":"const LIGHTER_HOUR_STEPS: [u32; 3] = [1, 4, 12];\nassert!(LIGHTER_HOUR_STEPS.contains(&bar_spec.step), \"Lighter hour bars support steps 1/4/12, got {}\", bar_spec.step);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember 24h bars are Day/step 1, not Hour/step 24.","Validate hour steps against {1,4,12} before constructing the BarSpec.","Resample locally for 2h/6h 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-14T00:17:10.932Z"}