Eman-RazCorrelation Coefficient (TVL & Price)
    Updated 2024-11-22
    with tab1 as (select date, tvl_usd
    from external.defillama.fact_chain_tvl
    where chain='CORE' and date between '{{Start_Date}}' and '{{End_Date}}'),

    tab2 as (select hour::date as date, avg(price) as "Price"
    from crosschain.price.ez_prices_hourly
    where symbol='CORE' and token_address is not null
    and hour::date between '{{Start_Date}}' and '{{End_Date}}'
    group by 1)

    select corr(tvl_usd, "Price") as cc
    from tab1 left join tab2 on tab1.date = tab2.date
    where tab1.date>='2024-05-01'

    QueryRunArchived: QueryRun has been archived