{"record":{"id":"2a6ecfded070fe42","repo":"nautechsystems/nautilus_trader","slug":"missing-daybasevlm","errorCode":null,"errorMessage":"missing dayBaseVlm","messagePattern":"missing dayBaseVlm","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/websocket/handler.rs","lineNumber":1323,"sourceCode":"        ctx: super::messages::PerpsAssetCtx,\n    ) -> anyhow::Result<HyperliquidDexAssetCtx> {\n        let mark_price = Price::from_decimal(ctx.shared.mark_px).map_err(anyhow::Error::msg)?;\n        let oracle_price = Price::from_decimal(ctx.oracle_px).map_err(anyhow::Error::msg)?;\n        let prev_day_price =\n            Price::from_decimal(ctx.shared.prev_day_px).map_err(anyhow::Error::msg)?;\n        let mid_price = ctx\n            .shared\n            .mid_px\n            .map(|value| Price::from_decimal(value).map_err(anyhow::Error::msg))\n            .transpose()?;\n        let funding_rate = ctx.funding;\n        let open_interest = ctx.open_interest;\n        let premium = ctx.premium;\n        let day_ntl_volume = ctx.shared.day_ntl_vlm;\n        let day_base_volume = ctx\n            .shared\n            .day_base_vlm\n            .ok_or_else(|| anyhow::anyhow!(\"missing dayBaseVlm\"))?;\n        let impact_prices = match ctx.shared.impact_pxs {\n            Some(values) => match values.as_slice() {\n                [bid, ask] => Some(HyperliquidImpactPrices {\n                    bid: bid.parse::<Price>().map_err(anyhow::Error::msg)?,\n                    ask: ask.parse::<Price>().map_err(anyhow::Error::msg)?,\n                }),\n                other => {\n                    anyhow::bail!(\"expected 2 impact prices, received {}\", other.len());\n                }\n            },\n            None => None,\n        };\n\n        Ok(HyperliquidDexAssetCtx {\n            dex: dex.to_string(),\n            instrument_id,\n            mark_price,\n            oracle_price,","sourceCodeStart":1305,"sourceCodeEnd":1341,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/websocket/handler.rs#L1305-L1341","documentation":"This error is raised while normalizing a Hyperliquid `allDexAssetCtx` entry into domain data. The API's `dayBaseVlm` (24h base-asset volume) is an optional field, but the NautilusTrader Hyperliquid adapter requires it to build the asset context; when the exchange payload omits it (or the type is not present), normalization fails instead of silently producing a zero volume.","triggerScenarios":"Calling `normalize_all_dex_asset_ctx_entry` on a `ctx` whose `shared.day_base_vlm` is `None` — i.e. the WebSocket `allMids`/`assetCtxs` message for a DEX asset lacked the `dayBaseVlm` field.","commonSituations":"Hyperliquid API schema changes or partial payloads for newly listed/perp DEX assets where day volume stats are not yet populated; outdated adapter code not handling optional fields; replayed or synthesized test payloads missing the field.","solutions":["Check the raw Hyperliquid payload and confirm `dayBaseVlm` is present in the `assetCtxs` entry; log the JSON if unsure.","Update the hyperliquid adapter / nautilus crate versions together so the payload schema and normalization stay in sync.","If the field is legitimately optional for your asset, relax the code to treat a missing `day_base_vlm` as zero (e.g. `.unwrap_or_default()`) or skip the entry instead of erroring.","Retry subscription; transient partial snapshots can be followed by complete ones."],"exampleFix":"// before\nlet day_base_volume = ctx\n    .shared\n    .day_base_vlm\n    .ok_or_else(|| anyhow::anyhow!(\"missing dayBaseVlm\"))?;\n// after\nlet day_base_volume = ctx.shared.day_base_vlm.unwrap_or_default();","handlingStrategy":"validation","validationCode":"if payload.get(\"dayBaseVlm\").is_none() {\n    // skip or buffer this assetCtx entry\n}\n","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"missing dayBaseVlm\") => {\n        // tolerate partial snapshot: skip entry or retry subscription\n    }\n    other => other?,\n}","preventionTips":["Log raw assetCtxs payloads once when wiring up a new DEX asset to confirm field presence.","Pin and upgrade adapter and API-schema versions together.","Wrap normalization so one bad entry cannot kill the whole stream processing loop."],"tags":["hyperliquid","websocket","optional-field","data-normalization"],"backgroundTag":"missing-required-argument","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"}