Eman-Raz% of price changes in Different Time Frame
Updated 2024-01-16
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 daily_ as (with tab1 as (select PRICE as current_price
from ethereum.price.ez_hourly_token_prices
where token_address='0x25931894a86d47441213199621f1f2994e1c39aa'
order by HOUR desc
limit 1),
tab2 as (select hour::date as date, avg(PRICE) as price
from ethereum.price.ez_hourly_token_prices
where token_address='0x25931894a86d47441213199621f1f2994e1c39aa' and hour::date=current_date-1
group by 1
order by 1)
select ((current_price-Price)/Price)*100 as price_change, 'Daily' as "Time Frame"
from tab1 , tab2),
-----------------------------------------------------------------------------------------------------------
weekly_ as (with tab1 as (select PRICE as current_price
from ethereum.price.ez_hourly_token_prices
where token_address='0x25931894a86d47441213199621f1f2994e1c39aa'
order by HOUR desc
limit 1),
tab2 as (select hour::date as date, avg(PRICE) as price
from ethereum.price.ez_hourly_token_prices
where token_address='0x25931894a86d47441213199621f1f2994e1c39aa' and hour::date=current_date-7
group by 1
order by 1)
select ((current_price-Price)/Price)*100 as price_change, 'Weekly' as "Time Frame"
from tab1 , tab2),
------------------------------------------------------------------------------------------------------------
monthly_ as (with tab1 as (select PRICE as current_price
from ethereum.price.ez_hourly_token_prices
where token_address='0x25931894a86d47441213199621f1f2994e1c39aa'
order by HOUR desc
limit 1),
QueryRunArchived: QueryRun has been archived