nautechsystems/nautilus_trader · error
Missing data in pair created event log
Error message
Missing data in pair created event log
What it means
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.
Source
Thrown at crates/adapters/blockchain/src/exchanges/parsing/uniswap_v2/pool_created.rs:74
"PairCreated event data too short: expected at least 32 bytes, was {}",
data_bytes.len()
);
// Extract pair address (first 32 bytes, address is right-aligned)
let pair_address = Address::from_slice(&data_bytes[12..32]);
let pool_identifier = PoolIdentifier::Address(Ustr::from(&pair_address.to_string()));
Ok(PoolCreatedEvent::new(
block_number,
token0,
token1,
pair_address,
pool_identifier, // For V2/V3, pool_identifier = pool_address
None, // V2 has no fee tiers (fixed 0.3%)
None, // V2 has no tick spacing (CPAMM)
))
} else {
Err(anyhow::anyhow!("Missing data in pair created event log"))
}
}
/// Parses a UniswapV2 PairCreated 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, PAIR_CREATED_EVENT_SIGNATURE_HASH, "PairCreatedEvent")?;
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 pair address from data
let data_bytes = rpc_log::extract_data_bytes(log)?;
View on GitHub (pinned to 18893faf8b)
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
Example fix
// before
let parsed = parse_pool_created_event_hypersync(&log)?;
// after
let parsed = match parse_pool_created_event_hypersync(&log) {
Ok(p) => p,
Err(e) if e.to_string().contains("Missing data") => fetch_via_rpc(&log.tx_hash)?,
Err(e) => return Err(e),
}; Defensive patterns
Strategy: try-catch
Validate before calling
fn has_data(log: &Log) -> bool { log.data.is_some() } Type guard
fn log_data(log: &Log) -> Option<&Bytes> { log.data.as_ref() } Try / catch
match parse_pool_created_event_hypersync(&log) {
Ok(p) => use(p),
Err(e) if e.to_string() == "Missing data in pair created event log" => fetch_via_rpc(&log.tx_hash),
Err(e) => Err(e),
} Prevention
- 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
When it happens
Trigger: A hypersync log record for PairCreated arrives with data == None, typically because the ingestion query excluded the data column or the record is corrupt.
Common situations: Data-provider column selection misconfigured; partial ingestion failures; fetching logs from a source that strips non-topic fields.
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
- Missing data in swap event log
- PairCreated event data too short: expected at least 32 bytes
- Topic must be at least 32 bytes, was {}
- Invalid event signature for '{event_name}': expected {expect
- Included wrap transaction {tx_hash} has invalid block number
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/bcce08be573e4842.
Report an issue: GitHub.