tiloyeNumber of users
Updated 2024-09-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
28
29
30
31
32
33
›
⌄
with raw_swaps as (
select
block_timestamp::date as day,
tx_hash,
pool_name,
symbol_in,
symbol_out,
amount_in_usd,
amount_out_usd,
sender,
origin_from_address
from ethereum.defi.ez_dex_swaps
where block_timestamp >= current_date - 90
and contract_address = '{{pool_address}}'
),
swap_tx_count as (
select
origin_from_address,
count(distinct tx_hash) as swap_count
from raw_swaps
group by 1
)
select
case
when swap_count = 1 then 'a. 1'
when swap_count > 1 and swap_count <= 10 then 'b. 2 - 10'
when swap_count > 10 then 'c. >10'
end as swap_count_category,
count(origin_from_address) as number_of_users
from swap_tx_count
group by swap_count_category
QueryRunArchived: QueryRun has been archived