{"record":{"id":"038e920e4a2ca0be","repo":"nautechsystems/nautilus_trader","slug":"invalid-dex-dex-id-in-venue-venue-str","errorCode":null,"errorMessage":"Invalid DEX '{dex_id}' in venue '{venue_str}'","messagePattern":"Invalid DEX '(.+?)' in venue '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/model/src/identifiers/venue.rs","lineNumber":159,"sourceCode":"    /// Parses a venue string to extract blockchain and DEX type information.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if:\n    /// - The venue string is not in the format \"chain:dex\"\n    /// - The chain name is not recognized\n    /// - The DEX name is not recognized\n    pub fn parse_dex(&self) -> anyhow::Result<(Blockchain, DexType)> {\n        let venue_str = self.as_str();\n        let Some((chain_name, dex_id)) = venue_str.split_once(':') else {\n            anyhow::bail!(\"Venue '{venue_str}' is not a DEX venue (expected format 'Chain:DexId')\")\n        };\n\n        let chain = Chain::from_chain_name(chain_name).ok_or_else(|| {\n            anyhow::anyhow!(\"Invalid chain '{chain_name}' in venue '{venue_str}'\")\n        })?;\n        let dex_type = DexType::from_dex_name(dex_id)\n            .ok_or_else(|| anyhow::anyhow!(\"Invalid DEX '{dex_id}' in venue '{venue_str}'\"))?;\n\n        Ok((chain.name, dex_type))\n    }\n}\n\nimpl Debug for Venue {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        write!(f, \"\\\"{}\\\"\", self.0)\n    }\n}\n\nimpl Display for Venue {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        write!(f, \"{}\", self.0)\n    }\n}\n\n/// Validates blockchain venue format \"Chain:DexId\".","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/model/src/identifiers/venue.rs#L141-L177","documentation":"A parse-time validation error in parse_dex: the venue string contained a colon but the portion after it ('dex_id') is not a recognized DEX type name (expected format 'Chain:DexId'). The input at fault is a Venue string whose DEX segment does not match any known DexType.","triggerScenarios":"Calling parse_dex with a venue whose DEX id is unknown, e.g. \"Ethereum:pancakeswap\" on a build that only knows Ethereum DEXs, misspellings like \"Ethereum:UniswapV3\" when the registered name is different.","commonSituations":"Hand-written venue config for a DEX the installation does not support, wrong casing/abbreviation of the DEX name, or mixing chain/DEX pairs that are not registered together.","solutions":["Use the exact registered DEX name accepted by DexType::from_dex_name (check spelling and casing).","Confirm the DEX type exists in the build/registry; enable or register the corresponding DEX support if needed.","Split the venue string on ':' and validate both halves independently to identify which part is wrong."],"exampleFix":"// before\nlet (chain, dex) = Venue::from(\"Solana:uniswap\").parse_dex()?;\n// after\nlet (chain, dex) = Venue::from(\"Solana:raydium\").parse_dex()?;","handlingStrategy":"validation","validationCode":"let (_, dex_id) = venue_str.split_once(':')?;\nif DexType::from_dex_name(dex_id).is_none() {\n    return Err(format!(\"unknown DEX {dex_id}\"));\n}","typeGuard":null,"tryCatchPattern":"// Rust\nlet (chain, dex) = venue.parse_dex().map_err(|e| ConfigError::BadDexVenue(e.to_string()))?;","preventionTips":["Keep a whitelist of supported DEX ids and check config against it","Match DexType names exactly (spelling/casing)","Fail fast at startup when a configured venue is unsupported"],"tags":["identifier","venue","dex","invalid-enum-value"],"backgroundTag":"invalid-enum-value","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"}