Pmisha-bmlMdxdex.loyal.2
    Updated 2022-05-09
    with new_year as(
    with t1 as(select
    block_timestamp as dt,
    sender as users,
    tx_hash
    from ethereum_core.ez_dex_swaps
    where platform='sushiswap'
    )

    SELECT
    distinct users,
    count(distinct dt::date) as day_usage,
    count(tx_hash) as no_usage
    from t1
    where dt>='2022-01-01'
    group by 1)

    select
    case
    when no_usage between 1 and 50 then '1-50 usage'
    when no_usage between 51 and 200 then '51-200 usage'
    when no_usage between 201 and 1000 then '201-1000 usage'
    when no_usage > 1000 then 'over 1000 usage'
    end as usages,
    count(distinct users) as participants
    from new_year group by 1 having usages is not null
    Run a query to Download Data