Ali3NDistribution of BLUB Holders By Their Balance in Avalanche
    Updated 2025-04-14
    with receivet as (
    select to_address as Receiver,
    sum (amount) as Received_Volume
    from avalanche.core.ez_token_transfers
    where contract_address = '0x0f669808d88b2b0b3d23214dcd2a1cc6a8b1b5cd'
    group by 1),

    sendt as (
    select from_address as sender,
    sum (amount) as sent_volume
    from avalanche.core.ez_token_transfers
    where contract_address = '0x0f669808d88b2b0b3d23214dcd2a1cc6a8b1b5cd'
    group by 1),

    balancetable as (
    select coalesce (t1.Receiver,t2.sender) as Holder,
    coalesce (Received_Volume, 0) - coalesce (sent_volume, 0) as Balance
    from receivet t1 full outer join sendt t2 on t1.receiver = t2.sender)

    select case when balance < 1 then '< 1 $BLUB'
    when balance >= 1 and balance < 100000 then '1 - 100,000 $BLUB'
    when balance >= 100000 and balance < 1000000 then '100,000 - 1,000,000 $BLUB'
    when balance >= 1000000 and balance < 10000000 then '1,000,000 - 10,000,000 $BLUB'
    else '> 10,000,000 $BLUB' end as type,
    count (Distinct holder) as Holders_Count
    from balancetable
    where balance > 0
    group by 1
    order by 2 desc



    Last run: 12 days agoAuto-refreshes every 24 hours
    TYPE
    HOLDERS_COUNT
    1
    1 - 100,000 $BLUB3468
    2
    < 1 $BLUB747
    3
    100,000 - 1,000,000 $BLUB591
    4
    1,000,000 - 10,000,000 $BLUB163
    5
    > 10,000,000 $BLUB7
    5
    142B
    5s