Soheil_MKETH volatility vs Rune volatility per day
Updated 2022-06-30Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with eth_price as (
select
date_trunc('day', hour) as date,
avg(price) as eth_price,
lag(eth_price) ignore nulls over(order by date asc) as lag_eth_price,
((eth_price-lag_eth_price)/ lag_eth_price)*100 as ETH_volatility
from ethereum.token_prices_hourly
where symbol = 'WETH'
and date >='2022-01-01'
group by date
order by date
),
rune_price as (
select
date_trunc('day', BLOCK_TIMESTAMP) as date,
avg(RUNE_USD) as rune_price,
lag(rune_price) ignore nulls over(order by date asc) as lag_rune_price,
((rune_price-lag_rune_price)/ lag_rune_price)*100 as rune_volatility
from flipside_prod_db.thorchain.prices
where date >='2022-01-01'
group by 1
order by 1
),
main1 as (
select
eth.date,
eth.ETH_volatility,
rune.rune_volatility
from eth_price eth
join rune_price rune
on eth.date=rune.date
)
Run a query to Download Data