{"record":{"id":"af757ed7b7bc4415","repo":"nautechsystems/nautilus_trader","slug":"hyperliquid-does-not-support-a-aggregation","errorCode":null,"errorMessage":"Hyperliquid does not support {a:?} aggregation","messagePattern":"Hyperliquid does not support (.+?) aggregation","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/common/parse.rs","lineNumber":470,"sourceCode":"            30 => ThirtyMinutes,\n            _ => anyhow::bail!(\"Unsupported minute step: {step}\"),\n        },\n        BarAggregation::Hour => match step {\n            1 => OneHour,\n            2 => TwoHours,\n            4 => FourHours,\n            8 => EightHours,\n            12 => TwelveHours,\n            _ => anyhow::bail!(\"Unsupported hour step: {step}\"),\n        },\n        BarAggregation::Day => match step {\n            1 => OneDay,\n            3 => ThreeDays,\n            _ => anyhow::bail!(\"Unsupported day step: {step}\"),\n        },\n        BarAggregation::Week if step == 1 => OneWeek,\n        BarAggregation::Month if step == 1 => OneMonth,\n        a => anyhow::bail!(\"Hyperliquid does not support {a:?} aggregation\"),\n    };\n\n    Ok(interval)\n}\n\n/// Converts a Nautilus order to Hyperliquid request using a pre-resolved asset index.\n///\n/// This variant is used when the caller has already resolved the asset index\n/// from the instrument cache (e.g., for SPOT instruments where the index\n/// cannot be derived from the symbol alone). `slippage_bps` controls the\n/// buffer applied when deriving a limit from a stop trigger price.\npub fn order_to_hyperliquid_request_with_asset(\n    order: &OrderAny,\n    asset: u32,\n    price_decimals: u8,\n    should_normalize_prices: bool,\n    slippage_bps: u32,\n) -> anyhow::Result<HyperliquidExchangePlaceOrderRequest> {","sourceCodeStart":452,"sourceCodeEnd":488,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/common/parse.rs#L452-L488","documentation":"bar_type_to_interval's final match arm rejects aggregation schemes Hyperliquid has no interval concept for. Only Minute, Hour, Day, Week (step 1) and Month (step 1) are supported; aggregations such as Tick, Volume, Value, or Dollar are rejected since they are not exchange-native candle types.","triggerScenarios":"Passing a BarType with a non-time aggregation (Tick/Volume/Value/Dollar etc.) to request_bars, request_bars_from_http, subscribe_bars, or unsubscribe_bars for the Hyperliquid adapter.","commonSituations":"Strategies using volume- or tick-bars shared across venues, generic bar configs that assume the adapter resamples locally, or misconfigured BarType builders where the aggregation enum was set by mistake.","solutions":["Switch to a time-based aggregation (Minute/Hour/Day/Week/Month) with a supported step.","Compute tick/volume bars locally by subscribing to trades and aggregating in the strategy.","If the aggregation was accidental, correct the BarType construction to the intended time aggregation.","Validate bar specs against supported aggregations before subscribing."],"exampleFix":"// before\nlet bar_type = BarType::new(instrument_id, 1000, BarAggregation::Volume, PriceType::Last);\n// after\nlet bar_type = BarType::new(instrument_id, 5, BarAggregation::Minute, PriceType::Last);","handlingStrategy":"validation","validationCode":"fn hyperliquid_native_aggregation(a: BarAggregation) -> bool {\n    matches!(a, BarAggregation::Minute | BarAggregation::Hour\n        | BarAggregation::Day | BarAggregation::Week | BarAggregation::Month)\n}\nif !hyperliquid_native_aggregation(spec.aggregation()) { /* aggregate locally or reject */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only subscribe to exchange-native time bars on Hyperliquid","Build tick/volume bars locally from trade subscriptions","Reject unsupported aggregations during strategy config validation"],"tags":["hyperliquid","bars","aggregation","rust"],"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"}