Eman-RazStatistical Data
    Updated 2023-11-07
    with final_tab as (with tab1 as (SELECT hour::date as date, price as open_price
    from avalanche.core.fact_hourly_token_prices
    where token_address='0x6e84a6216ea6dacc71ee8e6b0a5b7322eebc0fdd'
    and HOUR ilike '%00:00:00.000'
    ORDER BY 1),

    tab2 as (SELECT hour::date as date, price as close_price
    from avalanche.core.fact_hourly_token_prices
    where token_address='0x6e84a6216ea6dacc71ee8e6b0a5b7322eebc0fdd'
    and HOUR ilike '%23:00:00.000'
    ORDER BY 1)

    select tab1.date as "Date", ((close_price-open_price)/open_price)*100 as "%Price Change"
    from tab1 left join tab2 on tab1.date=tab2.date
    order by 1)

    select max("%Price Change") as max, avg("%Price Change") as avg, median("%Price Change") as median
    from final_tab
    Run a query to Download Data