Query editor
with time as (select distinct *from unnest(sequence(date('2023-11-19'), date(now()), interval '1' day)) as t(day)),prices as (select * from timecross join (select 'DAI' as symbol union all select 'stETH') as symbol),total as (select date_trunc('day',evt_block_time) as day,'DAI' as symbol,sum(a.daiAmount) / 1e18 as amountfrom blast_ethereum.LaunchBridge_evt_USDDeposited agroup by 1,2union allselectdate_trunc('day',evt_block_time) as day,'stETH' as symbol,sum(a.amount) / 1e18 as amountfromblast_ethereum.LaunchBridge_evt_ETHDeposited agroup by 1,2),cumulative as (select a.day, a.symbol, coalesce(b.amount,0) as valuefrom prices aleft join total b on a.day = b.day and a.symbol = b.symbol),totall as (select date_trunc('day',cast(day as timestamp)) as day,symbol,sum(value) over (PARTITION BY symbol order by day) as cumulative_valuefrom cumulativeorder by 1,2),grouped as (select 'DAI' as symbol, 1 as priceunion allselect 'stETH' as symbol,(select price from prices.usd_latest where symbol = 'stETH' and blockchain = 'ethereum') as price)select a.day, a.symbol, a.cumulative_value * b.price as valuefrom totall ainner join grouped b on a.symbol = b.symbol