Query editor
-- Immutable modern-movement bridge for the 2026-07-23 tail re-cut.-- E19 backfill revision (2026-07-23): the original snapshot read-- result_tycho_router_call_fact_v3_live, whose last refresh covered through-- 2026-07-22 ~12:0x UTC, so [2026-07-22 12:01, 2026-07-23) was missing-- (TY16 raw_tail_missing_movement_key = 3,204). Part 1 keeps the live-- snapshot strictly below 2026-07-22; part 2 re-derives the full 2026-07-22-- day with the EXACT movement-tail logic (bounds only), leaving no overlap-- and no gap against the >= 2026-07-23 tails.-- D-059 cutoff-specialized exact movement tail for modern router generations.-- Raw calls and all six physical trace branches are bounded >= 2026-07-23-- and < current UTC date + 1 day.-- Exact economic-input reconciliation keyed by router_call_key.---- Modern wallet-funded ERC20 paths use TransferManager._transferFromUser,-- which measures balanceOf(receiver) before and after each transferFrom and-- passes the actual delta onward. We recover those exact nested trace pairs.-- Vault paths burn exactly declared amountIn after _finalizeBalances verifies-- the negative input delta. Native wallet paths require msg.value == amountIn.-- This helper emits modern router3-new and router3.2 rows only. Legacy\n-- generations are materialized separately before the canonical UNION.WITHraw_router_calls AS (SELECT *FROM dune.propeller_heads.result_tycho_router_call_raw_v3_tailWHERE call_class = 'swap'AND parser_status = 'parsed_declared_input'AND (block_time >= TIMESTAMP '2026-07-22 00:00:00' AND block_time < TIMESTAMP '2026-07-23 00:00:00')),recognized_calls AS (SELECT*,CASEWHEN trace_address IS NULL OR cardinality(trace_address) = 0THEN ''ELSE array_join(transform(trace_address,x -> lpad(CAST(x AS VARCHAR), 10, '0')),'.')END AS router_trace_sort_key,token_in_raw IN (0x0000000000000000000000000000000000000000,0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee) AS token_in_is_nativeFROM raw_router_callsWHERE abi_family IN ('router3new_client_fee', 'router3_2_current')),relevant_transactions AS (SELECT DISTINCT chain, block_date, tx_hashFROM recognized_calls),all_relevant_traces AS (SELECT'ethereum' AS chain,t.block_time,t.block_date,t.tx_hash,t.trace_address,