with value_transfers as (select
ETH_FROM_ADDRESS as from_address, AMOUNT_USD
from
avalanche.core.ez_avax_transfers
where date_trunc(month,BLOCK_TIMESTAMP) = '2023-04-01 00:00:00.000'
and amount_usd is not null
union all
select origin_from_address as from_address, amount_usd
from
avalanche.core.ez_token_transfers
where date_trunc(month,BLOCK_TIMESTAMP) = '2023-04-01 00:00:00.000'
and amount_usd is not null),
address_max_value_tx as (select from_address, max(amount_usd) as max_value from value_transfers
group by 1)
select
case
when max_value < 1 then 'less than 1'
when max_value >= 1 and max_value < 5 then 'between 1 and 5'
else 'greater than 5'
end "maximum value transfer per active wallet",
count(*) as "wallet count"
from address_max_value_tx
group by 1