nautechsystems/nautilus_trader · error

Missing data in pool created event log

Error message

Missing data in pool created event log

What it means

parse_pool_created_event_hypersync throws this when the Hypersync-decoded PoolCreated event payload is None, so the fee and tick_spacing values needed to register the new V3 pool cannot be read. The parser already derived the pool address from topics but requires the decoded data for the remaining fields. Without them the pool cannot be identified with its fee tier.

Source

Thrown at crates/adapters/blockchain/src/exchanges/parsing/uniswap_v3/pool_created.rs:74

        // Extract tick_spacing (first 32 bytes)
        let tick_spacing_bytes: [u8; 32] = data_bytes[0..32].try_into()?;
        let tick_spacing = u32::from_be_bytes(tick_spacing_bytes[28..32].try_into()?);

        // Extract pool_address (next 32 bytes)
        let pool_address_bytes: [u8; 32] = data_bytes[32..64].try_into()?;
        let pool_address = Address::from_slice(&pool_address_bytes[12..32]);

        Ok(PoolCreatedEvent::new(
            block_number,
            token,
            token1,
            pool_address,
            PoolIdentifier::Address(Ustr::from(&pool_address.to_string())), // For V2/V3, pool_identifier = pool_address
            Some(fee),
            Some(tick_spacing),
        ))
    } else {
        Err(anyhow::anyhow!("Missing data in pool created event log"))
    }
}

/// Parses a pool creation event from an RPC log.
///
/// # Errors
///
/// Returns an error if the log parsing fails or if the event data is invalid.
pub fn parse_pool_created_event_rpc(log: &RpcLog) -> anyhow::Result<PoolCreatedEvent> {
    rpc_log::validate_event_signature(log, POOL_CREATED_EVENT_SIGNATURE_HASH, "PoolCreatedEvent")?;

    let block_number = rpc_log::extract_block_number(log)?;
    let token0 = rpc_log::extract_address_from_topic(log, 1, "token0")?;
    let token1 = rpc_log::extract_address_from_topic(log, 2, "token1")?;

    // Extract fee from topic3
    let fee_bytes = rpc_log::extract_topic_bytes(log, 3)?;
    let fee = core::extract_u32_from_bytes(&fee_bytes)?;

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Verify the log's data section contains fee and tickSpacing words (correct for the canonical factory).
  2. Check the Hypersync PoolCreated ABI registration so decoding yields Some(decoded).
  3. Skip and warn on logs with empty data before invoking the parser.
  4. Re-sync the affected block range after fixing ABI/client configuration.
Defensive patterns

Strategy: validation

Validate before calling

fn can_parse_pool_created(log: &Log) -> bool {
    log.data.len() >= 64 // fee, tickSpacing words
}

Type guard

fn has_decoded_pool_created(decoded: &Option<PoolCreatedDecoded>) -> bool {
    decoded.is_some()
}

Try / catch

match parse_pool_created_event_hypersync(&log) {
    Ok(event) => handle(event),
    Err(e) if e.to_string().contains("Missing data in pool created event log") => {
        tracing::warn!("skipping malformed pool-created log");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling parse_pool_created_event_hypersync with a log whose decoded field is None — topic0 matched the PoolCreated signature but the data section (fee, tickSpacing) was absent, truncated, or failed Hypersync decoding.

Common situations: Indexing factory contracts from forks that mimic the event signature; Hypersync ABI registration drift; partial log fetches for older blocks; test fixtures missing the data field.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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