sarathpolygon nft1
    Updated 2022-07-16
    WITH data1 AS (SELECT address,address_name,project_name FROM polygon.core.dim_labels WHERE label_type = 'nft' AND (label_subtype = 'token_contract' OR label_subtype = 'general_contract'))
    SELECT date(e.block_timestamp) AS date , CASE WHEN date > CURRENT_DATE - 30 THEN 'Previous Month'
    ELSE 'Not recent(Before last Month)' END AS timeframe,
    COUNT(DISTINCT e.tx_hash) AS TRANSACTIONs, COUNT(DISTINCT origin_to_address) AS buyers,
    sum(matic_value) AS total_volume FROM polygon.core.fact_event_logs e
    JOIN data1 n ON e.contract_address = n.address JOIN polygon.core.fact_transactions t ON e.tx_hash = t.tx_hash
    WHERE event_name = 'Transfer' GROUP BY 1 ORDER BY 1
    Run a query to Download Data