{"record":{"id":"c7492ba44e6e0616","repo":"nautechsystems/nautilus_trader","slug":"derive-only-supports-l2-mbp-order-book-depth","errorCode":null,"errorMessage":"Derive only supports L2_MBP order book depth","messagePattern":"Derive only supports L2_MBP order book depth","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/derive/src/data.rs","lineNumber":850,"sourceCode":"                    instrument_id,\n                    include_expired,\n                )\n                .await\n            {\n                lifecycle.rollback(owner, generation);\n                log::error!(\"Lazy-load failed for {instrument_id} (book deltas): {e}\");\n                return Ok(());\n            }\n\n            run_channel_subscribe(lifecycle, owner, generation, request, ws).await\n        });\n\n        Ok(())\n    }\n\n    fn subscribe_book_depth10(&mut self, cmd: SubscribeBookDepth10) -> anyhow::Result<()> {\n        if cmd.book_type != BookType::L2_MBP {\n            anyhow::bail!(\"Derive only supports L2_MBP order book depth\");\n        }\n\n        let instrument_id = cmd.instrument_id;\n        let owner = ChannelOwner::BookDepth10(instrument_id);\n        let lifecycle = self.subscription_lifecycle();\n        if lifecycle.is_active(owner) {\n            return Ok(());\n        }\n\n        let instrument_name = format_venue_symbol(&instrument_id)?.to_string();\n        let group = orderbook_group(&cmd.params)?;\n        let depth = DeriveOrderbookDepth::D10.to_string();\n        let channel = orderbook_channel(&instrument_name, &group, &depth);\n        let request = ChannelRequest::from_channel(&channel)?;\n        let needs_load = self.prepare_subscribe(instrument_id)?;\n        let Some(generation) = lifecycle.activate(owner, Some(&channel)) else {\n            return Ok(());\n        };","sourceCodeStart":832,"sourceCodeEnd":868,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/derive/src/data.rs#L832-L868","documentation":"Raised by `subscribe_book_depth10` when the requested depth-10 book subscription is not `BookType::L2_MBP`. Like order book deltas, Derive's depth10 feed is only available as level-2 market-by-price, so other book types are rejected.","triggerScenarios":"Issuing a SubscribeBookDepth10 command with `book_type` other than L2_MBP against the Derive data client.","commonSituations":"Depth-10 configs ported from venues with richer book models; generic subscription builders that don't constrain book_type per venue; L1 top-of-book subscriptions attempted through the depth10 channel.","solutions":["Set the subscription's book_type to BookType::L2_MBP.","Use subscribe_book_deltas or ticker feeds instead if only top-of-book data is needed.","Switch venues if a non-L2 book model is a hard requirement."],"exampleFix":"// before\nif cmd.book_type != BookType::L2_MBP { /* rejected */ }\n// after: construct with\nSubscribeBookDepth10 { book_type: BookType::L2_MBP, .. }","handlingStrategy":"validation","validationCode":"assert!(matches!(cmd.book_type, BookType::L2_MBP), \"Derive depth10 requires L2_MBP\");","typeGuard":null,"tryCatchPattern":"if cmd.book_type != BookType::L2_MBP {\n    log::warn!(\"coercing depth10 book_type to L2_MBP for Derive\");\n    cmd.book_type = BookType::L2_MBP;\n}","preventionTips":["Set book_type: L2_MBP for all Derive depth subscriptions.","Gate depth10 subscriptions behind venue-capability checks.","Reuse the same book-type constant for deltas and depth to avoid drift."],"tags":["order-book","subscription","unsupported-value","depth10","derive"],"backgroundTag":"unsupported-operation","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"}