sunshine-juliaUNISWAP ORIGINATION - TOP POOLS BY USERS (FRONTEND)
Updated 2023-08-03
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
›
⌄
with tab1 as (select POOL_NAME, SENDER, TX_HASH, PLATFORM, ORIGIN_FROM_ADDRESS
from ethereum.core.ez_dex_swaps
where block_timestamp::date <= current_date - 1
and SENDER = ORIGIN_FROM_ADDRESS and platform ilike 'uniswap%'
),
tab2 as (select POOL_NAME, SENDER, TX_HASH, PLATFORM, ORIGIN_FROM_ADDRESS
FROM ethereum.core.ez_dex_swaps
where block_timestamp::date <= current_date - 1
and SENDER != ORIGIN_FROM_ADDRESS and platform ilike 'uniswap%'
and SENDER in (select ADDRESS from ethereum.core.dim_labels where label ilike 'uniswap%')),
tab3 as
(select * from tab1
union all
select * from tab2),
tab4 as (select POOL_NAME, count (distinct tx_hash) as count_transactions,
count (distinct origin_from_address) as count_users, count_transactions/count_users as avg_txn_per_user
from tab3 group by 1 order by 3 desc limit 10),
tab5 as (select POOL_NAME, SENDER, TX_HASH, PLATFORM, ORIGIN_FROM_ADDRESS, label
from ethereum.core.ez_dex_swaps left join ethereum.core.dim_labels
on SENDER = address
where platform ilike 'uniswap%' and block_timestamp::date <= current_date - 1
and SENDER in (select ADDRESS from ethereum.core.dim_labels where label not like 'uniswap%')),
tab6 as (select POOL_NAME, count (distinct tx_hash) as count_transactions,
count (distinct origin_from_address) as count_users, count_transactions/count_users as avg_txn_per_user
from tab5 group by 1 order by 3 desc limit 10)
select *, 'FRONTEND' as type from tab4
Run a query to Download Data