chrisfdpast_24h_median price
Updated 2023-10-19
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
›
⌄
-- median token price over the past 24 hours for our dex_list
WITH dex_list(dex, symbol, token_address) as (
select * from (
values
('uniswap', 'UNI', lower('0x1f9840a85d5af5bf1d1762f925bdaddc4201f984') ),
('pancakeswap', 'CAKE', lower('0x152649eA73beAb28c5b49B26eb48f7EAD6d4c898') ),
('dodo', 'DODO', lower('0x43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd')),
('curve', 'CRV', lower('0xD533a949740bb3306d119CC777fa900bA034cd52')),
('balancer', 'BAL', lower('0xba100000625a3754423978a60c9317c58a424e3D')),
('maverick', 'MAV', lower('0x7448c7456a97769F6cD04F1E83A4a23cCdC46aBD')),
('sushiswap', 'SUSHI', lower('0x6b3595068778dd592e39a122f4f5a5cf09c90fe2'))
))
SELECT
symbol,
token_address,
MEDIAN(price)
from ethereum.price.ez_hourly_token_prices
where hour > dateadd('hour', -24, current_timestamp(9)::timestamp_ntz)
and exists (select 3 from dex_list where dex_list.token_address = ethereum.price.ez_hourly_token_prices.token_address)
group by 1,2
order by 3 DESC
limit 7
Run a query to Download Data