jackguy100 - 100 - 100
Updated 2023-02-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
›
⌄
SELECT
*,
sum(new_users) over (partition by day_type ORDER BY day) as total_users
FROM (
SELECT
first_day as day,
'first day' as day_type,
count(*) as new_users
FROM (
SELECT
RECEIVER,
min(date_trunc('week', block_timestamp)) as first_day,
min(CASE WHEN PROJECT_NAME LIKE 'MARS' THEN date_trunc('week', block_timestamp) END) as first_matic
FROM osmosis.core.fact_transfers
LEFT outer JOIN osmosis.core.dim_tokens
on currency LIKE address
GROUP BY 1
HAVING NOT FIRST_MATIC is NULL
) GROUP BY 1,2
UNION
SELECT
first_token as day,
'first MARS day' as day_type,
count(*) as new_users
FROM (
SELECT
RECEIVER,
min(date_trunc('week', block_timestamp)) as first_day,
min(CASE WHEN PROJECT_NAME LIKE 'MARS' THEN date_trunc('week', block_timestamp) END) as first_token
FROM osmosis.core.fact_transfers
LEFT outer JOIN osmosis.core.dim_tokens
on currency LIKE address
Run a query to Download Data