Query editor
select evt_block_date,SUM(total) AS daily_flow,SUM(SUM(total)) OVER (ORDER BY evt_block_date) AS total_flowsfrom(select sum(CAST(value as double)/pow(10,COALESCE(b.decimals, 18))) as total, to as address, evt_block_datefrom erc20_polygon.evt_Transfer aleft join tokens.erc20 b on a.contract_address = b.contract_address and b.blockchain = 'polygon'where a.contract_address = 0xB5C064F955D8e7F38fE0460C556a72987494eE17and a.to = 0x96E363C9411A8e2AeE6711ab74E468f39bBd386Fgroup by 2, 3union allselect -sum(CAST(value as double)/pow(10,COALESCE(b.decimals, 18))) as total, "from" as address, evt_block_datefrom erc20_polygon.evt_Transfer aleft join tokens.erc20 b on a.contract_address = b.contract_address and b.blockchain = 'polygon'where a.contract_address = 0xB5C064F955D8e7F38fE0460C556a72987494eE17and a."from" = 0x96E363C9411A8e2AeE6711ab74E468f39bBd386Fgroup by 2, 3)group by evt_block_dateorder by evt_block_date