MONTH | TOTAL_USERS | RETAINED_USERS | RETENTION_RATE | |
---|---|---|---|---|
1 | 2024-02-01 00:00:00.000 | 1565952 | 0 | |
2 | 2024-03-01 00:00:00.000 | 2507347 | 505215 | 32.262483 |
3 | 2024-04-01 00:00:00.000 | 1882774 | 518277 | 20.670334 |
4 | 2024-05-01 00:00:00.000 | 1607322 | 309069 | 16.415619 |
5 | 2024-06-01 00:00:00.000 | 3922504 | 434428 | 27.028063 |
6 | 2024-07-01 00:00:00.000 | 2703760 | 601204 | 15.327046 |
7 | 2024-08-01 00:00:00.000 | 3043929 | 720545 | 26.64974 |
8 | 2024-09-01 00:00:00.000 | 4031995 | 943048 | 30.981275 |
9 | 2024-10-01 00:00:00.000 | 8117692 | 1364482 | 33.841361 |
10 | 2024-11-01 00:00:00.000 | 8263438 | 2922531 | 36.001994 |
11 | 2024-12-01 00:00:00.000 | 10353849 | 3389579 | 41.018992 |
12 | 2025-01-01 00:00:00.000 | 16039066 | 4237775 | 40.929465 |
13 | 2025-02-01 00:00:00.000 | 15144585 | 3863457 | 24.087793 |
14 | 2025-03-01 00:00:00.000 | 13220313 | 4270266 | 28.196652 |
Haisenbergretention-rate
Updated 2025-03-29
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
›
⌄
-- Step 1: Create CTEs to identify active users for each month
WITH monthly_active_users AS (
SELECT DISTINCT
date_trunc('month', block_timestamp) AS month,
sender AS address
FROM
aptos.core.fact_transactions
WHERE
block_timestamp >= DATE_TRUNC('month', CURRENT_DATE) - INTERVAL '13 months'
),
-- Step 2: Calculate retained users
retained_users AS (
SELECT
current_month.month,
COUNT(DISTINCT current_month.address) AS total_users,
COUNT(DISTINCT previous_month.address) AS retained_users
FROM
monthly_active_users current_month
LEFT JOIN
monthly_active_users previous_month
ON current_month.address = previous_month.address
AND current_month.month = previous_month.month + INTERVAL '1 month'
GROUP BY
current_month.month
)
-- Step 3: Calculate retention rate
SELECT
month,
total_users,
retained_users,
CASE
WHEN LAG(total_users) OVER (ORDER BY month) IS NULL THEN NULL
ELSE (retained_users * 100.0 / LAG(total_users) OVER (ORDER BY month))
Last run: about 2 months ago
14
742B
193s