WITH TAB1 AS (select date, tvl_usd
from external.defillama.fact_chain_tvl
where chain='Thorchain' and
date>='2023-01-01'),
TAB2 AS (select hour::date as "Date", avg(price) as "Avg Price"
from thorchain.price.ez_prices_hourly
where symbol='RUNE'
and hour::date>='2023-01-01'
group by 1)
select corr(tvl_usd,"Avg Price")
from tab1 left join tab2 on tab1.date=tab2."Date"