nautechsystems/nautilus_trader · error

Unsupported minute step: {step}

Error message

Unsupported minute step: {step}

What it means

Validation branch in bar_type_to_granularity rejecting MINUTE steps other than 1/5/15/30: Coinbase candle granularity only offers those minute buckets, so any other minute step has no Coinbase equivalent.

Source

Thrown at crates/adapters/coinbase/src/common/parse.rs:138

///
/// Returns an error if the bar type uses an unsupported aggregation or step value.
pub fn bar_type_to_granularity(bar_type: &BarType) -> anyhow::Result<CoinbaseGranularity> {
    let spec = bar_type.spec();

    anyhow::ensure!(
        bar_type.aggregation_source() == AggregationSource::External,
        "Only EXTERNAL aggregation is supported"
    );

    let step = spec.step.get();

    match spec.aggregation {
        BarAggregation::Minute => match step {
            1 => Ok(CoinbaseGranularity::OneMinute),
            5 => Ok(CoinbaseGranularity::FiveMinute),
            15 => Ok(CoinbaseGranularity::FifteenMinute),
            30 => Ok(CoinbaseGranularity::ThirtyMinute),
            _ => anyhow::bail!("Unsupported minute step: {step}"),
        },
        BarAggregation::Hour => match step {
            1 => Ok(CoinbaseGranularity::OneHour),
            2 => Ok(CoinbaseGranularity::TwoHour),
            6 => Ok(CoinbaseGranularity::SixHour),
            _ => anyhow::bail!("Unsupported hour step: {step}"),
        },
        BarAggregation::Day => match step {
            1 => Ok(CoinbaseGranularity::OneDay),
            _ => anyhow::bail!("Unsupported day step: {step}"),
        },
        other => anyhow::bail!("Unsupported aggregation: {other}"),
    }
}

#[cfg(test)]
mod tests {
    use rstest::rstest;

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Use one of Coinbase's supported minute steps: 1, 5, 15, or 30 in the BarType (e.g. `BTC-USD.COINBASE-1-MINUTE.INTERNAL`).
  2. Aggregate locally: request 1-minute bars from Coinbase and combine them into the desired step downstream.
  3. If the exchange must serve the native granularity, use a different data source that supports the step.

Example fix

// before
let bar_type = BarType::from_str("BTC-USD.COINBASE-3-MINUTE.INTERNAL")?;
// after
let bar_type = BarType::from_str("BTC-USD.COINBASE-5-MINUTE.INTERNAL")?;
Defensive patterns

Strategy: validation

Validate before calling

const COINBASE_MINUTE_STEPS: [u64; 4] = [1, 5, 15, 30];
assert!(COINBASE_MINUTE_STEPS.contains(&bar_type.spec().step.get()),
    "Coinbase supports minute steps: 1, 5, 15, 30");

Try / catch

match bar_type_to_granularity(&bar_type) {
    Ok(g) => request_candles(g),
    Err(e) if e.to_string().contains("Unsupported minute step") => {
        // fall back to 1-minute bars and aggregate locally
        request_candles(CoinbaseGranularity::OneMinute);
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling `bar_type_to_granularity` (via `request_bars`) with a `BarType` whose aggregation is `Minute` and step is not one of 1, 5, 15, 30 — e.g. a 3-minute or 2-minute bar type.

Common situations: Requesting bars with a custom minute aggregation not offered by Coinbase's candles API; porting configuration from another exchange adapter that supports arbitrary minute steps.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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