brian-terraUntitled Query
    Updated 2023-01-23
    with

    nft_transfers as (

    select distinct

    date_trunc('week',block_timestamp) as date,
    event_inputs:tokenId::float as tokenid,
    last_value(event_inputs:to::string) over (partition by event_inputs:tokenId, date order by block_timestamp) as receiver

    from polygon.core.fact_event_logs
    where block_timestamp <= '2023-01-21'
    and block_timestamp ::date > '2022-09-01'
    and event_name = 'Transfer'
    and contract_address = '0x09421f533497331e1075fdca2a16e9ce3f52312b' --hellcats contract
    and tx_status = 'SUCCESS'
    ),

    aggregated as (

    select

    date,
    concat(to_char(date,'MMMM'),' ',date_part('day',date_trunc('week',date))) as month_date,
    count(distinct receiver)

    from nft_transfers
    group by 1,2
    )

    select *
    from aggregated
    order by date desc
    Run a query to Download Data