select date(timestamp) as date,
'Near' as token,
avg(price_usd) as avg_price
from near.core.fact_prices
where timestamp::date >= '2022-01-01'
and symbol ilike '%wNear%'
group by 1,2
UNION
select hour::date as date,
'BNB' as symbol,
avg(price) as avg_price
from ethereum.core.fact_hourly_token_prices
where symbol = 'WBNB'
and hour::date >= '2022-01-01'
group by 1,2