SocioCryptoNumber of sales
    Updated 2023-08-26
    SELECT date_trunc('day',block_timestamp) as date,
    count(DISTINCT tx_hash) as n_sales,
    COUNT(DISTINCT decoded_log:from) as n_seller,
    COUNT(decoded_log:to) as n_purchaser,
    sum(avax_value) as amnt
    -- count(event_inputs:tokenId) as n_NFTs,
    -- contract_address as nft_address
    FROM avalanche.core.ez_decoded_event_logs a
    LEFT JOIN avalanche.core.fact_transactions b using(tx_hash)
    WHERE decoded_log:tokenId IS NOT NULL
    AND date <= CURRENT_DATE-1
    AND avax_value>0
    AND tx_status = 'SUCCESS'
    AND event_name = 'Transfer'
    AND decoded_log:to !='0x0000000000000000000000000000000000000000'
    AND decoded_log:from != '0x0000000000000000000000000000000000000000'
    GROUP BY date
    ORDER BY date DESC

    Run a query to Download Data