Eman-RazCorrelation Between TVL & Native Coin By Chain
    Updated 2024-09-12
    with kujira as (with tab1 as (select date, tvl_usd
    from external.defillama.fact_chain_tvl
    where chain='Kujira'),

    tab2 as (select hour::date as date, avg(price) as price
    from crosschain.price.ez_prices_hourly
    where token_address='0x96543ef8d2c75c26387c1a319ae69c0bee6f3fe7'
    group by 1)


    select 'Kujira' as "Chain", corr(tvl_usd,price) as cc
    from tab1 left join tab2 on tab1.date=tab2.date
    group by 1),

    -----------------------------------------------------------

    arbitrum as (with tab1 as (select date, tvl_usd
    from external.defillama.fact_chain_tvl
    where chain='Arbitrum'),

    tab2 as (select hour::date as date, avg(price) as price
    from arbitrum.price.ez_prices_hourly
    where token_address='0x912ce59144191c1204e64559fe8253a0e49e6548'
    group by 1)


    select 'Arbitrum' as "Chain", corr(tvl_usd,price) as cc
    from tab1 left join tab2 on tab1.date=tab2.date
    group by 1),

    -----------------------------------------------------------

    avalanche as (with tab1 as (select date, tvl_usd
    from external.defillama.fact_chain_tvl
    where chain='Avalanche'),

    Auto-refreshes every 24 hours
    QueryRunArchived: QueryRun has been archived