Query editor
withdex_daily_prices as (selectDATE_TRUNC('day', hour) as day,'PRICES' as source,avg(median_price) as pricefromdex.priceswherecontract_address = 0x3b21418081528845a6DF4e970bD2185545b712ba-- Price before this date was a total messand DATE_TRUNC('day', hour) >= date '2024-03-27'group by1),dex_daily_prices_latest as (selectDATE_TRUNC('day', block_time) as day,'PRICES_LATEST' as source,avg(token_price_usd) as pricefromdex.prices_latestwheretoken_address = 0x3b21418081528845a6DF4e970bD2185545b712bagroup by1),daily_prices as (selectday,avg(price) as pricefrom(select*fromdex_daily_pricesunion allselect*fromdex_daily_prices_latest)group by1),chi_mints_and_burns as (selectevt_block_time,casewhen "from" = 0x0000000000000000000000000000000000000000 then value / 1e18else - value / 1e18end as valuefromerc20_ethereum.evt_transferwherecontract_address = 0x3b21418081528845a6DF4e970bD2185545b712baand ("from" = 0x0000000000000000000000000000000000000000or "to" = 0x0000000000000000000000000000000000000000