Query editor
withdeposit_events as (selectCAST(assets as double) / 1e18 as assets_norm,owner,block_time,block_datefromtable (decode_evm_event (abi => '{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"}',input => table (select*fromethereum.logswherecontract_address = 0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbDand topic0 = 0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7and block_number > 20677433)))where block_time > current_date),withdrawal_events as (select-CAST(assets as double) / 1e18 as assets_norm,owner,block_time,block_datefromtable (decode_evm_event (abi => '{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"}',input => table (select*fromethereum.logswherecontract_address = 0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbDand topic0 = 0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8dband block_number > 20677433)))where block_time > current_date),tagged as (select w.*, ag."group" from (select * from withdrawal_events union all select * from deposit_events) w left join query_5156279 ag on w.owner = ag.account and ag.chain = 'eth')selectsum(assets_norm) as total_withdrawn, coalesce("group", 'Other') as "group", block_datefrom taggedwhere block_date = current_dategroup by "group", block_dateorder by total_withdrawn desc