Query editor
WITH recipient_groups AS (SELECT * FROM (VALUES(0x149b41b1e4c00b5f9aa34b14fd9f84cfd2f014e5, 'Safe 0x149b — Chainlink SVR'),(0x22cb7c436decc35542c8599c7f0b6a0b7c609371, 'Nine Gemini deposits (1 of 9 known)')) AS t(addr, group_name)),inflow AS (SELECT g.group_name, g.addr, sum(tr.value)/1e18 as eth_in, count(*) as n_in, min(tr.block_date) as first_in, max(tr.block_date) as last_inFROM ethereum.traces tr JOIN recipient_groups g ON g.addr = tr."to"WHERE tr.block_date >= DATE '2025-01-01' AND tr.value > 0 AND (tr.call_type != 'delegatecall' OR tr.call_type IS NULL) AND tr.success AND tr.tx_successGROUP BY 1,2),outflow AS (SELECT g.group_name, g.addr, sum(tr.value)/1e18 as eth_out, count(*) as n_outFROM ethereum.traces tr JOIN recipient_groups g ON g.addr = tr."from"WHERE tr.block_date >= DATE '2025-01-01' AND tr.value > 0 AND (tr.call_type != 'delegatecall' OR tr.call_type IS NULL) AND tr.success AND tr.tx_successGROUP BY 1,2)SELECT i.group_name, i.addr, i.eth_in, i.n_in, i.first_in, i.last_in, coalesce(o.eth_out,0) as eth_out, coalesce(o.n_out,0) as n_outFROM inflow i LEFT JOIN outflow o ON o.addr = i.addrORDER BY i.group_name