adambalaOP
Updated 2022-11-24
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with a as
(SELECT
avg (PRICE) as prices ,date_trunc('DAY',HOUR) as date
FROM optimism.core.fact_hourly_token_prices
WHERE SYMBOL = 'OP'
group by date)
select
avg(prices) over(
order by date
rows between 199 preceding and current row ) moving_avg200,
avg(prices) over(
order by date
rows between 49 preceding and current row ) moving_avg50,
avg(prices) over(
order by date
rows between 19 preceding and current row ) moving_avg20,
prices,
date
from a
Run a query to Download Data