cryptonerd-iBCnogavalanche_VRF_cumulative
    Updated 2024-09-17
    -- forked from polygon_VRF_cummulative @ https://flipsidecrypto.xyz/edit/queries/dfef16a7-5f7d-4710-9b86-9dd0735b4241
    -- forked from Ethereum_VRF_cummulative @ https://flipsidecrypto.xyz/edit/queries/a472f791-ff32-45fc-baff-0b5fef200b43

    SELECT
    EVENT_DATE,
    daily_event_count,
    SUM(daily_event_count) OVER (ORDER BY EVENT_DATE) AS cumulative_event_count
    FROM (
    SELECT
    DATE(BLOCK_TIMESTAMP) AS EVENT_DATE,
    COUNT(*) AS daily_event_count
    FROM
    avalanche.core.fact_decoded_event_logs
    WHERE
    CONTRACT_ADDRESS = '0xd5d517abe5cf79b7e95ec98db0f0277788aff634'
    AND EVENT_NAME = 'RandomWordsRequested'
    GROUP BY
    DATE(BLOCK_TIMESTAMP)
    ) AS daily_counts
    ORDER BY
    EVENT_DATE;
    QueryRunArchived: QueryRun has been archived