MLDZMNsb1
Updated 2023-06-07
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
-- forked from pepe1 @ https://flipsidecrypto.xyz/edit/queries/685ae3df-8f1f-481f-a12c-45d30ae1ef92
-- forked from EDB1 @ https://flipsidecrypto.xyz/edit/queries/431b94f7-1522-40ba-b666-545624e1e884
select
HOUR::date as day,
avg(price) as token_price,
lag(token_price) ignore nulls over(ORDER BY day ASC) as lag_price,
((token_price-lag_price)/token_price)*100 as deviation_price,
avg(token_price) OVER (ORDER BY day ROWS BETWEEN 7 PRECEDING AND CURRENT ROW) as MA_7_Days_volume,
avg(token_price) OVER (ORDER BY day ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) as MA_15_Days_volume
from ethereum.core.fact_hourly_token_prices
where hour BETWEEN '2021-10-01' and '2022-01-01'
and TOKEN_ADDRESS = lower('0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE')
group by 1
Run a query to Download Data