{"record":{"id":"2ba168d44adddb0b","repo":"nautechsystems/nautilus_trader","slug":"max-slippage-bps-max-slippage-bps-must-be-belo","errorCode":null,"errorMessage":"`max_slippage_bps` {max_slippage_bps} must be below {BPS_DENOMINATOR}","messagePattern":"`max_slippage_bps` (.+?) must be below (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":345,"sourceCode":"\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,\n            deadline_seconds,\n            max_quote_age_blocks,\n            receipt_timeout_secs,\n        })\n    }\n","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L327-L363","documentation":"max_slippage_bps is a basis-point ceiling and must be strictly below BPS_DENOMINATOR (10000). The library throws this when the ceiling is 10000 or more, which would permit 100% or more slippage — an invalid/nonsensical bound that could allow complete value loss on a swap.","triggerScenarios":"Calling new/transaction_limits with config.max_slippage_bps >= 10000.","commonSituations":"Confusing percent (100) with basis points (10000) and entering 10000 for '100%'; typos adding a zero; misconfigured limit of e.g. 50000 meaning 50% (should be 5000).","solutions":["Set max_slippage_bps to a value in 0..10000 (e.g. 500 = 5%)","Convert any percent-based figure: bps = percent * 100","Re-check the intent: values >= 10000 are never valid"],"exampleFix":"// before\nmax_slippage_bps = 10000\n// after\nmax_slippage_bps = 500","handlingStrategy":"validation","validationCode":"const BPS_DENOMINATOR: u64 = 10_000;\nif cfg.max_slippage_bps >= BPS_DENOMINATOR {\n    return Err(format!(\"max_slippage_bps {} must be below 10000\", cfg.max_slippage_bps));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Express slippage limits in basis points consistently (500 = 5%)","Never enter percent figures (100) or fractions-of-total (10000 = 100%) as ceilings","Bound the ceiling to a conservative default like 500 in templates"],"tags":["config","validation","slippage","risk"],"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"}