Kruys-Collins$GUI token holders copy
    Updated 2025-03-23
    -- forked from $MOD token holders @ https://flipsidecrypto.xyz/studio/queries/565782f5-e679-4765-956a-78ab0d4678ac


    with base as (
    SELECT
    ACCOUNT_ADDRESS as Wallet
    , AMOUNT/1e6 as amount
    FROM aptos.core.fact_transfers
    where
    token_address = '0xe4ccb6d39136469f376242c31b34d10515c8eaaa38092f804db8e08a8f53c5b2::assets_v1::EchoCoin002'
    AND TRANSFER_EVENT = 'DepositEvent'

    UNION ALL
    SELECT
    ACCOUNT_ADDRESS as Wallet
    , -AMOUNT/1e6 as amount
    FROM aptos.core.fact_transfers
    where
    token_address = '0xe4ccb6d39136469f376242c31b34d10515c8eaaa38092f804db8e08a8f53c5b2::assets_v1::EchoCoin002'
    AND TRANSFER_EVENT = 'WithdrawEvent'
    ),
    refine as (

    SELECT
    wallet
    , SUM (amount) as balance
    from base
    Group by 1
    having balance >= 1
    )

    SELECT
    count(distinct wallet) as total_holders from refine
    Last run: about 1 month ago
    TOTAL_HOLDERS
    1
    54888
    1
    9B
    5s