{"record":{"id":"58226a31f3aa62ec","repo":"nautechsystems/nautilus_trader","slug":"deribit-does-not-support-a-aggregation","errorCode":null,"errorMessage":"Deribit does not support {a:?} aggregation","messagePattern":"Deribit does not support (.+?) aggregation","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/deribit/src/http/client.rs","lineNumber":1396,"sourceCode":"\n        let now = Timestamp::now();\n\n        // Default to last hour if no start/end provided\n        let end_dt = end.unwrap_or(now);\n        let start_dt = start.unwrap_or(end_dt - jiff::SignedDuration::from_hours(1));\n\n        if let (Some(s), Some(e)) = (start, end) {\n            anyhow::ensure!(s < e, \"Invalid time range: start={s:?} end={e:?}\");\n        }\n\n        // Convert BarType to Deribit resolution\n        let spec = bar_type.spec();\n        let step = spec.step.get();\n        let resolution = match spec.aggregation {\n            BarAggregation::Minute => format!(\"{step}\"),\n            BarAggregation::Hour => format!(\"{}\", step * 60),\n            BarAggregation::Day => \"1D\".to_string(),\n            a => anyhow::bail!(\"Deribit does not support {a:?} aggregation\"),\n        };\n\n        // Validate resolution is supported by Deribit\n        let supported_resolutions = [\n            \"1\", \"3\", \"5\", \"10\", \"15\", \"30\", \"60\", \"120\", \"180\", \"360\", \"720\", \"1D\",\n        ];\n\n        if !supported_resolutions.contains(&resolution.as_str()) {\n            anyhow::bail!(\n                \"Deribit does not support resolution '{resolution}'. Supported: {supported_resolutions:?}\"\n            );\n        }\n\n        let instrument_id = bar_type.instrument_id();\n        let (price_precision, size_precision, use_cost_for_volume) =\n            if let Some(instrument) = self.get_instrument(&instrument_id.symbol.inner()) {\n                (\n                    instrument.price_precision(),","sourceCodeStart":1378,"sourceCodeEnd":1414,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/deribit/src/http/client.rs#L1378-L1414","documentation":"request_bars maps a nautilus BarAggregation to a Deribit resolution string; only Minute, Hour, and Day aggregations are supported. Any other aggregation (e.g. Second, Week, Tick, Volume) bails with 'Deribit does not support {aggregation}'.","triggerScenarios":"Requesting bars with a BarType whose spec.aggregation is anything other than Minute, Hour, or Day — e.g. Second/Tick/Volume aggregations or Weekly bars.","commonSituations":"Configuring a data request with Second-aggregated bars assuming all venues support them; generic strategy code reusing bar specs across venues; requesting WEEK aggregations naively.","solutions":["Use only Minute, Hour, or Day aggregations for Deribit bar requests","Build second/tick-level granularity manually from trades if needed","Validate bar_type.spec().aggregation before issuing the request"],"exampleFix":"// before\nlet bar_type = BarType::new(instrument_id, BarAggregation::Second(10).into(), PriceType::Last);\nlet bars = client.request_bars(bar_type).await?; // bails\n// after\nlet bar_type = BarType::new(instrument_id, BarAggregation::Minute(1).into(), PriceType::Last);\nassert!(matches!(bar_type.spec().aggregation, BarAggregation::Minute(_) | BarAggregation::Hour(_) | BarAggregation::Day(_)));\nlet bars = client.request_bars(bar_type).await?;","handlingStrategy":"validation","validationCode":"fn supports_deribit_aggregation(spec: &BarSpecification) -> bool {\n    matches!(spec.aggregation, BarAggregation::Minute(_) | BarAggregation::Hour(_) | BarAggregation::Day(_))\n}","typeGuard":"fn is_deribit_bar_type(bar_type: &BarType) -> bool {\n    matches!(bar_type.spec().aggregation,\n        BarAggregation::Minute(_) | BarAggregation::Hour(_) | BarAggregation::Day(_))\n}","tryCatchPattern":null,"preventionTips":["Restrict Deribit bar configs to Minute/Hour/Day aggregations","Never reuse tick/second/volume bar specs from other venues for Deribit requests","Add an aggregation check in strategy config validation"],"tags":["bars","deribit","aggregation","unsupported"],"backgroundTag":"unsupported-operation","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"}