Afonso_Diaz2023-05-20 07:34 PM
Updated 2023-05-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
34
35
36
›
⌄
with t as (
select
tx_hash,
block_timestamp,
'Outflow' as type,
to_address as user,
amount_usd
from ethereum.core.ez_token_transfers
join ethereum.core.dim_labels
on address = from_address
where symbol = 'UNI'
and label_type = 'cex'
union all
select
tx_hash,
block_timestamp,
'Inflow' as type,
to_address as user,
amount_usd
from ethereum.core.ez_token_transfers
join ethereum.core.dim_labels
on address = to_address
where symbol = 'UNI'
and label_type = 'cex'
)
select
count(distinct tx_hash) as transactions,
count(distinct iff(type = 'Inflow', tx_hash, null)) as inflow_transactions,
count(distinct iff(type = 'Outflow', tx_hash, null)) as outflow_transactions,
inflow_transactions - outflow_transactions as netflow_transactions,
count(distinct user) as users,
count(distinct iff(type = 'Inflow', user, null)) as inflow_users,
count(distinct iff(type = 'Outflow', user, null)) as outflow_users,
Run a query to Download Data