-- Method Credit: https://app.flipsidecrypto.com/velocity/queries/ddf191e3-ba0c-4b6c-9e1f-18677a7dc9e0 || JackTheGuy
with previous_table as (
select symbol as Symbol1,
avg (price) as Previous_Price
from ethereum.core.fact_hourly_token_prices
where symbol in ('WETH','UNI','AAVE','WBTC','MATIC','LINK')
and hour::date = '2022-11-01'
group by 1
union ALL
select symbol as Symbol1,
avg (close) as Previous_Price
from solana.core.fact_token_prices_hourly
where symbol in ('SOL')
and recorded_hour = '2022-11-01'
group by 1
union ALL
select symbol as Symbol1,
avg (price) as Previous_Price
from osmosis.core.dim_prices
where symbol in ('ATOM')
and recorded_at = '2022-11-01'
group by 1
union ALL
select symbol as symbol1,
avg (price_usd) as Previous_Price
from flow.core.fact_prices
where symbol in ('FLOW')
and timestamp = '2022-11-01'
group by 1)