Query editor
with days as (with time_seq as (SELECTsequence(cast('2025-01-22' as timestamp), date_trunc('day', cast(now() as timestamp)), interval '1' day) as time)SELECTtimes.timeFROM time_seqLEFT JOIN unnest(time) as times(time) on true--where times.time > DATE_TRUNC('day', NOW()) - INTERVAL '3' day),pengu_in as (selectdate_trunc('day',evt_block_time) as day,sum(value)/1e18 as pengu_infrom erc20_abstract.evt_transferwhere contract_address = 0x9ebe3a824ca958e4b3da772d2065518f009cba62and "from" = 0x0000000000000000000000000000000000000000group by 1),pengu_out as (select date_trunc('day',evt_block_time) as day,sum(value)/1e18 as pengu_outfrom erc20_abstract.evt_transferwhere contract_address = 0x9ebe3a824ca958e4b3da772d2065518f009cba62and "to" = 0x0000000000000000000000000000000000000000group by 1),final as (selectd.time,coalesce(i.pengu_in,0) - coalesce(o.pengu_out,0) as pengu_bridgefrom days dleft join pengu_in ion d.time = i.dayleft join pengu_out oon d.time = o.day)selecttime as day,pengu_bridge,sum(pengu_bridge) over (order by time) as cumulativefrom finalorder by 1 desc