subiniumpolygon new user
Updated 2024-05-24
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
›
⌄
with first_time as (
SELECT
FROM_ADDRESS,
MIN(block_timestamp) as first_time
FROM optimism.core.fact_transactions
GROUP BY 1
),
new_user as (
SELECT
date_trunc('month', first_time) as month,
COUNT(FROM_ADDRESS) as new
FROM first_time
GROUP BY 1
),
total_user as (
SELECT
date_trunc('month', block_timestamp) as month,
COUNT(distinct FROM_ADDRESS) as mau
FROM optimism.core.fact_transactions
GROUP BY 1)
SELECT
month,
mau,
new,
sum(new) over(order by month asc) as total_address,
mau-new as old
FROM total_user t
LEFT JOIN new_user n using(month)
QueryRunArchived: QueryRun has been archived