Popex404DAU/WAU/MAU Ethereum DEX Swaps
Updated 2022-12-07
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
›
⌄
-- Using SQL recipe from my alchemist bootcamp
-- Daily/Weekly/Monthly Active Users
SELECT date_trunc('month', day) as date, avg(active_addresses) as users, 'DAU' as type
FROM (
SELECT day, count(distinct addresses) AS active_addresses
FROM (
SELECT date_trunc('day', block_timestamp) as day, sender as addresses
FROM ethereum.core.ez_dex_swaps
where block_timestamp >= '2022-01-03'
)
GROUP BY day
)
GROUP BY date
UNION ALL
SELECT date_trunc('month', day) as date, avg(active_addresses) as users, 'WAU' as type
FROM (
SELECT day, COUNT(DISTINCT addresses) AS active_addresses
FROM (
SELECT date_trunc('week', block_timestamp) as day, sender as addresses
FROM ethereum.core.ez_dex_swaps
where block_timestamp >= '2022-01-03'
)
GROUP BY day
)
GROUP BY date
UNION ALL
SELECT date_trunc('month', day) as date, COUNT(DISTINCT addresses) AS users, 'MAU' as type
FROM (
SELECT date_trunc('day', block_timestamp) as day, sender as addresses
Run a query to Download Data