{"record":{"id":"b1d402999323cbe3","repo":"nautechsystems/nautilus_trader","slug":"lighter-execution-core-venue-does-not-match-con","errorCode":null,"errorMessage":"Lighter execution core venue {} does not match configured venue {}","messagePattern":"Lighter execution core venue (.+?) does not match configured venue (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":249,"sourceCode":"    }\n\n    /// Creates a new [`LighterExecutionClient`] instance.\n    ///\n    /// Resolves credentials from `config` or the matching environment\n    /// variables (see [`crate::common::credential`]). Missing credentials\n    /// degrade to an unauthenticated client that can bootstrap instruments\n    /// but cannot submit transactions; the constructor returns an error if\n    /// supplied values are malformed.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the HTTP client fails to initialize or if any\n    /// supplied credential value cannot be parsed.\n    pub fn new(\n        core: ExecutionClientCore,\n        config: LighterExecutionClientConfig,\n    ) -> anyhow::Result<Self> {\n        anyhow::ensure!(\n            core.venue == config.resolved_venue(),\n            \"Lighter execution core venue {} does not match configured venue {}\",\n            core.venue,\n            config.resolved_venue(),\n        );\n\n        anyhow::ensure!(\n            config.account_id.get_issuer() == core.venue,\n            \"Lighter account ID issuer {} does not match configured venue {}\",\n            config.account_id.get_issuer(),\n            core.venue,\n        );\n\n        let credential = Credential::resolve_for_deployment(\n            config.private_key.clone().map(SecretString::into_inner),\n            config.account_index,\n            config.api_key_index,\n            config.deployment,","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L231-L267","documentation":"At LighterExecutionClient::new, the venue recorded on the ExecutionClientCore must equal the venue resolved from the Lighter execution config. A mismatch means the execution core was built for a different venue than the config implies, so the client refuses to construct to avoid routing orders to the wrong venue.","triggerScenarios":"Constructing a LighterExecutionClient with a core whose venue field differs from config.resolved_venue() — e.g. venue name mismatch between client builder and config (different spelling, case, or default venue).","commonSituations":"Hand-assembling the execution core with a generic/default venue; config venue field edited after the core was built; copying a config between venues.","solutions":["Make the ExecutionClientCore venue match the venue in LighterExecutionClientConfig (exact string).","Check config.resolved_venue() logic and any venue default that may differ from your core's venue.","Build the core via the adapter's own factory so venue is derived from the same config.","Log/print both venues to see the mismatch spelled out in the error text."],"exampleFix":"// before\nlet core = ExecutionClientCore::new(Venue::from(\"LIGHTER-X\"), ...);\nlet client = LighterExecutionClient::new(core, config)?;\n// after\nlet core = ExecutionClientCore::new(config.resolved_venue(), ...);\nlet client = LighterExecutionClient::new(core, config)?;","handlingStrategy":"validation","validationCode":"if core.venue != config.resolved_venue() {\n    return Err(anyhow!(\"core venue {} != config venue {}\", core.venue, config.resolved_venue()));\n}","typeGuard":null,"tryCatchPattern":"match LighterExecutionClient::new(core, config) {\n    Err(e) if e.to_string().contains(\"execution core venue\") => {\n        // rebuild core from the same config\n    }\n    r => r?,\n}","preventionTips":["Derive the execution core from the same config object.","Never hand-set the core venue independently of config.","Log both venue values when assembling clients."],"tags":["venue-mismatch","config","execution-client","validation"],"backgroundTag":"invalid-config-value","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"}