Query editor
withactions as (select * from query_3985125-- https://dune.com/queries/3985125),oracle as (selectminute as date,contract_address,decimals,pricefrom prices.usdwhere minute >= date'2024-08-11'and minute = date_trunc('day', minute)and blockchain = 'ethereum'and contract_address = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599),daily_agg as (selectdate_trunc('day', evt_block_time) as date,count(case when action='deposit' then evt_tx_hash else null end) as deposit_count,count(case when action='withdraw' then evt_tx_hash else null end) as withdraw_count,sum(case when action='deposit' then amount else null end) as deposit_volume,sum(case when action='withdraw' then amount else null end) as withdraw_volume,sum(amount) as amount_dailyfrom actions agroup by 1),days AS (with days_seq as (SELECTsequence((date('2024-08-13')),date_trunc('day', cast(now() as timestamp)),interval '1' day) as day)SELECTdays.day as dateFROM days_seqCROSS JOIN unnest(day) as days(day) --this is just doing explode like in spark sql),daily_fillers as (select * from days d),wbtc_price as (select minute,price from prices.usdwhere minute >= date'2024-08-11'and minute = date_trunc('day', minute)and blockchain = 'ethereum'and contract_address = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599),balance_data as (selectf.date,-- f.symbol,-- f.asset_type,o.price,-- daily valuesd.deposit_count,