hessAverage Swap Volume
Updated 2023-01-20
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
›
⌄
with eth as ( select 'ETH' as token , date(HOUR) as date, avg(price) as eth_price
from ethereum.core.fact_hourly_token_prices
where date >= '2023-01-01'
and symbol = 'WETH'
group by 1,2)
,
swap as ( select 'To ETH' as type, date(block_timestamp) as date, count(DISTINCT(origin_from_address))as toatl_user,
count(DISTINCT(tx_hash)) as total_swap, sum(amount_in_Usd) as volume, avg(amount_in_usd) as avg_volume
from ethereum.core.ez_dex_swaps
where date >= '2023-01-01'
and SYMBOL_OUT = 'WETH'
and amount_in_usd < 60000000
group by 1,2
UNION
select 'From ETH' as type, date(block_timestamp) as date, count(DISTINCT(origin_from_address)) as toatl_user,
count(DISTINCT(tx_hash)) as total_swap, sum(amount_in_Usd) as volume, avg(amount_in_usd) as avg_volume
from ethereum.core.ez_dex_swaps
where date >= '2023-01-01'
and SYMBOL_IN = 'WETH'
and amount_in_usd < 60000000
group by 1,2)
select type, avg(toatl_user) as avg_user, avg(total_swap) as avg_swap, avg(volume) as avg_volume
from swap
where date <= '2023-01-16'
group by 1
Run a query to Download Data