hessTotal per token
Updated 2023-11-16
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 woofi as ( select block_timestamp,
token_in as token_address,
symbol_in as symbol,
tx_hash,
origin_from_address,
pool_name,
case when amount_in_usd is null then amount_out_usd
when amount_out_usd is null then amount_in_usd
when amount_in_usd>=amount_out_usd then amount_in_usd
when amount_out_usd>amount_in_usd then amount_out_usd end as amount_usd
from avalanche.defi.ez_dex_swaps
where platform = 'woofi'
UNION
select block_timestamp,
token_out as token_address,
symbol_out as symbol,
tx_hash,
origin_from_address,
pool_name,
case when amount_in_usd is null then amount_out_usd
when amount_out_usd is null then amount_in_usd
when amount_in_usd>=amount_out_usd then amount_in_usd
when amount_out_usd>amount_in_usd then amount_out_usd end as amount_usd
from avalanche.defi.ez_dex_swaps
where platform = 'woofi'
)
select trunc(block_timestamp,'month') as date,
symbol,
count(DISTINCT(tx_hash)) tx,
count(*) as swaps,
swaps/tx as "Avg Swap per Tx",
count(DISTINCT(origin_from_address)) as users,
sum(amount_usd/2) as usd_volume,
sum(usd_volume) over (order by date asc) as "Cumulative Volume",
avg(amount_usd) as "Avg Volume Per User",
Run a query to Download Data