Query editor
withtimeline as (select timestamp as dayfrom utils.dayswhere timestamp >= timestamp '2025-03-20'), resupply_pairs as (selectevt_tx_hash as tx_hash, evt_block_time as block_time, address_ as address, collateral, name, protocolId as protocol_idfrom resupply_ethereum.resupplypairdeployer_evt_logdeploy), reusd_redeems as (selectl.tx_hash, l.block_time, date_trunc('day', l.block_time) as day, varbinary_substring(topic1, 13, 20) as caller, p.address as pool, p.name as pool_name, varbinary_to_uint256(varbinary_substring(data, 1, 32)) as amount_raw, cast(varbinary_to_uint256(varbinary_substring(data, 1, 32)) as double) / 1e18 as amount, varbinary_to_uint256(varbinary_substring(data, 33, 32)) as coll_freed_raw, varbinary_to_uint256(varbinary_substring(data, 65, 32)) as protocol_fee_raw, cast(varbinary_to_uint256(varbinary_substring(data, 65, 32)) as double) / 1e18 as protocol_fee, varbinary_to_uint256(varbinary_substring(data, 97, 32)) as debt_reduced_rawfrom ethereum.logs as linner join resupply_pairs as pon l.contract_address = p.addresswhere l.block_time >= (select min(day) from timeline)and l.topic0 = 0x76cd0cedf979345ca241ce6de696a520a8efc860c6c10d9db2a7953307c237fc)selectcaller, substr(cast(caller as varchar), 1, 6) as caller_short, pool_name, sum(amount) as amountfrom reusd_redeemsgroup by 1, 2, 3