Pine AnalyticsINK 12 copy
    Updated 2025-04-06
    with tab1 as (
    select
    block_timestamp,
    tx_hash,
    to_address as wallet,
    'in' as tx_type,
    amount

    from ink.core.ez_token_transfers
    where contract_address like lower('0xF1815bd50389c46847f0Bda824eC8da914045D14')
    --and to_address like '0x0000000000000000000000000000000000000000'

    union all

    select
    block_timestamp,
    tx_hash,
    from_address as wallet,
    'out' as tx_type,
    amount

    from ink.core.ez_token_transfers
    where contract_address like lower('0xF1815bd50389c46847f0Bda824eC8da914045D14')
    --and like '0x0000000000000000000000000000000000000000'
    )

    select
    case when balance < 1 then 'a/ Below 1'
    when balance < 10 then 'b/ 1-10'
    when balance < 100 then 'c/ 10-100'
    when balance < 1000 then 'd/ 100-1K'
    when balance < 10000 then 'e/ 1K-10K'
    when balance < 100000 then 'f/ 10K-100K'
    when balance < 1000000 then 'g/ 100K-1M'
    when balance < 10000000 then 'h/ 1M-10M'
    else 'i/ 10M+' end as Token_balance_group,
    Last run: about 2 months ago
    TOKEN_BALANCE_GROUP
    WALLETS
    TOTAL_BALANCE
    1
    e/ 1K-10K3789527.050319
    2
    b/ 1-102539447530.510323
    3
    f/ 10K-100K8196774.031563
    4
    d/ 100-1K25767063.058242
    5
    c/ 10-100177344429.641671
    6
    g/ 100K-1M1718248.095988001
    7
    a/ Below 1236403241.166118
    7
    224B
    17s