kiacryptonew user
    Updated 2022-11-20
    with min_date as (
    select
    swapper,
    min(block_timestamp) as min_date
    from algorand.defi.fact_swap
    where
    swap_program = '{{dex}}' and
    swap_from_amount > 0
    group by 1 having min_date >= '{{start_date}}' and min_date <= '{{end_date}}'
    )

    select
    date_trunc('{{interval}}', min_date) as date,
    count(distinct swapper) as new_user
    from min_date
    group by 1
    Run a query to Download Data