CryptoLionprice btc eth 2
Updated 2021-08-11
99
1
2
3
4
5
6
7
8
9
10
11
12
›
⌄
SELECT
date_trunc('week',hour) as week,
symbol,
avg(price) as avg_price,
lag(avg_price) ignore nulls over (partition by symbol order by week) as last_avg,
(avg_price - last_avg)/last_avg*100 as change
FROM ethereum.token_prices_hourly
WHERE hour >= getdate() - interval '10 weeks'
AND (token_address = '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599'
OR token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2')
group by 1,2
ORDER BY 1 DESC