Query editor
with tokens as (select usd_latest.*, price_normfrom prices.usd_latestleft join (select symbol, avg(price) as price_normfrom prices.usdwhere date_trunc('year', minute) = date_trunc('year', current_date)group by 1) usd_ref on usd_ref.symbol = usd_latest.symbolwhere trueand blockchain = 'ethereum'and usd_latest.symbol != 'SOV'union allselect'ethereum' as blockchain,0x0000000000000000000000000000000000000000 as contract_address,18 as decimals,usd_latest.symbol,minute,price,price_normfrom prices.usd_latestleft join (select symbol, avg(price) as price_normfrom prices.usdwhere trueand date_trunc('day', minute) = date_trunc('year', current_date) -- all entries for 1st day of yearand blockchain is NULLand symbol = 'ETH'group by 1) usd_ref on usd_ref.symbol = usd_latest.symbolwhere trueand blockchain is NULLand usd_latest.symbol = 'ETH'union allselect usd_latest.*, price_normfrom prices.usd_latestleft join (select symbol, avg(price) as price_normfrom prices.usdwhere date_trunc('year', minute) = date_trunc('year', current_date)group by 1) usd_ref on usd_ref.symbol = usd_latest.symbolwhere trueand blockchain = 'polygon'and usd_latest.symbol != 'SOV'union allselect'polygon' as blockchain,0x0000000000000000000000000000000000000000 as contract_address,18 as decimals,usd_latest.symbol,minute,price,