jackguyWallets by AREO Balance copy
    Updated 2025-02-10
    -- forked from Wallets by AREO Balance @ https://flipsidecrypto.xyz/edit/queries/748cebd1-f065-4dfd-9a84-7b3bd021bc5e

    SELECT
    CASE when balance < 100 then 'a Below 100 AREO'
    when balance < 1000 then 'b 100 - 1K AREO'
    when balance < 10000 then 'c 1K - 10K AREO'
    when balance < 100000 then 'd 10K - 100K AREO'
    when balance < 1000000 then 'e 100K - 1M AREO'
    when balance < 10000000 then 'f 1M - 10M AREO'
    when balance < 100000000 then 'g 10M - 100M AREO'
    else 'h 100M+ AREO'end as holder_group,
    count(*) as holders,
    sum(balance) as token_supply

    FROM (
    SELECT
    user as wallet,
    sum(CASE when tx_type LIKE 'in' then amt else -1 * amt end) as balance

    FROM (
    SELECT
    FROM_address as user,
    'out' as tx_type,
    sum(raw_amount / power(10, 18)) as amt
    FROM base.core.fact_token_transfers
    WHERE contract_address LIKE lower('0x940181a94A35A4569E4529A3CDfB74e38FD98631')
    GROUP BY 1,2

    UNION

    SELECT
    to_address as user,
    'in' as tx_type,
    sum(raw_amount / power(10, 18)) as amt
    FROM base.core.fact_token_transfers
    WHERE contract_address LIKE lower('0x940181a94A35A4569E4529A3CDfB74e38FD98631')
    Last run: 3 months agoAuto-refreshes every 3 hours
    HOLDER_GROUP
    HOLDERS
    TOKEN_SUPPLY
    1
    d 10K - 100K AREO243260709503.9619852
    2
    a Below 100 AREO2583231084183.46486944
    3
    f 1M - 10M AREO84272132360.884271
    4
    b 100 - 1K AREO237098804076.34548802
    5
    g 10M - 100M AREO20317547879.831299
    6
    h 100M+ AREO1728235177.22199
    7
    c 1K - 10K AREO1228836993437.318891
    8
    e 100K - 1M AREO27167471300.9381655
    8
    334B
    147s