{"record":{"id":"59c83de8c18eebbb","repo":"nautechsystems/nautilus_trader","slug":"unsupported-hour-step-for-kraken-futures-step","errorCode":null,"errorMessage":"Unsupported hour step for Kraken Futures: {step}","messagePattern":"Unsupported hour step for Kraken Futures: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/common/parse.rs","lineNumber":1205,"sourceCode":"/// # Errors\n///\n/// Returns an error if:\n/// - Bar aggregation type is not supported.\n/// - Bar step is not supported for the aggregation type.\npub fn bar_type_to_futures_resolution(bar_type: BarType) -> anyhow::Result<&'static str> {\n    let step = bar_type.spec().step.get() as u32;\n    match bar_type.spec().aggregation {\n        BarAggregation::Minute => match step {\n            1 => Ok(\"1m\"),\n            5 => Ok(\"5m\"),\n            15 => Ok(\"15m\"),\n            _ => anyhow::bail!(\"Unsupported minute step for Kraken Futures: {step}\"),\n        },\n        BarAggregation::Hour => match step {\n            1 => Ok(\"1h\"),\n            4 => Ok(\"4h\"),\n            12 => Ok(\"12h\"),\n            _ => anyhow::bail!(\"Unsupported hour step for Kraken Futures: {step}\"),\n        },\n        BarAggregation::Day => {\n            if step == 1 {\n                Ok(\"1d\")\n            } else {\n                anyhow::bail!(\"Unsupported day step for Kraken Futures: {step}\")\n            }\n        }\n        BarAggregation::Week => {\n            if step == 1 {\n                Ok(\"1w\")\n            } else {\n                anyhow::bail!(\"Unsupported week step for Kraken Futures: {step}\")\n            }\n        }\n        other => {\n            anyhow::bail!(\"Unsupported bar aggregation for Kraken Futures: {other:?}\");\n        }","sourceCodeStart":1187,"sourceCodeEnd":1223,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/common/parse.rs#L1187-L1223","documentation":"bar_type_to_futures_resolution cannot map the requested Hour-aggregation step for Kraken Futures; the futures resolution strings only cover 1h, 4h, and 12h, so any other hour step has no API resolution and the conversion fails.","triggerScenarios":"bar_type_to_futures_resolution receives BarAggregation::Hour with step not in {1, 4, 12} — e.g. 2h, 6h, or 24h bars.","commonSituations":"Bar specs copied from venues supporting arbitrary hour steps (e.g. Binance 2h/8h); multi-venue strategies not per-venue specializing bar specs.","solutions":["Change the hour step to 1, 4, or 12.","Request 1h bars and aggregate locally into 2h/6h/etc. bars.","Use Day aggregation (step 1) instead of 24h bars."],"exampleFix":"// before\nBarSpec::new(BarAggregation::Hour, 2)\n// after\nBarSpec::new(BarAggregation::Hour, 1) // aggregate to 2h locally","handlingStrategy":"validation","validationCode":"const FUTURES_HOUR_STEPS: [u32; 3] = [1, 4, 12];\nif bar_type.spec().aggregation == BarAggregation::Hour\n    && !FUTURES_HOUR_STEPS.contains(&bar_type.spec().step.get() as u32) {\n    eprintln!(\"Kraken Futures hour steps: 1, 4, 12\");\n}","typeGuard":null,"tryCatchPattern":"match bar_type_to_futures_resolution(&bar_type) {\n    Ok(\"1h\") => {},\n    Err(e) if e.to_string().contains(\"hour step\") => switch_to_1h_and_aggregate(&bar_type)?,\n    res => res?,\n}","preventionTips":["Do not copy hour steps from other exchanges (2h/6h/8h) into Kraken Futures configs.","Centralize a per-venue bar-spec whitelist.","Aggregate 1h bars locally for unsupported intervals."],"tags":["kraken-futures","bars","resolution","unsupported"],"backgroundTag":"invalid-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}