eferfanSeasons 3
    Updated 2022-10-19
    with Base_Data as
    (
    select
    date_trunc('Day', block_timestamp) as date,
    tx_hash ,
    tx_signer ,
    tx_receiver ,
    TRY_PARSE_JSON(REPLACE(tx:receipt[0]:outcome:logs[0], 'EVENT_JSON:')):data[0]:token_ids[0] as Nft,
    (tx:actions[0]:FunctionCall:deposit / POW(10, 24)) as volume
    FROM
    near.core.fact_transactions
    WHERE
    date_trunc('Day', block_timestamp) >= (CURRENT_DATE - 90)
    AND SPLIT_PART(tx:receipt[0]:outcome:status, '"', 2) = 'SuccessValue'
    AND tx:actions[0]:FunctionCall:method_name = 'nft_mint'
    )


    SELECT
    tx_receiver,
    COUNT(DISTINCT tx_hash) AS Mint_Count,
    COUNT(DISTINCT tx_signer) AS Minter_Count,
    COUNT(DISTINCT Nft) AS Nft_Count,
    SUM(volume) AS Volumes,
    AVG(volume) AS Price
    FROM
    Base_Data
    GROUP by 1
    HAVING Minter_Count > 1 and NFT_COUNT > 1
    order by 5 DESC
    LIMIT 10


    Run a query to Download Data