zakkisyedEth in Circulation
    Updated 2023-04-07
    WITH block_rewards AS (
    SELECT
    BLOCK_NUMBER,
    CASE
    WHEN BLOCK_NUMBER = 1 THEN 5000000000000000000 -- first block has 5 ETH reward
    ELSE 2000000000000000000 -- all other blocks have 2 ETH reward
    END AS REWARD,
    BLOCK_TIMESTAMP
    FROM
    ethereum.core.fact_blocks
    )
    SELECT
    SUM(REWARD) AS total_eth_in_circulation
    FROM
    block_rewards
    WHERE
    BLOCK_TIMESTAMP <= CURRENT_TIMESTAMP()

    Run a query to Download Data