Query editor
WITHlrts as (SELECT*FROMquery_5655339),summary as (SELECTday,blockchain,wallet_address,token_address,SUM(amount) as balanceFROM(SELECT"from" AS wallet_address,'ethereum' as blockchain,date_trunc('day', evt_block_time) as day,contract_address as token_address,-SUM(value/1e18) as amountFROMerc20_ethereum.evt_transferWHERE contract_address IN (SELECT token_address FROM lrts WHERE blockchain = 'ethereum')GROUP BY 1, 2, 3, 4UNION ALLSELECTto AS wallet_address,'ethereum' as blockchain,date_trunc('day', evt_block_time) as day,contract_address as token_address,SUM(value/1e18) as amountFROMerc20_ethereum.evt_transferWHERE contract_address IN (SELECT token_address FROM lrts WHERE blockchain = 'ethereum')GROUP BY 1, 2, 3, 4-- UNION ALL-- SELECT-- "from" AS wallet_address,-- 'arbitrum' as blockchain,-- date_trunc('day', evt_block_time) as day,-- contract_address as token_address,-- -SUM(value/1e18) as amount-- FROM-- erc20_arbitrum.evt_transfer-- WHERE contract_address IN (SELECT token_address FROM lrts WHERE blockchain = 'arbitrum')-- GROUP BY 1, 2, 3, 4-- UNION ALL-- SELECT-- to AS wallet_address,-- 'arbitrum' as blockchain,