with benqi as (select address
from avalanche.core.dim_labels
where project_name ilike '%benqi%'),
base as (
select origin_from_address as user,
count(DISTINCT tx_hash) as txs
from avalanche.core.ez_decoded_event_logs
where origin_to_address in (select address from benqi)
and block_timestamp::date >= '2023-01-01'
group by 1
)
select case when txs<=1 then '1 Transaction'
when txs>1 and txs<=10 then '1 - 10 Transactions'
when txs>10 and txs<=100 then '10 - 100 Transactions'
when txs>100 then 'More Than 100 Transactions' end as splitter,
count(DISTINCT user) as users
from base
group by 1