nautechsystems/nautilus_trader · error

unsupported Lighter candle hour step: {step}

Error message

unsupported Lighter candle hour step: {step}

What it means

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.

Source

Thrown at crates/adapters/lighter/src/common/enums.rs:274

        anyhow::ensure!(
            spec.price_type == PriceType::Last,
            "Lighter candles only support LAST price type",
        );

        let step = spec.step.get();
        match spec.aggregation {
            BarAggregation::Minute => match step {
                1 => Ok(Self::OneMinute),
                5 => Ok(Self::FiveMinute),
                15 => Ok(Self::FifteenMinute),
                30 => Ok(Self::ThirtyMinute),
                _ => anyhow::bail!("unsupported Lighter candle minute step: {step}"),
            },
            BarAggregation::Hour => match step {
                1 => Ok(Self::OneHour),
                4 => Ok(Self::FourHour),
                12 => Ok(Self::TwelveHour),
                _ => anyhow::bail!("unsupported Lighter candle hour step: {step}"),
            },
            BarAggregation::Day => match step {
                1 => Ok(Self::OneDay),
                _ => anyhow::bail!("unsupported Lighter candle day step: {step}"),
            },
            BarAggregation::Week => match step {
                1 => Ok(Self::OneWeek),
                _ => anyhow::bail!("unsupported Lighter candle week step: {step}"),
            },
            other => anyhow::bail!("unsupported Lighter candle aggregation: {other}"),
        }
    }
}

/// Lighter historical funding resolution.
#[derive(
    Copy,
    Clone,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Use one of the supported hour steps: 1, 4, or 12.
  2. For 24-hour bars use BarAggregation::Day with step 1.
  3. For unsupported steps like 2h or 6h, subscribe to 1h bars and resample locally.
  4. Validate the step against {1,4,12} before building the BarSpec.

Example fix

// before
BarSpec { aggregation: BarAggregation::Hour, step: 6, .. }
// after
BarSpec { aggregation: BarAggregation::Hour, step: 12, .. } // or resample from 1h bars
Defensive patterns

Strategy: validation

Validate before calling

const LIGHTER_HOUR_STEPS: [u32; 3] = [1, 4, 12];
assert!(LIGHTER_HOUR_STEPS.contains(&bar_spec.step), "Lighter hour bars support steps 1/4/12, got {}", bar_spec.step);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/c6602d1cf94ae03c. Report an issue: GitHub.