Query editor
withscope as (withdeltas as (selectdate_trunc('week', evt_block_time) as period,case when "from" = 0x0000000000000000000000000000000000000000 then cast(value as int256) else -cast(value as int256) end as delta_bnfrom erc20_ethereum.evt_Transferwhereevt_block_number >= 14576146and contract_address = 0x4704aB1fb693ce163F7c9D3A31b3FF4eaF797714and ("to" = 0x0000000000000000000000000000000000000000or "from" = 0x0000000000000000000000000000000000000000)),lowest_date as (select cast(date_trunc('week', min(period)) as timestamp) as period from deltas),_periods_seq as (select sequence((select period from lowest_date), date_trunc('week', cast(now() as timestamp)), interval '7' day) as period)-- stolen from https://dune.com/queries/1764158,periods_seq as (selectperiods.period as periodfrom _periods_seqcross join unnest(period) as periods(period))selectperiod, cast(sum(sum(delta_bn)) over (order by period) as double) / pow(10, 18) as total_supply_dec, cast(sum(delta_bn) as double) / pow(10, 18) as delta_decfrom (select * from deltas b union all select *, null from periods_seq) q group by period)select * from scope