nautechsystems/nautilus_trader · error

Unsupported week step for Kraken Futures: {step}

Error message

Unsupported week step for Kraken Futures: {step}

What it means

Kraken Futures supports only a weekly ('1w') resolution for Week bars; any Week step other than 1 is rejected. Any aggregation type outside Minute/Hour/Day/Week is rejected by the trailing catch-all arm with a separate message.

Source

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

        },
        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:
/// - Long UUID (36 chars with hyphens): passed through
/// - Short UUID (32 hex chars): passed through
/// - Free text: max 18 chars
///
/// Sequential NautilusTrader IDs (e.g. `O202602270023210040011`) exceed the
/// 18-char free-text limit. These are truncated to 'O' + last 17 chars,
/// preserving the counter portion for maximum entropy.

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Use Week with step 1 (maps to '1w').
  2. Fetch weekly bars and aggregate to multi-week buckets locally.
  3. Use Day step 1 bars if the granularity difference is acceptable.

Example fix

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

Strategy: validation

Validate before calling

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

Try / catch

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

Prevention

When it happens

Trigger: bar_type_to_futures_resolution receives BarAggregation::Week with step != 1 (e.g. bi-weekly bars), during request_bars on the Kraken Futures history API.

Common situations: Multi-week bar configurations reused across venues; monthly aggregation attempts (which hit the catch-all instead); strategies assuming uniform bar support across adapters.

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/b12301a582d41c82. Report an issue: GitHub.