Soheil_MKUntitled Query
Updated 2022-11-23
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 BTC_price as (
select
date_trunc('day', hour) as date,
avg(price) as BTC_price,
lag(BTC_price) ignore nulls over(order by date asc) as lag_BTC_price,
((BTC_price-lag_BTC_price)/ lag_BTC_price)*100 as BTC_volatility
from ethereum.token_prices_hourly
where symbol = 'WBTC'
and date >='2022-11-01'
group by date
order by date
),
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-11-01'
group by date
order by date
),
main1 as (
select
btc.date,
btc.BTC_price,
eth.eth_price,
BTC_volatility,
ETH_volatility
from BTC_price btc
join eth_price eth
on btc.date=eth.date
Run a query to Download Data