Afonso_DiazRetention Rate
Updated 2025-05-13
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
›
⌄
with
main as (
select
tx_hash,
block_timestamp,
sender as user,
(gas_unit_price * (gas_used / 1e8)) as tx_fee
from
aptos.core.fact_transactions
where
success
),
monthly_users as (
select
date_trunc('month', block_timestamp) as month,
user,
min(block_timestamp) over (partition by user) as first_seen
from main
),
monthly_metrics as (
select
month,
count(distinct user) as active_users,
count(distinct case when date_trunc('month', first_seen) = month then user end) as new_users,
count(distinct case when date_trunc('month', first_seen) < month then user end) as returning_users
from monthly_users
group by month
),
retention as (
select
w1.month as current_month,
w2.month as previous_month,
QueryRunArchived: QueryRun has been archived