{"record":{"id":"b12301a582d41c82","repo":"nautechsystems/nautilus_trader","slug":"unsupported-week-step-for-kraken-futures-step","errorCode":null,"errorMessage":"Unsupported week step for Kraken Futures: {step}","messagePattern":"Unsupported week step for Kraken Futures: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/common/parse.rs","lineNumber":1218,"sourceCode":"        },\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        }\n    }\n}\n\n/// Truncates a `ClientOrderId` for Kraken's `cl_ord_id` field.\n///\n/// Kraken accepts three formats:\n/// - Long UUID (36 chars with hyphens): passed through\n/// - Short UUID (32 hex chars): passed through\n/// - Free text: max 18 chars\n///\n/// Sequential NautilusTrader IDs (e.g. `O202602270023210040011`) exceed the\n/// 18-char free-text limit. These are truncated to 'O' + last 17 chars,\n/// preserving the counter portion for maximum entropy.","sourceCodeStart":1200,"sourceCodeEnd":1236,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/common/parse.rs#L1200-L1236","documentation":"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.","triggerScenarios":"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.","commonSituations":"Multi-week bar configurations reused across venues; monthly aggregation attempts (which hit the catch-all instead); strategies assuming uniform bar support across adapters.","solutions":["Use Week with step 1 (maps to '1w').","Fetch weekly bars and aggregate to multi-week buckets locally.","Use Day step 1 bars if the granularity difference is acceptable."],"exampleFix":"// before\nBarSpec::new(BarAggregation::Week, 2)\n// after\nBarSpec::new(BarAggregation::Week, 1)","handlingStrategy":"validation","validationCode":"if bar_type.spec().aggregation == BarAggregation::Week && bar_type.spec().step.get() != 1 {\n    eprintln!(\"Kraken Futures supports only 1w weekly bars\");\n}","typeGuard":null,"tryCatchPattern":"match bar_type_to_futures_resolution(&bar_type) {\n    Ok(res) => request(res),\n    Err(e) if e.to_string().contains(\"week step\") => request(\"1w\").map(|b| aggregate_weeks(b, step))?,\n    Err(e) => return Err(e),\n}","preventionTips":["Use Week step 1 only; aggregate multi-week bars locally.","Keep a Kraken Futures resolution map (1m/5m/15m/1h/4h/12h/1d/1w) in config validation.","Test bar specs against the resolution map in unit tests before live requests."],"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"}