{"record":{"id":"8fa42ca4cd2bd1ab","repo":"nautechsystems/nautilus_trader","slug":"token-is-not-permitted-as-the-pool-expected-ro","errorCode":null,"errorMessage":"Token {} is not permitted as the pool {expected_role} asset","messagePattern":"Token (.+?) is not permitted as the pool (.+?) asset","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":4168,"sourceCode":"        anyhow::ensure!(\n            identities.len() == 1,\n            \"Token {} does not have exactly one deployment manifest identity\",\n            token.address\n        );\n        let identity = identities[0];\n        anyhow::ensure!(\n            identity.name == token.name\n                && identity.symbol == token.symbol\n                && identity.decimals == token.decimals,\n            \"Cached token {} does not match its deployment manifest identity\",\n            token.address\n        );\n        let expected_role = if token.address == plan.pool.get_base_token().address {\n            \"base\"\n        } else {\n            \"quote\"\n        };\n        anyhow::ensure!(\n            matches!(identity.asset_role.as_str(), \"both\") || identity.asset_role == expected_role,\n            \"Token {} is not permitted as the pool {expected_role} asset\",\n            token.address\n        );\n    }\n    Ok(quote_contract)\n}\n\nasync fn validate_profiler_event_verified(\n    position: &BlockPosition,\n    expected_block_hash: B256,\n    pool_address: Address,\n    pool: &Pool,\n    verification: &VerificationCoordinator,\n) -> anyhow::Result<()> {\n    let transaction_hash = B256::from_str(&position.transaction_hash).with_context(|| {\n        format!(\n            \"Invalid profiler transaction hash {}\",","sourceCodeStart":4150,"sourceCodeEnd":4186,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L4150-L4186","documentation":"Token role validation found a token occupying a pool asset slot (base or quote, per expected_role) that it is not permitted to fill per the deployment allowlist/role configuration; the plan's pool composition violates the manifest, so the swap plan is rejected.","triggerScenarios":"Thrown at crates/adapters/blockchain/src/execution/client.rs:4168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the pool's base/quote configuration to match the manifest","Update the manifest if the pool roles legitimately changed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}