adriaparcerisasPolygon NFTs
    Updated 2022-07-16
    --Q3. How popular are NFTs on Polygon? Track daily volume over the past month/year/etc.
    WITH
    nfts as (
    select tx_hash
    --trunc(block_timestamp,'month') as months,
    --sum(matic_value) as volume,
    --count(distinct tx_hash) as transactions
    from polygon.core.fact_event_logs x
    join polygon.core.dim_labels y on x.contract_address=y.address
    where label_type='nft'
    )
    SELECT
    trunc(block_timestamp,'day') as date,
    count(distinct tx_hash) as tx,
    sum(tx) over (order by date) as cum_tx,
    sum(matic_value) as volume,
    count(distinct from_address) as users,
    sum(users) over (order by date) as cum_users
    from polygon.core.fact_transactions where tx_hash in (select * from nfts) and block_timestamp>=CURRENT_DATE-INTERVAL '1 MONTH'
    group by 1
    order by 1 asc

    Run a query to Download Data