nautechsystems/nautilus_trader · error

unsupported Lighter candle aggregation: {other}

Error message

unsupported Lighter candle aggregation: {other}

What it means

Catch-all arm of the LighterCandleInterval try_from conversion: any BarAggregation other than Minute, Hour, Day, or Week (e.g. Second, Tick, Volume) has no Lighter candle counterpart and is rejected with this message. Lighter's candle API is time-bar only with the listed intervals.

Source

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

                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,
    Debug,
    Default,
    Display,
    PartialEq,
    Eq,
    Hash,
    AsRefStr,
    EnumIter,
    EnumString,
    Serialize,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Switch to a time-based aggregation: Minute, Hour, Day, or Week with a supported step.
  2. For sub-minute bars, note Lighter does not offer second candles; use trades/quotes and build bars client-side.
  3. For tick/volume bars, subscribe to the trade stream and aggregate locally.
  4. Check the aggregation before calling the adapter's bar APIs.

Example fix

// before
BarSpec { aggregation: BarAggregation::Second, step: 15, .. }
// after
BarSpec { aggregation: BarAggregation::Minute, step: 1, .. }
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED: [BarAggregation; 4] = [BarAggregation::Minute, BarAggregation::Hour, BarAggregation::Day, BarAggregation::Week];
assert!(SUPPORTED.contains(&bar_spec.aggregation), "Lighter candles require Minute/Hour/Day/Week aggregation");

Prevention

When it happens

Trigger: Calling try_from with aggregation=Second (e.g. Second/step 15), Tick, Volume, or Dollar aggregation for a Lighter bar subscription or historical bar request.

Common situations: Porting strategies built on tick or volume bars from other venues to Lighter; generic configs with SECOND-15 bars; assuming the adapter synthesizes non-time bars.

Related errors


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