Query editor
with raw as(selectevt_block_time as period,contract_address,CAST(value as double) as amountfrom erc20_ethereum.evt_Transferwhere to = 0x64192819ac13ef72bf6b5ae239ac672b43a9af08and contract_address in (0xBB0E17EF65F82Ab018d8EDd776e8DD940327B28b, 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)UNION ALLselectevt_block_time as period,contract_address,-CAST(value as double) as amountfrom erc20_ethereum.evt_Transferwhere "from" = 0x64192819ac13ef72bf6b5ae239ac672b43a9af08and contract_address in (0xBB0E17EF65F82Ab018d8EDd776e8DD940327B28b, 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)),amountpp as (selectdate_trunc('day', period) as period,-- contract_address,sum(CASEwhen contract_address=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 then amount/1e6else 0 end) as usdc_amount,sum(CASEwhen contract_address=0xBB0E17EF65F82Ab018d8EDd776e8DD940327B28b then amount/1e18else 0 end) as axie_amountfrom rawgroup by 1)select *,sum(usdc_amount) over(order by period asc) cum_usdc,sum(axie_amount) over(order by period asc) cum_axiefrom amountpporder by period desc