zakkisyedCumulative Holders of PEPE
    Updated 2023-04-25
    WITH daily_holders AS (
    SELECT
    DATE_TRUNC('day', LAST_ACTIVITY_BLOCK_TIMESTAMP) AS date,
    COUNT(DISTINCT user_address) AS holder_count
    FROM ETHEREUM.core.ez_current_balances
    WHERE contract_address = '{{token-contract}}'
    and LAST_ACTIVITY_BLOCK_TIMESTAMP >= '2023-04-14'
    GROUP BY DATE_TRUNC('day', LAST_ACTIVITY_BLOCK_TIMESTAMP)
    ),
    cumulative_holders AS (
    SELECT
    date,
    SUM(holder_count) OVER (ORDER BY date) AS cumulative_holder_count
    FROM daily_holders
    ),
    holder_growth AS (
    SELECT
    date,
    cumulative_holder_count,
    LAG(cumulative_holder_count) OVER (ORDER BY date) AS prev_cumulative_holder_count
    FROM cumulative_holders
    )
    SELECT
    date,
    cumulative_holder_count,
    ROUND(
    (cumulative_holder_count - prev_cumulative_holder_count) * 100.0 / NULLIF(prev_cumulative_holder_count, 0),
    2
    ) AS day_over_day_change_percentage
    FROM holder_growth
    ORDER BY date desc;

    Run a query to Download Data