i_danDaily Stats 3
    Updated 2025-02-26
    with table_1 as (
    SELECT
    MIN(block_timestamp) as create_date
    , origin_from_address
    FROM kaia.defi.ez_dex_swaps
    GROUP BY 2
    ),

    table_2 as (
    SELECT
    a.block_timestamp
    , a.origin_from_address
    , CASE when date_trunc('day', a.block_timestamp) = date_trunc('day', b.create_date) then 'New Swapper'
    else 'Old Swapper'
    end as swapper_type
    FROM kaia.defi.ez_dex_swaps a
    JOIN table_1 b on a.origin_from_address = b.origin_from_address
    )

    SELECT
    date_trunc('day', block_timestamp) as day
    , swapper_type
    , COUNT(distinct(origin_from_address)) as wallet_count
    FROM table_2
    WHERE day < date_trunc('day', current_date)
    AND day >= '2025-01-01'
    GROUP BY 1,2
    ORDER BY 1 desc, 2 desc


    QueryRunArchived: QueryRun has been archived