Elprognerd2- New users eth
Updated 2023-05-16Copy Reference Fork
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
›
⌄
WITH min_swaps AS (
SELECT
MIN(a.block_timestamp) AS min_date,
a.origin_from_address AS user_address
FROM
ethereum.core.ez_dex_swaps a
JOIN
ethereum.core.fact_transactions b ON a.tx_hash = b.tx_hash
WHERE
a.platform LIKE 'uniswap%'
AND a.amount_in_usd IS NOT NULL
AND a.amount_in_usd > 0
GROUP BY
2
),
new_user_counts AS (
SELECT
DATE_TRUNC('month', a.min_date) AS month,
COUNT(DISTINCT a.user_address) AS user_count
FROM
min_swaps a
WHERE month > current_date - interval '12 months'
GROUP BY
1
)
SELECT
month,
user_count AS "New Users",
SUM(user_count) OVER (ORDER BY month ASC) AS "Total New Users"
FROM
new_user_counts
ORDER BY 1 ASC
Run a query to Download Data