nautechsystems/nautilus_trader · error

Lighter execution core venue {} does not match configured ve

Error message

Lighter execution core venue {} does not match configured venue {}

What it means

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.

Source

Thrown at crates/adapters/lighter/src/execution.rs:249

    }

    /// Creates a new [`LighterExecutionClient`] instance.
    ///
    /// Resolves credentials from `config` or the matching environment
    /// variables (see [`crate::common::credential`]). Missing credentials
    /// degrade to an unauthenticated client that can bootstrap instruments
    /// but cannot submit transactions; the constructor returns an error if
    /// supplied values are malformed.
    ///
    /// # Errors
    ///
    /// Returns an error if the HTTP client fails to initialize or if any
    /// supplied credential value cannot be parsed.
    pub fn new(
        core: ExecutionClientCore,
        config: LighterExecutionClientConfig,
    ) -> anyhow::Result<Self> {
        anyhow::ensure!(
            core.venue == config.resolved_venue(),
            "Lighter execution core venue {} does not match configured venue {}",
            core.venue,
            config.resolved_venue(),
        );

        anyhow::ensure!(
            config.account_id.get_issuer() == core.venue,
            "Lighter account ID issuer {} does not match configured venue {}",
            config.account_id.get_issuer(),
            core.venue,
        );

        let credential = Credential::resolve_for_deployment(
            config.private_key.clone().map(SecretString::into_inner),
            config.account_index,
            config.api_key_index,
            config.deployment,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Make the ExecutionClientCore venue match the venue in LighterExecutionClientConfig (exact string).
  2. Check config.resolved_venue() logic and any venue default that may differ from your core's venue.
  3. Build the core via the adapter's own factory so venue is derived from the same config.
  4. Log/print both venues to see the mismatch spelled out in the error text.

Example fix

// before
let core = ExecutionClientCore::new(Venue::from("LIGHTER-X"), ...);
let client = LighterExecutionClient::new(core, config)?;
// after
let core = ExecutionClientCore::new(config.resolved_venue(), ...);
let client = LighterExecutionClient::new(core, config)?;
Defensive patterns

Strategy: validation

Validate before calling

if core.venue != config.resolved_venue() {
    return Err(anyhow!("core venue {} != config venue {}", core.venue, config.resolved_venue()));
}

Try / catch

match LighterExecutionClient::new(core, config) {
    Err(e) if e.to_string().contains("execution core venue") => {
        // rebuild core from the same config
    }
    r => r?,
}

Prevention

When it happens

Trigger: 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).

Common situations: Hand-assembling the execution core with a generic/default venue; config venue field edited after the core was built; copying a config between venues.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/b1d402999323cbe3. Report an issue: GitHub.