freemartianTotal Holders
    Updated 2025-03-05
    WITH
    current_price AS (
    SELECT
    hour, symbol, price, rank() over(ORDER BY hour DESC) AS rank
    FROM base.price.ez_prices_hourly
    WHERE token_address = '0x2b0772bea2757624287ffc7feb92d03aeae6f12d'
    qualify rank = 1
    ),
    token_in_out AS(
    SELECT
    to_address AS user,
    SUM(amount) AS amount,
    FROM base.core.ez_token_transfers
    WHERE contract_address = '0x2b0772bea2757624287ffc7feb92d03aeae6f12d'
    GROUP BY 1
    UNION ALL
    SELECT
    from_address AS user,
    SUM(-amount) AS amount,
    FROM base.core.ez_token_transfers
    WHERE contract_address = '0x2b0772bea2757624287ffc7feb92d03aeae6f12d'
    GROUP BY 1
    ),

    final as (
    SELECT
    user,
    sum(amount) AS current_ballance
    FROM token_in_out
    GROUP BY 1
    )


    SELECT
    count(user) as holders, SUM(current_ballance) AS total_tokens,
    SUM(current_ballance * price) AS Marketcap
    Auto-refreshes every 1 hour
    QueryRunArchived: QueryRun has been archived