{"record":{"id":"20802885bc70acde","repo":"nautechsystems/nautilus_trader","slug":"slippage-slippage-bps-bps-exceeds-the-configured","errorCode":null,"errorMessage":"Slippage {slippage_bps} bps exceeds the configured `max_slippage_bps` {}","messagePattern":"Slippage (.+?) bps exceeds the configured `max_slippage_bps` (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1619,"sourceCode":"            anyhow::bail!(\n                \"Order amount {base_amount} exceeds the configured `max_order_amount` {}\",\n                self.transaction_limits.max_order_amount\n            );\n        }\n\n        let slippage_bps = match cmd\n            .params\n            .as_ref()\n            .and_then(|params| params.get_u64(\"slippage_bps\"))\n        {\n            Some(value) => u32::try_from(value).map_err(|_| {\n                anyhow::anyhow!(\"slippage_bps parameter {value} exceeds the u32 range\")\n            })?,\n            None => self.transaction_limits.slippage_bps,\n        };\n\n        if slippage_bps > self.transaction_limits.max_slippage_bps {\n            anyhow::bail!(\n                \"Slippage {slippage_bps} bps exceeds the configured `max_slippage_bps` {}\",\n                self.transaction_limits.max_slippage_bps\n            );\n        }\n\n        let quote_spend_ceiling = if order.order_side() == OrderSide::Buy {\n            let ceiling = self\n                .transaction_limits\n                .quote_spend_limits\n                .get(&(token_in, token_out))\n                .ok_or_else(|| {\n                    anyhow::anyhow!(\n                        \"No `quote_spend_limits` entry for BUY token pair {token_in} -> {token_out}\"\n                    )\n                })?;\n            anyhow::ensure!(\n                ceiling.spend_token == quote_token.address,\n                \"Quote spend limit for {token_in} -> {token_out} is denominated in {}, expected quote token {}\",","sourceCodeStart":1601,"sourceCodeEnd":1637,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L1601-L1637","documentation":"The effective slippage for the swap (from the command's slippage_bps parameter, or the configured default) is compared against transaction_limits.max_slippage_bps; exceeding it aborts the swap as a risk guard. slippage_bps may come from cmd parameters or fall back to transaction_limits.slippage_bps.","triggerScenarios":"submit_order where the per-order slippage_bps parameter (or the configured default slippage_bps) is greater than transaction_limits.max_slippage_bps — e.g. passing slippage_bps=500 with a 100 bps cap.","commonSituations":"Strategy requests wide slippage tolerance for volatile pools while the risk config caps it; copying example configs with a higher default than the cap; volatile market periods prompting the operator to widen slippage ad hoc past the cap.","solutions":["Lower the order's slippage_bps parameter to at or below transaction_limits.max_slippage_bps.","Raise `max_slippage_bps` in transaction_limits if the requested tolerance is acceptable.","Reduce the configured default transaction_limits.slippage_bps below the cap."],"exampleFix":"// before\ncmd.slippage_bps = Some(500); // 5%, cap is 100 bps\nclient.submit_order(cmd, &order)?;\n// after\ncmd.slippage_bps = Some(100); // within max_slippage_bps\nclient.submit_order(cmd, &order)?;","handlingStrategy":"validation","validationCode":"// Rust\nlet eff_bps = cmd.slippage_bps.unwrap_or(transaction_limits.slippage_bps);\nif eff_bps > transaction_limits.max_slippage_bps {\n    return Err(anyhow::anyhow!(\"slippage {} bps exceeds cap\", eff_bps));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp per-order slippage_bps to max_slippage_bps at the strategy layer.","Keep the default slippage_bps below the cap.","Review slippage caps after volatility regime changes."],"tags":["blockchain","slippage","risk-limit","configuration"],"backgroundTag":"value-out-of-range","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"}