{"record":{"id":"e367fecf77b86c17","repo":"nautechsystems/nautilus_trader","slug":"hyperliquid-only-supports-l2-mbp-order-book-deltas","errorCode":null,"errorMessage":"Hyperliquid only supports L2_MBP order book deltas","messagePattern":"Hyperliquid only supports L2_MBP order book deltas","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/data.rs","lineNumber":894,"sourceCode":"\n    fn subscribe_instrument(&mut self, cmd: SubscribeInstrument) -> anyhow::Result<()> {\n        let instruments = self.instruments.load();\n        if let Some(instrument) = instruments.get(&cmd.instrument_id) {\n            if let Err(e) = self\n                .data_sender\n                .send(DataEvent::Instrument(instrument.clone()))\n            {\n                log::error!(\"Failed to send instrument {}: {e}\", cmd.instrument_id);\n            }\n        } else {\n            log::warn!(\"Instrument {} not found in cache\", cmd.instrument_id);\n        }\n        Ok(())\n    }\n\n    fn subscribe_book_deltas(&mut self, subscription: SubscribeBookDeltas) -> anyhow::Result<()> {\n        if subscription.book_type != BookType::L2_MBP {\n            anyhow::bail!(\"Hyperliquid only supports L2_MBP order book deltas\");\n        }\n\n        let ws = self.ws_client.clone();\n        let instrument_id = subscription.instrument_id;\n        let (n_sig_figs, mantissa) = parse_book_precision_params(subscription.params.as_ref())?;\n        self.register_stream_health(MarketDataChannel::Deltas, instrument_id);\n\n        self.spawn_task(\"subscribe_book_deltas\", async move {\n            ws.subscribe_book_with_options(instrument_id, n_sig_figs, mantissa)\n                .await\n        });\n\n        Ok(())\n    }\n\n    fn subscribe_book_depth10(&mut self, subscription: SubscribeBookDepth10) -> anyhow::Result<()> {\n        log::debug!(\n            \"Subscribing to book depth10: {}\",","sourceCodeStart":876,"sourceCodeEnd":912,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/data.rs#L876-L912","documentation":"The Hyperliquid data client only maintains L2 market-by-price (L2_MBP) order books. subscribe_book_deltas checks subscription.book_type and rejects anything else (e.g. L1_MBP or L3_MBP) because the venue's WebSocket feed cannot populate those book constructions.","triggerScenarios":"Subscribing to order book deltas with SubscribeBookDeltas whose book_type is not BookType::L2_MBP — e.g. a config setting book_type=L1_MBP for a Hyperliquid instrument.","commonSituations":"Sharing one subscription config across venues where another venue uses L1_MBP; default book type settings from a different adapter carried over to Hyperliquid.","solutions":["Set book_type=BookType::L2_MBP in the subscription for Hyperliquid order book data.","Adjust the data engine/strategy config so Hyperliquid instruments request L2_MBP books.","If L1/L3 semantics are required, use a venue that supports them; Hyperliquid cannot serve them."],"exampleFix":"// before\nrequest.book_type = BookType::L1_MBP;\n// after\nrequest.book_type = BookType::L2_MBP;","handlingStrategy":"validation","validationCode":"assert_eq!(subscription.book_type, BookType::L2_MBP, \"Hyperliquid requires L2_MBP book data\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure book_type=L2_MBP for all Hyperliquid book subscriptions.","Use venue-specific data config templates rather than shared ones.","Validate subscription configs at strategy startup."],"tags":["order-book","unsupported-feature","subscription","hyperliquid"],"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"}