Updated 2022-10-19

    SELECT TIMESTAMP::date as daily , avg(price_usd) as price ,
    case
    when daily >=CURRENT_DATE - 90 then 'Last 90 days'
    else 'Earlier' end as type
    from near.core.fact_prices
    where SYMBOL ilike '%NEAR%'
    group by 1 , 3
    Run a query to Download Data