nautechsystems/nautilus_trader · error

Unsupported day step for Kraken Futures: {step}

Error message

Unsupported day step for Kraken Futures: {step}

What it means

bar_type_to_futures_resolution cannot map the requested Day-aggregation step for Kraken Futures; only a single 1d resolution exists, so any day step other than 1 fails the conversion.

Source

Thrown at crates/adapters/kraken/src/common/parse.rs:1211

    let step = bar_type.spec().step.get() as u32;
    match bar_type.spec().aggregation {
        BarAggregation::Minute => match step {
            1 => Ok("1m"),
            5 => Ok("5m"),
            15 => Ok("15m"),
            _ => anyhow::bail!("Unsupported minute step for Kraken Futures: {step}"),
        },
        BarAggregation::Hour => match step {
            1 => Ok("1h"),
            4 => Ok("4h"),
            12 => Ok("12h"),
            _ => anyhow::bail!("Unsupported hour step for Kraken Futures: {step}"),
        },
        BarAggregation::Day => {
            if step == 1 {
                Ok("1d")
            } else {
                anyhow::bail!("Unsupported day step for Kraken Futures: {step}")
            }
        }
        BarAggregation::Week => {
            if step == 1 {
                Ok("1w")
            } else {
                anyhow::bail!("Unsupported week step for Kraken Futures: {step}")
            }
        }
        other => {
            anyhow::bail!("Unsupported bar aggregation for Kraken Futures: {other:?}");
        }
    }
}

/// Truncates a `ClientOrderId` for Kraken's `cl_ord_id` field.
///
/// Kraken accepts three formats:

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Use Day with step 1 (maps to '1d').
  2. Use Week aggregation with step 1 if a longer bucket is needed (maps to '1w').
  3. Fetch daily bars and aggregate multi-day bars locally.

Example fix

// before
BarSpec::new(BarAggregation::Day, 2)
// after
BarSpec::new(BarAggregation::Day, 1)
Defensive patterns

Strategy: validation

Validate before calling

if bar_type.spec().aggregation == BarAggregation::Day && bar_type.spec().step.get() != 1 {
    eprintln!("Kraken Futures supports only 1d daily bars");
}

Try / catch

match bar_type_to_futures_resolution(&bar_type) {
    Ok(res) => request(res),
    Err(e) if e.to_string().contains("day step") => request("1d").map(|b| aggregate_days(b, step))?,
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: bar_type_to_futures_resolution receives BarAggregation::Day with step != 1 — e.g. weekly-scale 7-day bars or 2-day bars requested from Kraken Futures.

Common situations: Strategies using multi-day bars configured venue-generically; users expecting Kraken Futures to support 2d/3d buckets like some other exchanges.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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