Updated 2023-04-27
    with mint as
    (select BLOCK_TIMESTAMP, NFT_TO_ADDRESS ,TOKENID ,MINT_PRICE_ETH ,MINT_PRICE_USD ,NFT_COUNT ,TX_FEE,tx_hash
    from ethereum.core.ez_nft_mints
    where NFT_ADDRESS=lower('0x960b7a6bcd451c9968473f7bbfd9be826efd549a')
    and EVENT_TYPE ='nft_mint'
    and NFT_FROM_ADDRESS='0x0000000000000000000000000000000000000000')

    , DETAIL AS
    (select
    DATE_TRUNC('HOUR',BLOCK_TIMESTAMP) as date ,
    count(distinct NFT_TO_ADDRESS) as minters ,
    count(distinct tx_hash) as txhash ,
    count(distinct TOKENID) as NFT_minted ,
    sum(MINT_PRICE_ETH) as ETH ,
    SUM(MINT_PRICE_USD) AS USD ,
    SUM(TX_FEE) AS FEE ,
    avg(MINT_PRICE_ETH) as avgETH ,
    avg(MINT_PRICE_USD) AS avgUSD ,
    avg(TX_FEE) AS avgFEE ,
    SUM(minters) OVER (ORDER BY DATE) AS CUM_minters ,
    SUM(NFT_minted) OVER (ORDER BY DATE) AS CUM_NFT_minted ,
    SUM(ETH) OVER (ORDER BY DATE) AS CUM_ETH ,
    SUM(usd) OVER (ORDER BY DATE) AS CUM_USD ,
    SUM(FEE) OVER (ORDER BY DATE) AS CUM_FEE ,
    SUM(txhash) OVER (ORDER BY DATE) AS CUM_txhash

    FROM MINT GROUP BY 1)

    SELECT
    * ,10000-CUM_NFT_minted AS NFT_mintedS FROM DETAIL
    Run a query to Download Data