BlockTrackernew vs returning wallets
    Updated 2025-05-28
    with dau_ as (
    select
    date_trunc('day', block_timestamp) as date,
    count(distinct swapper) as active_wallets
    from solana.defi.ez_dex_swaps
    where (swap_from_mint = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv' or swap_to_mint = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv')
    and block_timestamp > '2024-12-15'
    group by date
    )

    ,
    new_ as (
    select
    date_trunc('day', first_time) as date,
    count(distinct swapper) as new_wallets
    from (
    select
    swapper,
    min(block_timestamp) as first_time
    from solana.defi.ez_dex_swaps
    where (swap_from_mint = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv' or swap_to_mint = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv')
    and block_timestamp > '2024-12-15'
    group by 1
    )
    group by 1
    )

    select
    dau_.date,
    active_wallets,
    new_wallets,
    active_wallets - new_wallets as returning_wallets
    from dau_
    left join new_ using (date)

    QueryRunArchived: QueryRun has been archived