{"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":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1575,"sourceCode":"\n        if !matches!(order.order_side(), OrderSide::Buy | OrderSide::Sell) {\n            anyhow::bail!(\n                \"Unsupported order side {}; only Buy and Sell are 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        let (token_in, token_out) =\n            swap_token_pair(order.order_side(), base_token.address, quote_token.address)?;\n\n        if !self\n            .transaction_limits\n            .allowed_token_pairs\n            .contains(&(token_in, token_out))\n        {","sourceCodeStart":1557,"sourceCodeEnd":1593,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L1557-L1593","documentation":"prepare_swap found the pool's fee tier exceeds the u24 maximum when converting to U24; pools are keyed by a uint24 fee parameter, so a fee outside that range cannot represent a valid pool and the conversion fails.","triggerScenarios":"`prepare_swap()` gets `pool.fee = Some(fee)` where fee >= 2^24 (16,777,216) and `U24::try_from(fee)` fails.","commonSituations":"Corrupt or malformed pool metadata (fee parsed from wrong field/units, e.g. raw integer vs basis points); misconfigured custom pool definition with an out-of-range fee; upstream API change in fee representation.","solutions":["Check that pool.fee is in the correct units (Uniswap fee tiers like 500/3000/10000); fix the metadata source/parsing","Correct any manually configured pool fee values so they are < 16,777,216","Re-fetch pool metadata from the chain to replace corrupt cached values"],"exampleFix":"// before\nfee: 30_000_000, // exceeds uint24\n// after\nfee: 3_000, // valid Uniswap V3 tier","handlingStrategy":"validation","validationCode":"let fee = pool.fee.expect(\"fee tier missing\");\nif fee >= (1u64 << 24) {\n    return Err(format!(\"fee {fee} exceeds uint24; check fee units\"));\n}","typeGuard":"fn valid_fee(fee: u64) -> Option<U24> {\n    U24::try_from(fee).ok()\n}","tryCatchPattern":"match client.submit_order(order).await {\n    Err(e) if e.to_string().contains(\"exceeds uint24\") => {\n        // fix pool metadata source/units, refetch, retry\n        reload_pool_metadata(&instrument_id).await?;\n        client.submit_order(order).await\n    }\n    r => r,\n}","preventionTips":["Store fee tiers in native Uniswap units (500/3000/10000)","Validate pool metadata at ingestion time, not at swap time","Beware of basis-point vs raw-fee unit confusion from upstream APIs"],"tags":["blockchain","uniswap","overflow","pool-metadata"],"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-23T08:17:48.524Z"}