{"record":{"id":"dc6701410219e71b","repo":"nautechsystems/nautilus_trader","slug":"unsupported-bar-aggregation-for-kraken-futures-o","errorCode":null,"errorMessage":"Unsupported bar aggregation for Kraken Futures: {other:?}","messagePattern":"Unsupported bar aggregation for Kraken Futures: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/common/parse.rs","lineNumber":1222,"sourceCode":"            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.\npub fn truncate_cl_ord_id(client_order_id: &ClientOrderId) -> String {\n    let id = client_order_id.as_str();\n\n    if id.len() <= 18 {","sourceCodeStart":1204,"sourceCodeEnd":1240,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/common/parse.rs#L1204-L1240","documentation":"Kraken Futures only supports a fixed set of bar aggregation steps (seconds, minutes, hours, days, and 1-week) when converting a NautilusTrader BarType into a Kraken Futures resolution string. Any other aggregation step cannot be mapped, so `bar_type_to_futures_resolution` bails with this error before a REST request is made.","triggerScenarios":"Calling `request_bars` (or invoking `bar_type_to_futures_resolution` directly) with a BarType whose aggregation/step is not one of the supported mappings — e.g. MONTH aggregation or an unusual step Kraken Futures does not offer.","commonSituations":"Requesting bars with a 1-MONTH or 3-MONTH spec; copying a bar spec that works on Kraken Spot or another venue into a Kraken Futures data request.","solutions":["Change the BarSpec aggregation/step to one Kraken Futures supports (SEC/MINUTE/HOUR/DAY steps or 1 WEEK)","Inspect the match arms in crates/adapters/kraken/src/common/parse.rs to see exactly which steps are accepted","Use a different venue adapter if the unsupported aggregation is required"],"exampleFix":"// before\nlet bar_type = BarType::from(\"KF-USD@Kraken-1-MONTH-LAST-INTERNAL\");\nclient.request_bars(bar_type);\n// after\nlet bar_type = BarType::from(\"KF-USD@Kraken-1-DAY-LAST-INTERNAL\");\nclient.request_bars(bar_type);","handlingStrategy":"validation","validationCode":"fn is_futures_supported_bar_spec(spec: &BarSpecification) -> bool {\n    use Aggregation::*;\n    matches!(spec.aggregation(), Second | Minute | Hour | Day)\n        || (spec.aggregation() == Week && spec.step() == 1)\n}\nif !is_futures_supported_bar_spec(bar_type.spec()) { /* fix spec before requesting */ }","typeGuard":"fn is_supported_aggregation(a: Aggregation) -> bool {\n    matches!(a, Aggregation::Second | Aggregation::Minute | Aggregation::Hour | Aggregation::Day | Aggregation::Week)\n}","tryCatchPattern":null,"preventionTips":["Check the venue adapter's supported bar specs before adding bar subscriptions","Keep a table of per-venue supported aggregations in your strategy config","Test bar requests per venue in CI"],"tags":["rust","kraken-futures","bars","unsupported-aggregation"],"backgroundTag":"unsupported-enum-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"}