nautechsystems/nautilus_trader · error

DEX {dex_id} is not registered in the data client

Error message

DEX {dex_id} is not registered in the data client

What it means

get_dex_extended first verifies that the requested DexType is present in the data client's registered DEX set and bails if not. This means the DEX was never registered with the client before use. Registration is a prerequisite for syncing pool events or building pool profilers for that DEX.

Source

Thrown at crates/adapters/blockchain/src/data/core.rs:2397

                "No database available, skipping event replay for pool {}",
                pool.instrument_id
            );
        }

        Ok(())
    }

    /// Determines the starting block for syncing operations.
    fn determine_from_block(&self) -> u64 {
        self.config
            .from_block
            .unwrap_or_else(|| self.cache.min_dex_creation_block().unwrap_or(0))
    }

    /// Retrieves extended DEX information for a registered DEX.
    fn get_dex_extended(&self, dex_id: &DexType) -> anyhow::Result<&DexExtended> {
        if !self.cache.get_registered_dexes().contains(dex_id) {
            anyhow::bail!("DEX {dex_id} is not registered in the data client");
        }

        match get_dex_extended(self.chain.name, dex_id) {
            Some(dex) => Ok(dex),
            None => anyhow::bail!("Dex {dex_id} doesn't exist for chain {}", self.chain.name),
        }
    }

    /// Retrieves a pool from the cache by its address.
    ///
    /// # Errors
    ///
    /// Returns an error if the pool is not registered in the cache.
    pub fn get_pool(&self, pool_identifier: &PoolIdentifier) -> anyhow::Result<&SharedPool> {
        match self.cache.get_pool(pool_identifier) {
            Some(pool) => Ok(pool),
            None => anyhow::bail!("Pool {pool_identifier} is not registered"),
        }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Register the DEX with the data client before syncing (call the register_dex/bootstrap path for it)
  2. Check config DEX names against the supported/registered DEX list for this chain
  3. Inspect cache.get_registered_dexes() output to see what is actually registered
  4. Fix startup ordering so DEX registration completes before pool event sync begins

Example fix

// before
data_client.sync_pool_events(dex_id, ...).await?;
// after
if !data_client.get_registered_dexes().contains(&dex_id) {
    data_client.register_dex(dex_id).await?;
}
data_client.sync_pool_events(dex_id, ...).await?;
Defensive patterns

Strategy: validation

Validate before calling

if !client.get_registered_dexes().contains(&dex_id) {
    return Err(anyhow!("dex {dex_id} must be registered before use"));
}

Type guard

fn is_registered(client: &DataClient, dex_id: &DexType) -> bool {
    client.get_registered_dexes().contains(dex_id)
}

Try / catch

match client.sync_pool_events(&dex_id, ...) {
    Err(e) if e.to_string().contains("not registered") => {
        client.register_dex(&dex_id).await?;
        client.sync_pool_events(&dex_id, ...).await?
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling sync_pool_events, sync_exchange_pools, register_dex, construct_pool_profiler_from_hypersync_rpc (or triggering the related tests) with a DexType that was never added via the client's DEX registration path.

Common situations: Config lists a DEX the bootstrap never registered; typo in the DEX name in config; DEX registration for that chain was skipped or failed earlier; running a pool sync for a DEX supported on another chain but not registered on this one.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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