{"record":{"id":"93ce50405c88c314","repo":"nautechsystems/nautilus_trader","slug":"invalid-l3-depth-depth-for-kraken-spot-valid-va","errorCode":null,"errorMessage":"Invalid L3 depth {depth} for Kraken Spot, valid values: 10, 100, 1000","messagePattern":"Invalid L3 depth (.+?) for Kraken Spot, valid values: 10, 100, 1000","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/data/spot.rs","lineNumber":304,"sourceCode":"\n        if ws_l3_result.is_ok() {\n            self.ws_l3 = None;\n            self.l3_handler_task = None;\n        }\n        let tasks_result = self.finish_tasks().await;\n        self.is_connected.store(false, Ordering::Release);\n        tasks_result?;\n        ws_result?;\n        Ok(ws_l3_result?)\n    }\n\n    fn subscribe_l3_book(&mut self, cmd: &SubscribeBookDeltas) -> anyhow::Result<()> {\n        let instrument_id = cmd.instrument_id;\n        let symbol_ustr = instrument_id.symbol.inner();\n        let depth = cmd.depth.map_or(1000, |d| d.get() as u32);\n\n        if !matches!(depth, 10 | 100 | 1000) {\n            anyhow::bail!(\"Invalid L3 depth {depth} for Kraken Spot, valid values: 10, 100, 1000\");\n        }\n\n        if !self.config.has_api_credentials() {\n            anyhow::bail!(\n                \"L3 order book requires API credentials; configure api_key and api_secret\"\n            );\n        }\n\n        let handler_finished = self\n            .l3_handler_task\n            .as_ref()\n            .is_none_or(TaskRef::is_finished);\n\n        if self.ws_l3.is_none() {\n            let ws_l3 = KrakenSpotWebSocketClient::l3(\n                self.config.clone(),\n                self.cancellation_token.clone(),\n                self.config","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/data/spot.rs#L286-L322","documentation":"Kraken Spot's L3 order book subscription only accepts snapshot depths of 10, 100, or 1000 levels, matching Kraken's `depth` parameter. A SubscribeBookDeltas command with any other depth is rejected by `subscribe_l3_book` before subscribing.","triggerScenarios":"Subscribing to L3 book deltas on Kraken Spot with `cmd.depth` set to a value other than 10/100/1000 (e.g. 1, 25, 500). depth=None defaults to 1000 and is valid.","commonSituations":"Requesting a custom book depth in a strategy config or via the data engine that does not align with Kraken's allowed snapshot sizes.","solutions":["Set the book subscription depth to 10, 100, or 1000","Omit the depth to use the 1000-level default","Aggregate/round your desired depth down to the nearest supported value"],"exampleFix":"// before\nlet cmd = SubscribeBookDeltas::new(instrument_id, Some(Quantity::from(50)));\n// after\nlet cmd = SubscribeBookDeltas::new(instrument_id, Some(Quantity::from(100))); // one of 10 | 100 | 1000","handlingStrategy":"validation","validationCode":"const KRAKEN_SPOT_L3_DEPTHS: [u32; 3] = [10, 100, 1000];\nlet depth = depth.unwrap_or(1000);\nassert!(KRAKEN_SPOT_L3_DEPTHS.contains(&depth), \"depth must be 10, 100, or 1000\");","typeGuard":"fn is_valid_l3_depth(d: Option<Quantity>) -> bool {\n    matches!(d.map(|q| q.get() as u32), None | Some(10) | Some(100) | Some(1000))\n}","tryCatchPattern":null,"preventionTips":["Snap requested depths to Kraken's allowed set (10/100/1000) in strategy config","Omit depth to accept the 1000-level default","Document per-venue L3 depth constraints when porting strategies"],"tags":["rust","kraken-spot","orderbook","l3-depth"],"backgroundTag":"invalid-argument-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"}