SniperNew/ Recurring Swappers[%]
    Updated 2025-03-20
    with tbl as (
    SELECT
    block_timestamp,
    origin_from_address as user,
    FROM avalanche.defi.ez_dex_swaps
    where platform like '%pharaoh%'
    )
    ,DAU_u as (
    SELECT
    date_trunc('d', BLOCK_TIMESTAMP) as day,
    count(DISTINCT user) as Active_users
    FROM tbl
    GROUP BY 1
    )
    ,new as (
    SELECT
    date_trunc('d', first_tx) as day,
    count(DISTINCT user) as new_user
    FROM (
    SELECT
    user,
    min(block_timestamp) as first_tx
    FROM tbl
    GROUP BY 1
    )
    GROUP BY 1
    )

    SELECT
    trunc(a.day,'day' ) as date,
    Active_users,
    coalesce(new_user,0) as n_new_user,
    Active_users - n_new_user as recurring_user,
    sum(n_new_user) over (ORDER BY date asc) as cum_new_user
    FROM DAU_u a
    LEFT JOIN new b using(day)
    Last run: 27 days ago
    DATE
    ACTIVE_USERS
    N_NEW_USER
    RECURRING_USER
    CUM_NEW_USER
    1
    2025-02-28 00:00:00.0003928417351151704
    2
    2025-02-27 00:00:00.0003560432312851287
    3
    2025-02-26 00:00:00.0003560411314950855
    4
    2025-02-25 00:00:00.0003133482265150444
    5
    2025-02-24 00:00:00.0002911387252449962
    6
    2025-02-23 00:00:00.0002417359205849575
    7
    2025-02-22 00:00:00.0003172370280249216
    8
    2025-02-21 00:00:00.0003570462310848846
    9
    2025-02-20 00:00:00.0003433659277448384
    10
    2025-02-19 00:00:00.0003556583297347725
    11
    2025-02-18 00:00:00.0003616520309647142
    12
    2025-02-17 00:00:00.0003290486280446622
    13
    2025-02-16 00:00:00.0004351775357646136
    14
    2025-02-15 00:00:00.0003748790295845361
    15
    2025-02-14 00:00:00.00044211181324044571
    16
    2025-02-13 00:00:00.0005108980412843390
    17
    2025-02-12 00:00:00.0005191961423042410
    18
    2025-02-11 00:00:00.0003316532278441449
    19
    2025-02-10 00:00:00.0003357399295840917
    20
    2025-02-09 00:00:00.0003348619272940518
    59
    3KB
    3s