{"record":{"id":"abaa43e717c51331","repo":"nautechsystems/nautilus_trader","slug":"missing-tickupper-in-topic3-when-parsing-mint-even","errorCode":null,"errorMessage":"Missing tickUpper in topic3 when parsing mint event","messagePattern":"Missing tickUpper in topic3 when parsing mint event","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/exchanges/parsing/uniswap_v3/mint.rs","lineNumber":76,"sourceCode":"\n    let owner = extract_address_from_topic(log, 1, \"owner\")?;\n\n    // Extract int24 tickLower from topic2 (stored as a 32-byte padded value)\n    let tick_lower = match log.topics.get(2).and_then(|t| t.as_ref()) {\n        Some(topic) => {\n            let tick_lower_bytes: [u8; 32] = topic.as_ref().try_into()?;\n            i32::from_be_bytes(tick_lower_bytes[28..32].try_into()?)\n        }\n        None => anyhow::bail!(\"Missing tickLower in topic2 when parsing mint event\"),\n    };\n\n    // Extract int24 tickUpper from topic3 (stored as a 32-byte padded value)\n    let tick_upper = match log.topics.get(3).and_then(|t| t.as_ref()) {\n        Some(topic) => {\n            let tick_upper_bytes: [u8; 32] = topic.as_ref().try_into()?;\n            i32::from_be_bytes(tick_upper_bytes[28..32].try_into()?)\n        }\n        None => anyhow::bail!(\"Missing tickUpper in topic3 when parsing mint event\"),\n    };\n\n    if let Some(data) = &log.data {\n        let data_bytes = data.as_ref();\n\n        // Validate if data contains 4 parameters of 32 bytes each\n        if data_bytes.len() < 4 * 32 {\n            anyhow::bail!(\"Mint event data is too short\");\n        }\n\n        // Decode the data using the MintEventData struct\n        let decoded = match <MintEventData as SolType>::abi_decode(data_bytes) {\n            Ok(decoded) => decoded,\n            Err(e) => anyhow::bail!(\"Failed to decode mint event data: {e}\"),\n        };\n\n        let pool_address = Address::from_slice(\n            log.address","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/exchanges/parsing/uniswap_v3/mint.rs#L58-L94","documentation":"Guard in parse_mint_event_hypersync: a Uniswap V3 Mint event log is missing topic3, which must carry the 32-byte padded tickUpper value. The log cannot be a well-formed Mint event, so parsing aborts rather than producing a tick with a fabricated value.","triggerScenarios":"A Hypersync log with only 3 topics (signature + owner + tickLower) — the query truncated topics or the fixture omitted the last topic.","commonSituations":"Hypersync field_selection limiting topics to 3 slots, partially-built test logs, or events with only two indexed parameters being misrouted to the Mint parser.","solutions":["Request all four topic slots in the Hypersync query field_selection.","Guard with log.topics.len() >= 4 before parsing ticks.","Confirm topic0 matches the canonical Mint event signature.","Add the tickUpper topic (32-byte big-endian padded int24) to test fixtures."],"exampleFix":"// before\nLogFieldSelection { topics: vec![0, 1, 2], ..Default::default() }\n// after\nLogFieldSelection { topics: vec![0, 1, 2, 3], ..Default::default() }","handlingStrategy":"validation","validationCode":"fn has_tick_upper(log: &HypersyncLog) -> bool {\n    matches!(log.topics.get(3), Some(Some(_)))\n}\nif !has_tick_upper(&log) { skip(&log); }","typeGuard":"fn topic3_bytes(log: &HypersyncLog) -> Option<&[u8; 32]> {\n    log.topics.get(3).and_then(|t| t.as_ref())\n        .and_then(|t| t.as_ref().try_into().ok())\n}","tryCatchPattern":"match parse_mint_event_hypersync(log, dex) {\n    Ok(event) => process(event),\n    Err(e) if e.to_string().contains(\"Missing tickUpper\") => {\n        log::debug!(\"log truncated topics: {e}\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Ensure the Hypersync query selects all four topic slots","Assert log.topics.len() >= 4 as a parse precondition","Validate tickUpper bytes decode to a sane int24 range","Fix fixtures to carry the tickUpper topic"],"tags":["abi-decode","uniswap-v3","hypersync","events"],"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"}