{"record":{"id":"ef4071b6ff2c1e04","repo":"nautechsystems/nautilus_trader","slug":"derive-does-not-support-aggregation-bars","errorCode":null,"errorMessage":"Derive does not support {aggregation:?} bars","messagePattern":"Derive does not support (.+?) bars","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/derive/src/websocket/parse.rs","lineNumber":678,"sourceCode":"        BarAggregation::Hour => match step {\n            1 => Ok(3600),\n            4 => Ok(14400),\n            8 => Ok(28800),\n            _ => anyhow::bail!(\"Derive only supports hour intervals 1, 4, 8\"),\n        },\n        BarAggregation::Day => {\n            if step != 1 {\n                anyhow::bail!(\"Derive only supports 1 DAY interval bars\");\n            }\n            Ok(86400)\n        }\n        BarAggregation::Week => {\n            if step != 1 {\n                anyhow::bail!(\"Derive only supports 1 WEEK interval bars\");\n            }\n            Ok(604800)\n        }\n        _ => anyhow::bail!(\"Derive does not support {aggregation:?} bars\"),\n    }\n}\n\nfn timestamp_seconds_to_nanos(value: u64, field: &str) -> anyhow::Result<UnixNanos> {\n    let nanos = value\n        .checked_mul(NANOSECONDS_IN_SECOND)\n        .with_context(|| format!(\"Derive {field} overflows nanoseconds\"))?;\n    Ok(UnixNanos::from(nanos))\n}\n\n/// Parses an option ticker payload into [`OptionGreeks`].\n///\n/// Returns `Ok(None)` when the ticker does not carry option pricing.\n///\n/// # Errors\n///\n/// Returns an error when the ticker timestamp is negative or overflows.\npub fn parse_option_greeks(","sourceCodeStart":660,"sourceCodeEnd":696,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/derive/src/websocket/parse.rs#L660-L696","documentation":"bar_spec_to_derive_period only implements Minute/Hour/Day/Week aggregations for the Derive adapter; any other NautilusTrader BarAggregation (e.g. Second, Tick, Volume) has no Derive interval mapping and is rejected with this bail.","triggerScenarios":"Calling request_bars with a BarSpecification whose aggregation is not Minute, Hour, Day, or Week — e.g. BarAggregation::Second, Tick, Volume, or Dollar based bars.","commonSituations":"Reusing a bar spec written for a tick/volume-capable adapter with the Derive adapter; defaulting specs that use second-based aggregation for intraday strategies.","solutions":["Use Minute, Hour, Day, or Week aggregation in the BarSpecification","Use second-based bars only with an adapter that supports them","Check Derive's supported intervals before configuring bar subscriptions"],"exampleFix":"// before\nlet spec = BarSpecification::new(15.into(), BarAggregation::Second, PriceType::Last);\n// after\nlet spec = BarSpecification::new(15.into(), BarAggregation::Minute, PriceType::Last);","handlingStrategy":"validation","validationCode":"const DERIVE_AGGREGATIONS: &[BarAggregation] = &[BarAggregation::Minute, BarAggregation::Hour, BarAggregation::Day, BarAggregation::Week];\nfn is_derive_aggregation_supported(agg: BarAggregation) -> bool {\n    DERIVE_AGGREGATIONS.contains(&agg)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict Derive bar specs to Minute/Hour/Day/Week aggregations","Validate bar specs at config-load time, before requests are issued"],"tags":["rust","bars","unsupported-aggregation","derive-exchange"],"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"}