nsa2000The difference percentage in price of ETH with derivative tokens thereof
Updated 2022-09-13
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
›
⌄
with tab1 AS
(select
hour::date as date1 ,
avg(price) as "USD price ETH"
from ethereum.token_prices_hourly
where token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
group by 1),
tab2 AS
(select
hour::date as date ,
CASE
WHEN token_address = '0xe95a203b1a91a908f9b9ce46459d101078c2c3cb' THEN 'aETH'
WHEN token_address = '0xae78736cd615f374d3085123a210448e74fc6393' THEN 'rETH'
WHEN token_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' THEN 'stETH'
END as "token name",
avg(price) as "USD price tokens"
from ethereum.token_prices_hourly
where token_address in ('0xe95a203b1a91a908f9b9ce46459d101078c2c3cb','0xae78736cd615f374d3085123a210448e74fc6393',
'0xae7ab96520de3a18e5e111b5eaab095312d7fe84' )
and hour >= CURRENT_DATE - 600
group by 1, 2
)
SELECT
date ,
"token name",
"USD price tokens" - "USD price ETH" as "diff price with wETH",
("diff price with wETH"/ "USD price ETH")*100 as "diff price percentage"
from tab1 a
join tab2 b on a.date1=b.date
Run a query to Download Data