0xHaM-dNew and Returning Users
    Updated 8 days ago
    with eventTb as (
    SELECT
    block_timestamp,
    FROM_ADDRESS,
    tx_hash
    FROM ink.core.fact_transactions
    )
    ,
    active_users_u as (
    SELECT
    date_trunc('day', block_timestamp) as date,
    count(DISTINCT FROM_ADDRESS) as active_users
    FROM eventTb
    GROUP BY date
    )
    , new as (
    SELECT
    date_trunc('day', first_tx) as date,
    count(DISTINCT user) as new_user
    FROM (
    SELECT
    FROM_ADDRESS as user,
    min(block_timestamp) as first_tx
    FROM eventTb
    GROUP BY 1
    )
    GROUP BY 1
    )

    SELECT
    a.date,
    active_users,
    coalesce(new_user,0) as n_new_user,
    sum(n_new_user) over (ORDER by date) as cum_users,
    active_users - n_new_user as recurring_user,
    100 * n_new_user / active_users as new_user_percent,
    Last run: 8 days ago
    DATE
    ACTIVE_USERS
    N_NEW_USER
    CUM_USERS
    RECURRING_USER
    NEW_USER_PERCENT
    RECURRING_USER_PERCENT
    Avg Active Users
    AVARAGE_7_ACTIVE_USERS
    Avg New User
    AVARAGE_7_NEW_USER
    1
    2025-03-06 00:00:00.00050065630265564494351.25836498.74163637691.164835735152918.2857141477
    2
    2025-03-05 00:00:00.000848642759264934821053.25108496.74891637553.67777877491.1422943.7111111503.142
    3
    2025-03-04 00:00:00.000780262305262175757212.95414397.04585737022.10112473515.8572945.7865171215.428
    4
    2025-03-03 00:00:00.00077785732259870770530.94105599.05894536556.14772771666.4282953.068182978.857
    5
    2025-03-02 00:00:00.00068310805259138675051.17845198.82154936082.25287472481.4282978.5977011045.142
    6
    2025-03-01 00:00:00.000871081971258333851372.26270897.73729235707.51162874283.2853003.8720931106.428
    7
    2025-02-28 00:00:00.000684471137256362673101.66113998.33886135102.8728133016.023529930.857
    8
    2025-02-27 00:00:00.00077898813255225770851.04367298.95632834705.84523871966.5713038.392857878.714
    9
    2025-02-26 00:00:00.00057037745254412562921.3061798.6938334185.45783172009.5713065.204819884.142
    10
    2025-02-25 00:00:00.00065080649253667644310.99723499.00276633906.78048876091.5713093.5943.857
    11
    2025-02-24 00:00:00.000834901196253018822941.43250798.56749333521.92592677181.7143123.679012984.142
    12
    2025-02-23 00:00:00.000809231234251822796891.52490698.47509432897.32578054.4283147.775916.428
    13
    2025-02-22 00:00:00.00076816742250588760740.96594599.03405532289.40506377989.7143172908.714
    14
    2025-02-21 00:00:00.00062522772249846617501.23476598.76523531718.551282797333203.153846924
    15
    2025-02-20 00:00:00.00078199851249074773481.08824998.91175131318.50649482586.7143234.727273925.571
    16
    2025-02-19 00:00:00.000856111163248223844481.3584798.6415330701.65789581278.4283266.092105958.571
    17
    2025-02-18 00:00:00.00072711931247060717801.28041198.71958929969.53333378962.5713294.133333922.857
    18
    2025-02-17 00:00:00.00089599722246129888770.80581399.19418729391.94594678715.5713326.067568962.142
    19
    2025-02-16 00:00:00.000804701180245407792901.46638598.53361528567.19178179703.7143361.7397262439.714
    20
    2025-02-15 00:00:00.00089019849244227881700.95372999.04627127846.31944480315.4283392.0416672456
    91
    9KB
    2s