Query editor
with transfers as (selectevt_block_time,casewhen contract_address = 0x7b8e89b0ce7bac2cfec92a371da899ea8cbdb450 and "to" = 0x0000000000000000000000000000000000000000 then -cast(value as double)when contract_address = 0x7b8e89b0ce7bac2cfec92a371da899ea8cbdb450 and "from" = 0x0000000000000000000000000000000000000000 then cast(value as double)end as sanDAIfrom erc20_ethereum.evt_Transferwhere ("to" = 0x0000000000000000000000000000000000000000 or "from" = 0x0000000000000000000000000000000000000000)and contract_address = 0x7b8e89b0ce7bac2cfec92a371da899ea8cbdb450),grouped_transfers as (selectdate_trunc('week', evt_block_time) as week,sum(sanDAI) as sanDAIfrom transfersgroup by 1),amount_table as (selectweek,sum(sanDAI) over (order by week) / 1e18 as sanDAIfrom grouped_transfers)select * from amount_tableorder by 1 desc