{"record":{"id":"cd4ad169b6206592","repo":"nautechsystems/nautilus_trader","slug":"unknown-subscription-channel-kind","errorCode":null,"errorMessage":"Unknown subscription channel: {kind}","messagePattern":"Unknown subscription channel: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/websocket/client.rs","lineNumber":2329,"sourceCode":"            .is_none_or(|c| !c.is_ascii_alphanumeric())\n    })\n}\n\nfn contains_word(payload: &str, word: &str) -> bool {\n    payload\n        .split(|c: char| !c.is_ascii_alphanumeric())\n        .any(|part| part == word)\n}\n\n// Uses split_once/rsplit_once because coin names can contain colons\n// (e.g., vault tokens `vntls:vCURSOR`)\nfn subscription_from_topic(topic: &str) -> anyhow::Result<SubscriptionRequest> {\n    let (kind, rest) = topic\n        .split_once(':')\n        .map_or((topic, None), |(k, r)| (k, Some(r)));\n\n    let channel = HyperliquidWsChannel::from_wire_str(kind)\n        .ok_or_else(|| anyhow::anyhow!(\"Unknown subscription channel: {kind}\"))?;\n\n    match channel {\n        HyperliquidWsChannel::AllMids => Ok(SubscriptionRequest::AllMids {\n            dex: rest.map(|s| s.to_string()),\n        }),\n        HyperliquidWsChannel::AllDexsAssetCtxs => Ok(SubscriptionRequest::AllDexsAssetCtxs),\n        HyperliquidWsChannel::Notification => Ok(SubscriptionRequest::Notification {\n            user: rest.context(\"Missing user\")?.to_string(),\n        }),\n        HyperliquidWsChannel::WebData2 => Ok(SubscriptionRequest::WebData2 {\n            user: rest.context(\"Missing user\")?.to_string(),\n        }),\n        HyperliquidWsChannel::Candle => {\n            // Format: candle:{coin}:{interval} - interval is last segment\n            let rest = rest.context(\"Missing candle params\")?;\n            let (coin, interval_str) = rest.rsplit_once(':').context(\"Missing interval\")?;\n            let interval = HyperliquidBarInterval::from_str(interval_str)?;\n            Ok(SubscriptionRequest::Candle {","sourceCodeStart":2311,"sourceCodeEnd":2347,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/websocket/client.rs#L2311-L2347","documentation":"subscription_from_topic converts a wire topic string (e.g. \"allMids:\") back into a SubscriptionRequest for replay or lookup. When the kind prefix before ':' is not a recognized HyperliquidWsChannel, this error is thrown. It indicates a topic string the adapter does not understand — usually produced by an incompatible or older/newer wire format.","triggerScenarios":"Calling a reconnect/replay or lookup path with a topic whose channel prefix is not in HyperliquidWsChannel::from_wire_str — e.g. typos, channels renamed between adapter versions, or custom topics constructed outside the adapter.","commonSituations":"Version mismatch where server or persisted topics use channel names this adapter version doesn't know; hand-built topic strings; replaying subscriptions persisted by a different nautilus version.","solutions":["Update the adapter/crate to a version supporting the channel name","Log and skip unknown topics during replay instead of failing","Validate topic strings against supported HyperliquidWsChannel values before use","Check for typos/casing in the channel prefix before the ':'"],"exampleFix":"// before\nlet sub = subscription_from_topic(topic)?;\n// after\nlet sub = match subscription_from_topic(topic) {\n    Ok(s) => s,\n    Err(e) => { log::warn!(\"skipping unknown topic {topic}: {e}\"); continue; }\n};","handlingStrategy":"validation","validationCode":"// Rust\nfn is_supported_topic(topic: &str) -> bool {\n    let kind = topic.split(':').next().unwrap_or(topic);\n    HyperliquidWsChannel::from_wire_str(kind).is_some()\n}","typeGuard":"fn parse_topic(topic: &str) -> Option<SubscriptionRequest> {\n    subscription_from_topic(topic).ok()\n}","tryCatchPattern":"let sub = match subscription_from_topic(topic) {\n    Ok(s) => Some(s),\n    Err(e) => { log::warn!(\"unknown topic {topic}: {e}\"); None }\n};","preventionTips":["Keep the adapter version aligned with the exchange/nautilus version","Only build topics via the adapter's own topic-formatting APIs","Validate channel prefixes against HyperliquidWsChannel before use","Log-and-skip unknown topics in replay loops"],"tags":["websocket","subscription","parsing","hyperliquid"],"backgroundTag":"invalid-enum-value","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"}