{"record":{"id":"87f63ffc67150701","repo":"nautechsystems/nautilus_trader","slug":"pool-instrument-id-fee-fee-exceeds-uint24","errorCode":null,"errorMessage":"Pool {instrument_id} fee {fee} exceeds uint24","messagePattern":"Pool (.+?) fee (.+?) exceeds uint24","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1180,"sourceCode":"\n        if order.order_side() != OrderSide::Sell {\n            anyhow::bail!(\n                \"Unsupported order side {}; only Sell is supported\",\n                order.order_side()\n            );\n        }\n\n        if order.is_quote_quantity() {\n            anyhow::bail!(\n                \"Quote-denominated quantities are not supported; quantity must be denominated in the base token\"\n            );\n        }\n\n        let fee = pool\n            .fee\n            .ok_or_else(|| anyhow::anyhow!(\"Pool {instrument_id} has no fee tier\"))?;\n        let fee = U24::try_from(fee)\n            .map_err(|_| anyhow::anyhow!(\"Pool {instrument_id} fee {fee} exceeds uint24\"))?;\n\n        let base_token = pool.get_base_token();\n        let quote_token = pool.get_quote_token();\n        let quote_currency = Currency::new_checked(\n            &quote_token.symbol,\n            quote_token.decimals,\n            0,\n            &quote_token.name,\n            CurrencyType::Crypto,\n        )?;\n\n        if !self\n            .transaction_limits\n            .allowed_token_pairs\n            .contains(&(base_token.address, quote_token.address))\n        {\n            anyhow::bail!(\n                \"Token pair {} -> {} is not in the `allowed_token_pairs` allowlist\",","sourceCodeStart":1162,"sourceCodeEnd":1198,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/2114cf6f761429e0adb5ca9596fcd7b895b16011/crates/adapters/blockchain/src/execution/client.rs#L1162-L1198","documentation":"The pool's fee value could not be converted to alloy's U24 type: it exceeds 16,777,215 (2^24 - 1). Uniswap V3 encodes the fee tier in the upper 24 bits of the pool address space, so any fee outside u24 cannot appear in a valid pool. This is effectively a configuration unit error, not a chain condition.","triggerScenarios":"submit_order where the cached pool fee was authored in the wrong units: e.g. fee entered in millionths of a percent, as a decimal fraction scaled up, or pasted from a spec sheet (values like 5_000_000_000 or 0.05*10**12).","commonSituations":"Copy-pasting a '0.0005' probability-style fee and multiplying by the wrong power of ten; mixing up 'fee' (bps*100) with 'tick spacing'; configuration written for a different DEX's fee units.","solutions":["Correct the fee to Uniswap V3's encoding: integer hundredths of a bip, at most 1,000,000 (100%), well under the u24 ceiling","Validate config at load time: assert 0 < fee <= 0xFFFFFF for every configured pool","Cross-check against the on-chain pool: read fee() from the pool contract and use exactly that value"],"exampleFix":"# before: fee authored in wei-like units, exceeds u24\npool.fee = 5_000_000_000  # Pool ... fee exceeds uint24\n\n# after: Uniswap V3 fee encoding (0.05% = 500)\npool.fee = 500\nassert 0 < pool.fee <= 0xFFFFFF","handlingStrategy":"validation","validationCode":"U24_MAX = (1 << 24) - 1\n\ndef valid_uniswap_fee(fee: int | None) -> bool:\n    return fee is not None and 0 < fee <= U24_MAX\n\nfor pool in configured_pools:\n    assert valid_uniswap_fee(pool.fee), f'{pool.instrument_id}: fee must be hundredths of a bip, <= {U24_MAX}'","typeGuard":"def is_uniswap_v3_fee(fee: int | None) -> bool:\n    \"\"\"Uniswap V3 fee tiers: integer hundredths of a bip, u24-encoded.\"\"\"\n    return isinstance(fee, int) and 0 < fee <= 0xFFFFFF","tryCatchPattern":null,"preventionTips":["Write fee tiers in Uniswap V3 units from day one: 100=0.01%, 500=0.05%, 3000=0.30%, 10000=1%","Cross-check the value against the pool contract's immutable fee() before deploying config"],"tags":["blockchain","uniswap-v3","fee-tier","config-validation","range-error"],"backgroundTag":"value-out-of-range","analyzedSha":"2114cf6f761429e0adb5ca9596fcd7b895b16011","analyzedAt":"2026-08-21T11:28:30.864Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}