{"record":{"id":"49f90ed0d6a8bd20","repo":"nautechsystems/nautilus_trader","slug":"unsupported-derive-public-ws-channel","errorCode":null,"errorMessage":"unsupported Derive public WS channel `{}`","messagePattern":"unsupported Derive public WS channel `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/derive/src/websocket/parse.rs","lineNumber":70,"sourceCode":"///\n/// Returns an error when the channel is unsupported or `params.data` does not\n/// match the channel payload shape.\npub fn parse_public_ws_data(payload: &WsSubscriptionPayload) -> anyhow::Result<DerivePublicWsData> {\n    let channel = payload.channel.as_str();\n\n    if channel.starts_with(\"orderbook.\") {\n        return parse_orderbook_msg(payload).map(DerivePublicWsData::Orderbook);\n    }\n\n    if channel.starts_with(\"trades.\") {\n        return parse_trades_msg(payload).map(DerivePublicWsData::Trades);\n    }\n\n    if channel.starts_with(\"ticker_slim.\") || channel.starts_with(\"ticker.\") {\n        return parse_ticker_msg(payload).map(|msg| DerivePublicWsData::Ticker(Box::new(msg)));\n    }\n\n    anyhow::bail!(\"unsupported Derive public WS channel `{}`\", payload.channel)\n}\n\n/// Parses an order book subscription payload.\n///\n/// # Errors\n///\n/// Returns an error when `params.data` is not a Derive order book snapshot.\npub fn parse_orderbook_msg(payload: &WsSubscriptionPayload) -> anyhow::Result<DeriveOrderbookMsg> {\n    let data = serde_json::from_str::<DeriveOrderbookData>(payload.data.get())\n        .context(\"failed to decode Derive orderbook data\")?;\n    Ok(DeriveOrderbookMsg {\n        channel: payload.channel,\n        data,\n    })\n}\n\n/// Parses a public trades subscription payload.\n///","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/derive/src/websocket/parse.rs#L52-L88","documentation":"parse_public_ws_data dispatches Derive public WebSocket messages by channel name (orderbook, trades, ticker/ticker_slim). Any other channel string reaches the final bail. The adapter simply doesn't implement parsing for that public channel yet.","triggerScenarios":"Subscribing to a public Derive WS channel the adapter doesn't support (e.g. a newer Derive channel or one outside orderbook/trades/ticker), and receiving frames on it that get routed to parse_public_ws_data.","commonSituations":"Adding a subscription to a channel available on Derive's API but not mapped in the adapter; Derive renaming/adding channels in a newer API version; typos in channel subscription strings.","solutions":["Subscribe only to supported public channels: orderbook, trades, ticker/ticker_slim variants","Remove the unsupported channel from the subscription config","If the channel is needed, add a parser and a DerivePublicWsData variant in websocket/parse.rs and route it before the bail","Check the Derive API version for channel renames and update subscription names"],"exampleFix":"// before\nsub.push(\"instrument.\"); // unsupported channel\n// after\nsub.push(\"ticker_slim.ETH-PERP\"); // supported channel","handlingStrategy":"validation","validationCode":"const SUPPORTED: [&str; 3] = [\"orderbook\", \"trades\", \"ticker\"];\nfn channel_supported(ch: &str) -> bool {\n    SUPPORTED.iter().any(|p| ch.starts_with(p))\n}","typeGuard":"fn is_supported_public_channel(payload: &WsPayload) -> bool {\n    payload.channel.starts_with(\"orderbook.\")\n        || payload.channel.starts_with(\"trades.\")\n        || payload.channel.starts_with(\"ticker\")\n}","tryCatchPattern":"match parse_public_ws_data(&payload) {\n    Ok(data) => dispatch(data),\n    Err(e) if e.to_string().contains(\"unsupported Derive public WS channel\") => {\n        log::debug!(\"ignoring unhandled channel: {}\", payload.channel);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Subscribe only to orderbook, trades, and ticker/ticker_slim channels","Review the Derive changelog for channel renames before upgrading API versions","Log unknown channels at debug level and drop them instead of failing the stream"],"tags":["rust","websocket","channel","unsupported"],"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"}