KaskoazulALGO New dex users
    Updated 2022-03-26
    with NEWDEX_USERS as (
    select distinct swapper, swap_program
    from algorand.swaps
    where swap_program in ('algofi', 'pactfi', 'wagmiswap')
    ),

    TINYMAN_USERS as (
    select distinct swapper, swap_program
    from algorand.swaps
    where swap_program = 'tinyman'
    and swapper in (select swapper from NEWDEX_USERS)
    )

    select count(nd.swapper),
    nd.swap_program,
    case t.swap_program
    when 'tinyman' then 'yes'
    else 'no'
    end as previous_user
    from NEWDEX_USERS nd
    left join TINYMAN_USERS t
    on nd.swapper = t.swapper
    group by 2,3
    order by 2
    Run a query to Download Data