cypherUntitled Query
Updated 2022-11-26
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
›
⌄
-- select
-- date_trunc('hour', block_timestamp) as HOUR,
-- avg(amount_in_usd/amount_in) as price_USD
-- from avalanche.sushi.ez_swaps
-- where TOKEN_IN = '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7' AND hour>= CURRENT_DATE - 30
-- group by 1
select
date_trunc('hour', block_timestamp) as HOUR,
avg(iff(symbol_in = 'WAVAX', amount_in_usd/amount_in, amount_out_usd/amount_out)) as avax_price
from avalanche.sushi.ez_swaps
where (token_in = '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7' or token_out = '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7')
AND hour>= CURRENT_DATE - 30
group by 1
Run a query to Download Data