{"record":{"id":"0c3797ec6802bc46","repo":"nautechsystems/nautilus_trader","slug":"unsupported-bar-specification-for-ax-step","errorCode":null,"errorMessage":"Unsupported bar specification for AX: {step}-{:?}","messagePattern":"Unsupported bar specification for AX: (.+?)-(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/common/enums.rs","lineNumber":633,"sourceCode":"    #[serde(rename = \"1d\")]\n    #[strum(serialize = \"1d\")]\n    Days1,\n}\n\nimpl TryFrom<&BarSpecification> for AxCandleWidth {\n    type Error = anyhow::Error;\n\n    fn try_from(spec: &BarSpecification) -> Result<Self, Self::Error> {\n        let step = spec.step.get();\n        match (step, spec.aggregation) {\n            (1, BarAggregation::Second) => Ok(Self::Seconds1),\n            (5, BarAggregation::Second) => Ok(Self::Seconds5),\n            (1, BarAggregation::Minute) => Ok(Self::Minutes1),\n            (5, BarAggregation::Minute) => Ok(Self::Minutes5),\n            (15, BarAggregation::Minute) => Ok(Self::Minutes15),\n            (1, BarAggregation::Hour) => Ok(Self::Hours1),\n            (1, BarAggregation::Day) => Ok(Self::Days1),\n            _ => anyhow::bail!(\n                \"Unsupported bar specification for AX: {step}-{:?}\",\n                spec.aggregation,\n            ),\n        }\n    }\n}\n\n/// WebSocket market data request type (client to server).\n///\n/// # References\n/// - <https://docs.architect.exchange/api-reference/marketdata/md-ws>\n#[derive(\n    Clone,\n    Copy,\n    Debug,\n    Display,\n    Eq,\n    PartialEq,","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/architect_ax/src/common/enums.rs#L615-L651","documentation":"TryFrom conversion from a Nautilus bar specification (step + BarAggregation) to the AX adapter's internal bar-agg enum only supports a fixed whitelist (5s/1m/5m/15m/1h/1d). Any other combination hits the catch-all and bails. This is adapter-level input validation, thrown during subscription/config conversion.","triggerScenarios":"Requesting bar subscriptions with aggregations like Second(1), Minute(30), Hour(4), Week, or Tick on the Architect AX adapter; passing a BarAggregation/step pair outside the match arms.","commonSituations":"Config files requesting e.g. 1-second or 4-hour bars; generic backtest configs reused against AX live nodes; users assuming AX supports all Nautilus aggregations.","solutions":["Change the bar spec to one of the supported pairs: 5-Second, 1-Minute, 5-Minute, 15-Minute, 1-Hour, or 1-Day","Aggregate higher/lower timeframe bars downstream in Nautilus instead of asking AX for them","Add a match arm in enums.rs if the AX API actually supports the desired aggregation"],"exampleFix":"// before\nbar_specs: vec![BarSpecification::new(30, BarAggregation::Minute, PriceType::Last)]\n// after\nbar_specs: vec![BarSpecification::new(15, BarAggregation::Minute, PriceType::Last)]","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[(u64, BarAggregation)] = &[\n    (5, BarAggregation::Second), (1, BarAggregation::Minute),\n    (5, BarAggregation::Minute), (15, BarAggregation::Minute),\n    (1, BarAggregation::Hour), (1, BarAggregation::Day),\n];\nfn is_supported(step: u64, agg: BarAggregation) -> bool {\n    SUPPORTED.iter().any(|(s, a)| *s == step && *a == agg)\n}","typeGuard":null,"tryCatchPattern":"match AxBarAgg::try_from(bar_spec) {\n    Ok(agg) => subscribe(agg),\n    Err(e) => { log::warn!(\"{e}; falling back to 1-Minute bars\"); subscribe(AxBarAgg::Minutes1) }\n}","preventionTips":["Keep venue bar-spec configs restricted to the documented whitelist per adapter","Add a startup config check that validates all bar specs against each venue adapter"],"tags":["rust","adapter","bars","validation","unsupported-value"],"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-23T08:17:48.524Z"}