Stin00Share of NFTs Minted
    Updated 2022-08-02
    --darvishi
    WITH
    nft_maps AS (
    SELECT
    nft_type, nft_name
    FROM (VALUES
    (0,'Governance & Public Goods')
    ,(1,'Finance')
    ,(2,'Arts & Culture')
    ,(3,'Gaming')
    ,(4,'Tech & Engineering')
    ) a (nft_type, nft_name)
    )
    , nft_splits AS (
    SELECT
    right(input_data, 1) AS nft_type,
    COUNT(*) AS num_nfts,
    COUNT(DISTINCT from_address) AS num_minters
    FROM
    optimism.core.fact_transactions
    WHERE
    to_address = '0x81b30ff521d1feb67ede32db726d95714eb00637' --https://optimistic.etherscan.io/token/0x81b30ff521d1feb67ede32db726d95714eb00637
    AND ORIGIN_FUNCTION_SIGNATURE = '0xc634d032' --mintToken(uint256 nftType)
    AND BLOCK_TIMESTAMP >= '2022-07-26'::DATE
    AND status = 'SUCCESS'

    GROUP BY 1
    )

    SELECT
    m.nft_name, num_nfts, num_minters, NUM_MINTERS/(SUM(NUM_MINTERS) OVER ()) AS pct_minters FROM nft_splits n
    LEFT JOIN nft_maps m ON n.nft_type = m.nft_type
    ORDER BY 4 DESC
    Run a query to Download Data