Query editor
withsupported_assets as (select * from ( values(0xd6203889C22D9fe5e938a9200f50FDFFE9dD8e02, 'SBR')) as assets(token, symbol)),oracle_raw as (-- prices.usdselectminute as date,contract_address,price,decimalsfrom prices.usdwhere minute > date'2024-11-01'-- and minute = date_trunc('day', minute)and blockchain = 'ethereum'and contract_address in (select token from supported_assets)-- dex.tradesunion allselectblock_date as date,token_bought_address as contract_address,amount_usd/(token_bought_amount_raw/1e9) as price,9 as decimalsfrom dex.tradeswhere block_date > date'2024-03-01'and token_bought_address in (select token from supported_assets) and amount_usd is not nullunion allselectblock_date as date,token_sold_address as contract_address,amount_usd/(token_sold_amount_raw/1e9) as price,9 as decimalsfrom dex.tradeswhere block_date > date'2024-11-01'and token_sold_address in (select token from supported_assets) and amount_usd is not null)selectdate_trunc('day',date) as date,contract_address,decimals,avg(price) as pricefrom oracle_rawwhere not(is_nan(price))and is_finite(price)group by 1,2,3