Moezzx0
    Updated 2023-03-01
    select
    date(BLOCK_DATE) AS date ,
    avg( PRICE_USD) mars_price,
    avg(mars_price)over(order by date rows between 100 preceding and current row) as "Mov avg 100",
    avg(mars_price)over(order by date rows between 7 preceding and current row) as "Mov avg 7"
    from
    osmosis.mars.ez_token_day
    where SYMBOL ilike 'Mars'
    and date between CURRENT_DATE-180 and CURRENT_DATE-1
    group by 1