with avax_price as ( select hour::date as date,
avg(price) as avg_price
from avalanche.core.fact_hourly_token_prices
where hour::date >= '2022-01-01'
group by 1)
select chain, tvl_usd
from external.defillama.fact_chain_tvl
where chain in ('Avalanche','Polygon','Optimism','Arbitrum','Fantom','BSC')
and date = current_date - 1