boomer77hellcats polygon
    Updated 2023-04-05
    with hc as (select *
    from polygon.core.ez_nft_transfers
    where project_name = 'HellCats'),

    pay as (select *
    from polygon.core.ez_matic_transfers
    where tx_hash in (select tx_hash from hc) and identifier = 'CALL_ORIGIN'),

    royalties as (select *
    from polygon.core.ez_matic_transfers
    where tx_hash in (select tx_hash from hc) and identifier = 'CALL_3'),

    hcsales as (select a.block_timestamp, a.event_index, a.event_type, a.nft_address,
    a.nft_from_address,a.nft_to_address, a.project_name, a.tokenid, a.tx_hash,
    b.amount, b.amount_usd, c.amount as royalty_matic, c.amount_usd as royalty_usd
    from hc a
    left join pay b on a.tx_hash = b.tx_hash
    left join royalties c on a.tx_hash = b.tx_hash
    where b.amount is not null
    order by 1 desc)

    select date_trunc('day', block_timestamp) as dt, count(distinct tx_hash) as sales_tx,
    sum(amount) as sales_matic, sum(amount_usd) as sales_usd, count(distinct nft_to_address) as
    buyer_count, count(distinct nft_from_address) as seller_count
    from hcsales
    group by 1
    order by 1 desc
    Run a query to Download Data