namanasyncTotal new Users copy
Updated 2024-08-30
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
›
⌄
-- forked from hess / Total new Users @ https://flipsidecrypto.xyz/hess/q/u1cqBoG6BJOY/total-new-users
with new_dai as ( select min(block_timestamp) as min , from_address
from ethereum.core.fact_transactions
where tx_hash in (select tx_hash from ethereum.core.ez_token_transfers
where symbol = 'DAI')
group by 2)
,
new_usdc as ( select min(block_timestamp) as min , from_address
from ethereum.core.fact_transactions
where tx_hash in (select tx_hash from ethereum.core.ez_token_transfers
where symbol = 'USDC')
group by 2)
,
new_usdt as ( select min(block_timestamp) as min , from_address
from ethereum.core.fact_transactions
where tx_hash in (select tx_hash from ethereum.core.ez_token_transfers
where symbol = 'USDT')
group by 2)
,
final as ( select 'New DAI Users' as type, trunc(min,'month') as monthly , count(DISTINCT(from_address)) as total_user, sum(total_user) over (order by monthly asc) as cumulative_new
from new_dai
where monthly >= '2022-01-01'
group by 1,2
UNION
select 'New USDC Users' as type, trunc(min,'month') as monthly , count(DISTINCT(from_address)) as total_user, sum(total_user) over (order by monthly asc) as cumulative_new
from new_usdc
where monthly >= '2022-01-01'
group by 1,2
UNION
select 'New USDT Users' as type, trunc(min,'month') as monthly , count(DISTINCT(from_address)) as total_user, sum(total_user) over (order by monthly asc) as cumulative_new
from new_usdt
where monthly >= '2022-01-01'
group by 1,2)
select type, avg(total_user) as avg_user, sum(total_user) as total_users
QueryRunArchived: QueryRun has been archived