{"record":{"id":"bcce08be573e4842","repo":"nautechsystems/nautilus_trader","slug":"missing-data-in-pair-created-event-log","errorCode":null,"errorMessage":"Missing data in pair created event log","messagePattern":"Missing data in pair created event log","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/exchanges/parsing/uniswap_v2/pool_created.rs","lineNumber":74,"sourceCode":"            \"PairCreated event data too short: expected at least 32 bytes, was {}\",\n            data_bytes.len()\n        );\n\n        // Extract pair address (first 32 bytes, address is right-aligned)\n        let pair_address = Address::from_slice(&data_bytes[12..32]);\n        let pool_identifier = PoolIdentifier::Address(Ustr::from(&pair_address.to_string()));\n\n        Ok(PoolCreatedEvent::new(\n            block_number,\n            token0,\n            token1,\n            pair_address,\n            pool_identifier, // For V2/V3, pool_identifier = pool_address\n            None,            // V2 has no fee tiers (fixed 0.3%)\n            None,            // V2 has no tick spacing (CPAMM)\n        ))\n    } else {\n        Err(anyhow::anyhow!(\"Missing data in pair created event log\"))\n    }\n}\n\n/// Parses a UniswapV2 PairCreated event from an RPC log.\n///\n/// # Errors\n///\n/// Returns an error if the log parsing fails or if the event data is invalid.\npub fn parse_pool_created_event_rpc(log: &RpcLog) -> anyhow::Result<PoolCreatedEvent> {\n    rpc_log::validate_event_signature(log, PAIR_CREATED_EVENT_SIGNATURE_HASH, \"PairCreatedEvent\")?;\n\n    let block_number = rpc_log::extract_block_number(log)?;\n    let token0 = rpc_log::extract_address_from_topic(log, 1, \"token0\")?;\n    let token1 = rpc_log::extract_address_from_topic(log, 2, \"token1\")?;\n\n    // Extract pair address from data\n    let data_bytes = rpc_log::extract_data_bytes(log)?;\n","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/exchanges/parsing/uniswap_v2/pool_created.rs#L56-L92","documentation":"parse_pool_created_event_hypersync throws this when the PairCreated log's data field is entirely absent (None), so the pair address and count cannot be extracted. Unlike the too-short variant, no bytes were provided at all, meaning the log record is incomplete.","triggerScenarios":"A hypersync log record for PairCreated arrives with data == None, typically because the ingestion query excluded the data column or the record is corrupt.","commonSituations":"Data-provider column selection misconfigured; partial ingestion failures; fetching logs from a source that strips non-topic fields.","solutions":["Re-query with the data column included in the hypersync selection","Skip and retry the record — the pair address exists only in the log data","Fall back to an RPC eth_getLogs fetch for the same block/tx to recover full log data","Validate the ingestion pipeline config includes non-indexed event parameters"],"exampleFix":"// before\nlet parsed = parse_pool_created_event_hypersync(&log)?;\n// after\nlet parsed = match parse_pool_created_event_hypersync(&log) {\n    Ok(p) => p,\n    Err(e) if e.to_string().contains(\"Missing data\") => fetch_via_rpc(&log.tx_hash)?,\n    Err(e) => return Err(e),\n};","handlingStrategy":"try-catch","validationCode":"fn has_data(log: &Log) -> bool { log.data.is_some() }","typeGuard":"fn log_data(log: &Log) -> Option<&Bytes> { log.data.as_ref() }","tryCatchPattern":"match parse_pool_created_event_hypersync(&log) {\n    Ok(p) => use(p),\n    Err(e) if e.to_string() == \"Missing data in pair created event log\" => fetch_via_rpc(&log.tx_hash),\n    Err(e) => Err(e),\n}","preventionTips":["Ensure ingestion queries request full log data, not only topics","Fall back to RPC getLogs for records with absent data","Track counts of data-less logs as a pipeline health metric","Verify the event decoder is only fed PairCreated topic0 logs"],"tags":["ethereum","logs","missing-data","uniswap-v2"],"backgroundTag":"missing-required-argument","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"}