{"record":{"id":"1ab5b941a9614dab","repo":"nautechsystems/nautilus_trader","slug":"max-quote-age-blocks-must-be-in-1-4095","errorCode":null,"errorMessage":"`max_quote_age_blocks` must be in 1..=4095","messagePattern":"`max_quote_age_blocks` must be in 1\\.\\.=4095","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":349,"sourceCode":"            {\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\n    fn validate_manifest_contracts(\n        config: &BlockchainExecutionClientConfig,\n        routers: &[Address],\n        weth: Address,","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L331-L367","documentation":"max_quote_age_blocks bounds how stale a quote (in blocks) may be when used, and is stored in a 12-bit field, so the library enforces 1..=4095. The throws when the configured value is 0 or greater than 4095.","triggerScenarios":"Calling new/transaction_limits with config.max_quote_age_blocks = 0, negative (if signed at config layer), or > 4095.","commonSituations":"Setting 0 intending 'no limit' when the field actually requires a positive bound; entering a seconds value (e.g. 30000) where blocks are expected; large values copied from another chain's config.","solutions":["Set max_quote_age_blocks to an integer between 1 and 4095","Convert time-based staleness to an approximate block count for the target chain's block time","Use 0 carefully: it is invalid; pick the smallest acceptable staleness bound instead"],"exampleFix":"// before\nmax_quote_age_blocks = 0\n// after\nmax_quote_age_blocks = 10","handlingStrategy":"validation","validationCode":"if !(1..=4095).contains(&cfg.max_quote_age_blocks) {\n    return Err(format!(\"max_quote_age_blocks {} must be in 1..=4095\", cfg.max_quote_age_blocks));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Convert desired staleness time to blocks: blocks = seconds / avg_block_time(chain)","Never use 0 to mean 'unlimited'; pick an explicit positive bound","Clamp or reject values at config parse time via serde range validation"],"tags":["config","validation","range"],"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-14T00:17:10.932Z"}