select date_trunc('week',block_timestamp) as TIME,
avg(price_usd) as avg_price, min(price_usd) as min_price, max(price_usd) as max_price
from terra.oracle_prices where symbol = 'LUNA'
and block_timestamp BETWEEN '2022-01-01' and '2022-05-30' group by 1