SELECT
recorded_hour::date as day,
avg(close) as price_usd,
avg (price_usd) over (order by day rows between 6 preceding and current row) as moving_avg_price_1_week
from crosschain.core.fact_hourly_prices
where id = 'terra-luna-2'
and recorded_hour >= '2022-12-01'
group by day
order by day