{"record":{"id":"d86b78b155b94c1a","repo":"nautechsystems/nautilus_trader","slug":"unsupported-minute-step-step","errorCode":null,"errorMessage":"Unsupported minute step: {step}","messagePattern":"Unsupported minute step: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/coinbase/src/common/parse.rs","lineNumber":138,"sourceCode":"///\n/// Returns an error if the bar type uses an unsupported aggregation or step value.\npub fn bar_type_to_granularity(bar_type: &BarType) -> anyhow::Result<CoinbaseGranularity> {\n    let spec = bar_type.spec();\n\n    anyhow::ensure!(\n        bar_type.aggregation_source() == AggregationSource::External,\n        \"Only EXTERNAL aggregation is supported\"\n    );\n\n    let step = spec.step.get();\n\n    match spec.aggregation {\n        BarAggregation::Minute => match step {\n            1 => Ok(CoinbaseGranularity::OneMinute),\n            5 => Ok(CoinbaseGranularity::FiveMinute),\n            15 => Ok(CoinbaseGranularity::FifteenMinute),\n            30 => Ok(CoinbaseGranularity::ThirtyMinute),\n            _ => anyhow::bail!(\"Unsupported minute step: {step}\"),\n        },\n        BarAggregation::Hour => match step {\n            1 => Ok(CoinbaseGranularity::OneHour),\n            2 => Ok(CoinbaseGranularity::TwoHour),\n            6 => Ok(CoinbaseGranularity::SixHour),\n            _ => anyhow::bail!(\"Unsupported hour step: {step}\"),\n        },\n        BarAggregation::Day => match step {\n            1 => Ok(CoinbaseGranularity::OneDay),\n            _ => anyhow::bail!(\"Unsupported day step: {step}\"),\n        },\n        other => anyhow::bail!(\"Unsupported aggregation: {other}\"),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use rstest::rstest;","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/coinbase/src/common/parse.rs#L120-L156","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use one of Coinbase's supported minute steps: 1, 5, 15, or 30 in the BarType (e.g. `BTC-USD.COINBASE-1-MINUTE.INTERNAL`).","Aggregate locally: request 1-minute bars from Coinbase and combine them into the desired step downstream.","If the exchange must serve the native granularity, use a different data source that supports the step."],"exampleFix":"// before\nlet bar_type = BarType::from_str(\"BTC-USD.COINBASE-3-MINUTE.INTERNAL\")?;\n// after\nlet bar_type = BarType::from_str(\"BTC-USD.COINBASE-5-MINUTE.INTERNAL\")?;","handlingStrategy":"validation","validationCode":"const COINBASE_MINUTE_STEPS: [u64; 4] = [1, 5, 15, 30];\nassert!(COINBASE_MINUTE_STEPS.contains(&bar_type.spec().step.get()),\n    \"Coinbase supports minute steps: 1, 5, 15, 30\");","typeGuard":null,"tryCatchPattern":"match bar_type_to_granularity(&bar_type) {\n    Ok(g) => request_candles(g),\n    Err(e) if e.to_string().contains(\"Unsupported minute step\") => {\n        // fall back to 1-minute bars and aggregate locally\n        request_candles(CoinbaseGranularity::OneMinute);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Restrict bar-type configs to Coinbase-supported steps (1/5/15/30 min)","Aggregate custom steps locally from 1-minute candles","Per-exchange validate bar specs before runtime"],"tags":["coinbase","bars","granularity","configuration"],"backgroundTag":"invalid-argument-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}