{"record":{"id":"91ba972e2a0c1bd9","repo":"nautechsystems/nautilus_trader","slug":"slippage-bps-slippage-bps-exceeds-max-slippag","errorCode":null,"errorMessage":"`slippage_bps` {slippage_bps} exceeds `max_slippage_bps` {max_slippage_bps}","messagePattern":"`slippage_bps` (.+?) exceeds `max_slippage_bps` (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":339,"sourceCode":"            })?;\n            let ceiling = QuoteSpendCeiling {\n                spend_token,\n                spend_token_decimals: limit.spend_token_decimals,\n                max_amount,\n            };\n\n            if parsed_quote_spend_limits\n                .insert((token_in, token_out), ceiling)\n                .is_some()\n            {\n                anyhow::bail!(\n                    \"Duplicate quote spend limit for token pair {token_in} -> {token_out}\"\n                );\n            }\n        }\n\n        if slippage_bps > max_slippage_bps {\n            anyhow::bail!(\n                \"`slippage_bps` {slippage_bps} exceeds `max_slippage_bps` {max_slippage_bps}\"\n            );\n        }\n\n        if max_slippage_bps >= BPS_DENOMINATOR {\n            anyhow::bail!(\"`max_slippage_bps` {max_slippage_bps} must be below {BPS_DENOMINATOR}\");\n        }\n\n        if !(1..=4_095).contains(&max_quote_age_blocks) {\n            anyhow::bail!(\"`max_quote_age_blocks` must be in 1..=4095\");\n        }\n\n        Ok(TransactionLimits {\n            allowed_token_pairs: parsed_pairs,\n            quote_spend_limits: parsed_quote_spend_limits,\n            slippage_bps,\n            max_slippage_bps,\n            max_order_amount,","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L321-L357","documentation":"slippage_bps (the intended slippage tolerance) must not exceed max_slippage_bps (the configured hard ceiling). The library throws this when the operator's desired slippage is looser than the maximum permitted, which would violate the risk policy invariant slippage_bps <= max_slippage_bps.","triggerScenarios":"Calling new/transaction_limits with config where slippage_bps > max_slippage_bps, e.g. slippage_bps = 500 and max_slippage_bps = 200.","commonSituations":"Raising tolerance after editing only one of the two fields; copying values from another environment where the ceiling was higher; misunderstanding which field is the cap.","solutions":["Lower config.slippage_bps to at most max_slippage_bps","Raise config.max_slippage_bps if the higher tolerance is intentional (and still < BPS_DENOMINATOR, i.e. < 10000)","Audit both values against the trading risk policy"],"exampleFix":"// before\nslippage_bps = 500\nmax_slippage_bps = 200\n// after\nslippage_bps = 150\nmax_slippage_bps = 200","handlingStrategy":"validation","validationCode":"if cfg.slippage_bps > cfg.max_slippage_bps {\n    return Err(format!(\"slippage_bps {} exceeds max_slippage_bps {}\", cfg.slippage_bps, cfg.max_slippage_bps));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always edit slippage_bps and max_slippage_bps together","Model them as a validated struct with a checked constructor","Assert the invariant in config unit tests"],"tags":["config","validation","slippage"],"backgroundTag":"invalid-config-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}