Query editor
WITH address_deltas AS (SELECT'ethereum' AS blockchain,"from" AS address,-SUM(CAST(value AS DECIMAL(38, 0))) AS amountFROM erc20_ethereum.evt_transferWHERE contract_address = 0x4c9EDD5852cd905f086C759E8383e09bff1E68B3AND "from" <> 0x0000000000000000000000000000000000000000GROUP BY 1, 2UNION ALLSELECT'ethereum' AS blockchain,"to" AS address,SUM(CAST(value AS DECIMAL(38, 0))) AS amountFROM erc20_ethereum.evt_transferWHERE contract_address = 0x4c9EDD5852cd905f086C759E8383e09bff1E68B3AND "to" <> 0x0000000000000000000000000000000000000000GROUP BY 1, 2UNION ALLSELECT'berachain' AS blockchain,"from" AS address,-SUM(CAST(value AS DECIMAL(38, 0))) AS amountFROM erc20_berachain.evt_transferWHERE contract_address = 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34AND "from" <> 0x0000000000000000000000000000000000000000GROUP BY 1, 2UNION ALLSELECT'berachain' AS blockchain,"to" AS address,SUM(CAST(value AS DECIMAL(38, 0))) AS amountFROM erc20_berachain.evt_transferWHERE contract_address = 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34AND "to" <> 0x0000000000000000000000000000000000000000GROUP BY 1, 2UNION ALLSELECT'mantle' AS blockchain,"from" AS address,-SUM(CAST(value AS DECIMAL(38, 0))) AS amountFROM erc20_mantle.evt_transferWHERE contract_address = 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34AND "from" <> 0x0000000000000000000000000000000000000000GROUP BY 1, 2UNION ALLSELECT'mantle' AS blockchain,"to" AS address,SUM(CAST(value AS DECIMAL(38, 0))) AS amount