misaghlbAcross Protocol Airdrop
Updated 2022-12-05
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 swap_data as (
select 'Buy' as type,
block_timestamp,
TX_HASH,
ORIGIN_FROM_ADDRESS as trader,
AMOUNT_IN as vol,
AMOUNT_IN_USD as usd_vol
from ethereum.core.ez_dex_swaps
where TOKEN_OUT = '0x44108f0223a3c3028f5fe7aec7f9bb2e66bef82f'
UNION ALL
select 'Sell' as type,
block_timestamp,
TX_HASH,
ORIGIN_FROM_ADDRESS as trader,
AMOUNT_OUT as vol,
AMOUNT_OUT_USD as usd_vol
from ethereum.core.ez_dex_swaps
where TOKEN_IN = '0x44108f0223a3c3028f5fe7aec7f9bb2e66bef82f'
)
select
date_trunc('hour', block_timestamp) as date,
type,
count(distinct TX_HASH) as swaps,
count(distinct trader) as wallets,
sum(vol) as total_vol,
avg(vol) as avg_vol,
sum(total_vol) over (partition by type order by date) as cumu_usd_vol,
sum(swaps) over (partition by type order by date) as cumu_swaps
from swap_data
group by date, type
Run a query to Download Data