nautechsystems/nautilus_trader · error · anyhow::Error

Unsupported hour step: {step}

Error message

Unsupported hour step: {step}

What it means

For Hour aggregation, bar_type_to_interval only accepts steps 1, 2, 4, 8, and 12, matching Hyperliquid's candle interval enum. Any other hour step (e.g. 3, 6, 24) is rejected with this error since the venue has no such interval.

Source

Thrown at crates/adapters/hyperliquid/src/common/parse.rs:461

        "Only EXTERNAL aggregation is supported"
    );

    let interval = match spec.aggregation {
        BarAggregation::Minute => match step {
            1 => OneMinute,
            3 => ThreeMinutes,
            5 => FiveMinutes,
            15 => FifteenMinutes,
            30 => ThirtyMinutes,
            _ => anyhow::bail!("Unsupported minute step: {step}"),
        },
        BarAggregation::Hour => match step {
            1 => OneHour,
            2 => TwoHours,
            4 => FourHours,
            8 => EightHours,
            12 => TwelveHours,
            _ => anyhow::bail!("Unsupported hour step: {step}"),
        },
        BarAggregation::Day => match step {
            1 => OneDay,
            3 => ThreeDays,
            _ => anyhow::bail!("Unsupported day step: {step}"),
        },
        BarAggregation::Week if step == 1 => OneWeek,
        BarAggregation::Month if step == 1 => OneMonth,
        a => anyhow::bail!("Hyperliquid does not support {a:?} aggregation"),
    };

    Ok(interval)
}

/// Converts a Nautilus order to Hyperliquid request using a pre-resolved asset index.
///
/// This variant is used when the caller has already resolved the asset index
/// from the instrument cache (e.g., for SPOT instruments where the index

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Change the hour step to 1, 2, 4, 8, or 12.
  2. Use a Day-aggregated bar type (step 1 or 3) instead of 24-hour bars.
  3. Resample locally: subscribe to a supported interval (e.g. 4-HOUR) and aggregate to the desired width in the strategy.
  4. Validate the bar spec against supported intervals before subscribing.

Example fix

// before
let bar_type = BarType::new(instrument_id, 6, BarAggregation::Hour, PriceType::Last);
// after
let bar_type = BarType::new(instrument_id, 8, BarAggregation::Hour, PriceType::Last);
Defensive patterns

Strategy: validation

Validate before calling

const HYPERLIQUID_HOUR_STEPS: [u32; 5] = [1, 2, 4, 8, 12];
if spec.aggregation() == BarAggregation::Hour
    && !HYPERLIQUID_HOUR_STEPS.contains(&spec.step()) {
    return Err(anyhow::anyhow!("hour step {} unsupported on Hyperliquid", spec.step()));
}

Prevention

When it happens

Trigger: Calling request_bars / request_bars_from_http / subscribe_bars / unsubscribe_bars with an Hour-aggregated BarType whose step is not {1,2,4,8,12}, e.g. a 6-HOUR or 24-HOUR bar spec.

Common situations: Strategies configured with 24-HOUR bars (should be 1-DAY), 6-HOUR bars from another venue's supported set, or generic resampling configs not tailored to Hyperliquid's interval list.

Related errors


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