leo-lZzln2Daily Near NFT Sale Transactions
    Updated 2022-10-26
    WITH tab0 as (
    SELECT
    date_trunc('day', TIMESTAMP) as day1,
    avg(PRICE_USD) as near_price
    FROM near.core.fact_prices
    WHERE SYMBOL ilike 'wNEAR'
    GROUP BY 1 )
    SELECT
    date_trunc('day',block_timestamp) as "block day",
    count(distinct TX_SIGNER) as buyers,
    count(distinct tx_hash) as txs,
    SUM(tx:actions[0]:FunctionCall:deposit*near_price / POW(10, 24)) as VOLUME,
    COUNT(DISTINCT TRY_PARSE_JSON(REPLACE(tx:receipt[0]:outcome:logs[0], 'EVENT_JSON:')):data[0]:token_ids[0]) AS "Total Number of NFT"
    from near.core.fact_transactions LEFT outer JOIN tab0 ON day1 = date_trunc('day', block_timestamp)
    where block_timestamp::date >= current_date - 90
    AND tx:actions[0]:FunctionCall:method_name = 'nft_buy'
    GROUP by 1


    Run a query to Download Data