misaghlbETH Down Bad - swap
Updated 2022-11-23
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
›
⌄
with swap_data as (
select
'Buy' as type,
block_timestamp,
tx_hash,
SENDER as trader,
AMOUNT_OUT_USD as usd_vol
from ethereum.core.ez_dex_swaps
where SYMBOL_OUT = 'WETH'
and date(block_timestamp) >= '2022-11-01'
UNION ALL
select
'Sell' as type,
block_timestamp,
tx_hash,
SENDER as trader,
AMOUNT_IN_USD as usd_vol
from ethereum.core.ez_dex_swaps
where SYMBOL_IN = 'WETH'
and date(block_timestamp) >= '2022-11-01'
)
SELECT date(block_timestamp) as date, type,
count(distinct tx_hash) as swaps,
count(distinct trader) as wallets,
sum(usd_vol) as usd_vol,
avg(usd_vol) as avg_usd_vol
from swap_data
group by date, type
Run a query to Download Data