Updated 2025-01-09
    with tab1 as (
    SELECT
    date(block_timestamp) as date,
    count(DISTINCT TRIM(SPLIT_PART(SPLIT_PART(fee_msg['transition']['outputs'][0]['value'], '[', 2), ',', 1))) as active_wallets
    from aleo.core.fact_transactions
    where tx_succeeded
    GROUP BY 1
    ), tab2 as (
    SELECT
    day,
    count(*) as new_wallets,
    sum(new_wallets) over (ORDER by day) as total_wallets
    from (
    SELECT
    TRIM(SPLIT_PART(SPLIT_PART(fee_msg['transition']['outputs'][0]['value'], '[', 2), ',', 1)) as wallet,
    min(date(block_timestamp)) as day
    from aleo.core.fact_transactions
    where tx_succeeded
    GROUP BY 1
    )
    group by 1
    )

    SELECT
    *,
    active_wallets - new_wallets as returning_wallets

    from tab1
    left outer join tab2
    on day = date

    Last run: 3 months ago
    DATE
    ACTIVE_WALLETS
    DAY
    NEW_WALLETS
    TOTAL_WALLETS
    RETURNING_WALLETS
    1
    2025-01-08 00:00:00.000176092025-01-08 00:00:00.000910912581978500
    2
    2024-10-14 00:00:00.00064282024-10-14 00:00:00.0001448390294980
    3
    2024-10-23 00:00:00.000368042024-10-23 00:00:00.0002089817170915906
    4
    2024-12-07 00:00:00.000223762024-12-07 00:00:00.000146997050127677
    5
    2024-12-23 00:00:00.000297252024-12-23 00:00:00.0002069010052699035
    6
    2024-12-15 00:00:00.000298632024-12-15 00:00:00.000210008359948863
    7
    2025-01-09 00:00:00.000169922025-01-09 00:00:00.000832112665188671
    8
    2024-09-16 00:00:00.0008672024-09-16 00:00:00.0003221861545
    9
    2024-10-30 00:00:00.000154692024-10-30 00:00:00.00078572516847612
    10
    2024-12-26 00:00:00.000434642024-12-26 00:00:00.00029267107947414197
    11
    2024-10-09 00:00:00.00061002024-10-09 00:00:00.0002020218044080
    12
    2024-09-14 00:00:00.0005992024-09-14 00:00:00.0002321382367
    13
    2024-09-19 00:00:00.00013602024-09-19 00:00:00.0007223965638
    14
    2024-12-24 00:00:00.000316382024-12-24 00:00:00.0002208110273509557
    15
    2024-10-26 00:00:00.000210962024-10-26 00:00:00.0001057421076410522
    16
    2024-12-29 00:00:00.000216112024-12-29 00:00:00.0001177911357989832
    17
    2024-11-03 00:00:00.000135522024-11-03 00:00:00.00072292845776323
    18
    2024-09-27 00:00:00.00028062024-09-27 00:00:00.000540103682266
    19
    2024-10-12 00:00:00.00050212024-10-12 00:00:00.000654370404367
    20
    2024-10-02 00:00:00.00039552024-10-02 00:00:00.000851144433104
    ...
    128
    10KB
    18s