elsinaDaily new users vs old users
Updated 2024-10-14
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 users as (
SELECT
swapper,
min(block_timestamp) as min_date
from
aptos.defi.ez_dex_swaps
group by
swapper
),
new_users as (
select
date_trunc('day', min_date) as date,
count(distinct swapper) as new_user_count
from
users
where
date >= current_date - interval '30 days'
group by
date
),
old_users as (
select
date_trunc('day', block_timestamp) as date,
count(distinct
case
when swapper in (select swapper from users where date_trunc('day', min_date) = date_trunc('day', block_timestamp))
then null
else swapper
end
) as old_user_count,
count(distinct swapper) as total_user_count
from
aptos.defi.ez_dex_swaps
QueryRunArchived: QueryRun has been archived