Query editor
withday_address_base as(SELECTaddress as address,-- day,case when sum(cumulative_sum) < 10000 then '0~10000'when sum(cumulative_sum) < 100000 then '10000~100000'when sum(cumulative_sum) < 500000 then '100000~500000'when sum(cumulative_sum) < 1000000 then '500000~1000000'when sum(cumulative_sum) < 5000000 then '1000000~5000000'when sum(cumulative_sum) < 10000000 then '5000000~10000000'else '10000000+'end as address_type,sum(cumulative_sum) as cumulative_balancefrom(SELECTto AS address,-- DATE_TRUNC('day', evt_block_time) AS day,-- SUM(value / 1e18) OVER (ORDER BY DATE_TRUNC('day', evt_block_time)) AS cumulative_sumSUM(value / 1e18) AS cumulative_sumFROM erc20_ethereum.evt_TransferWHEREcontract_address = 0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6fand "from" not in (0x28901cf869d94c9d892fbd86c8e57b801e8fdd87)and to not in (0x28901cf869d94c9d892fbd86c8e57b801e8fdd87)and DATE_TRUNC('day', evt_block_time) > date '2023-03-01'-- GROUP BY to , DATE_TRUNC('day', evt_block_time)group by 1union allSELECT"from" AS address,-- DATE_TRUNC('day', evt_block_time) AS day,-- -1 * SUM(value / 1e18) OVER (ORDER BY DATE_TRUNC('day', evt_block_time)) AS cumulative_sum-1 * SUM(value / 1e18) AS cumulative_sumFROM erc20_ethereum.evt_TransferWHEREcontract_address = 0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6fand "from" not in (0x28901cf869d94c9d892fbd86c8e57b801e8fdd87)and to not in (0x28901cf869d94c9d892fbd86c8e57b801e8fdd87)and DATE_TRUNC('day', evt_block_time) > date '2023-03-01'group by 1)group by 1)select-- a.day as day,