{"record":{"id":"663493bfa0cfaeb5","repo":"nautechsystems/nautilus_trader","slug":"unsupported-bar-step-step-with-aggregation","errorCode":null,"errorMessage":"Unsupported bar step: {step} with aggregation {:?}","messagePattern":"Unsupported bar step: (.+?) with aggregation (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/dydx/src/common/enums.rs","lineNumber":687,"sourceCode":"impl DydxCandleResolution {\n    /// Maps a Nautilus [`BarSpecification`] to a dYdX candle resolution.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the step/aggregation combination is not supported.\n    pub fn from_bar_spec(spec: &BarSpecification) -> anyhow::Result<Self> {\n        match spec.step.get() {\n            1 => match spec.aggregation {\n                BarAggregation::Minute => Ok(Self::OneMinute),\n                BarAggregation::Hour => Ok(Self::OneHour),\n                BarAggregation::Day => Ok(Self::OneDay),\n                _ => anyhow::bail!(\"Unsupported bar aggregation: {:?}\", spec.aggregation),\n            },\n            5 if spec.aggregation == BarAggregation::Minute => Ok(Self::FiveMinutes),\n            15 if spec.aggregation == BarAggregation::Minute => Ok(Self::FifteenMinutes),\n            30 if spec.aggregation == BarAggregation::Minute => Ok(Self::ThirtyMinutes),\n            4 if spec.aggregation == BarAggregation::Hour => Ok(Self::FourHours),\n            step => anyhow::bail!(\n                \"Unsupported bar step: {step} with aggregation {:?}\",\n                spec.aggregation\n            ),\n        }\n    }\n}\n\n/// dYdX network environment (mainnet vs testnet).\n///\n/// This selects the underlying Cosmos chain for transaction submission.\n#[derive(\n    Copy,\n    Clone,\n    Debug,\n    Default,\n    Display,\n    PartialEq,\n    Eq,","sourceCodeStart":669,"sourceCodeEnd":705,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/dydx/src/common/enums.rs#L669-L705","documentation":"from_bar_spec covers only the specific (step, aggregation) pairs dYdX supports: 1/15/30 Minute, 1 Hour, 1 Day, 5 Minute, 15 Minute, 30 Minute, 4 Hour. Any other step value, regardless of aggregation, falls into the catch-all arm and bails with the step and aggregation in the message.","triggerScenarios":"Requesting bars with a step that is not 1, 5, 15, or 30 for Minute, or not 1 or 4 for Hour — e.g. 2 Minute, 6 Hour, 7 Day bars against dYdX.","commonSituations":"Configuring arbitrary intervals like 2-hour or 3-minute candles that the exchange API does not offer; copying bar specs between adapters with different supported grids.","solutions":["Snap the bar step to a supported dYdX interval: 1/5/15/30 Minute, 1/4 Hour, or 1 Day","Download the nearest coarser supported interval and resample locally","Verify the configured bar spec against dYdX's documented resolution list"],"exampleFix":"// before\nlet spec = BarSpecification::new(6.into(), BarAggregation::Hour, PriceType::Last);\n// after\nlet spec = BarSpecification::new(4.into(), BarAggregation::Hour, PriceType::Last);","handlingStrategy":"validation","validationCode":"fn is_dydx_bar_spec_supported(spec: &BarSpecification) -> bool {\n    match spec.step.get() {\n        1 => matches!(spec.aggregation, BarAggregation::Minute | BarAggregation::Hour | BarAggregation::Day),\n        5 | 15 | 30 => spec.aggregation == BarAggregation::Minute,\n        4 => spec.aggregation == BarAggregation::Hour,\n        _ => false,\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Map desired intervals to the nearest supported dYdX step (1/5/15/30m, 1h/4h, 1d)","Resample locally for intervals the exchange does not offer"],"tags":["rust","bars","dydx-exchange","unsupported-interval"],"backgroundTag":"invalid-argument-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"}