Sbhn_NPTP Comp
    Updated 2024-11-18
    with base as (
    select DISTINCT nft_address as nft,
    sum(price_usd) as usd_volume
    from near.nft.ez_nft_sales
    where platform_name='TradePort'
    and block_timestamp::date>= '2024-01-01'
    group by 1
    order by 2 DESC
    limit 10)

    select date_trunc('day',block_timestamp) as date,
    case when method_name='resolve_offer' then 'Offer'
    when method_name='resolve_purchase' then 'Purchase' end as type,
    nft_address,
    count(DISTINCT tx_hash) as txs,
    count(DISTINCT buyer_address) as buyers,
    count(DISTINCT SELLER_ADDRESS) as sellers,
    sum(price) as volume,
    sum(price_usd) as usd_volume
    from near.nft.ez_nft_sales
    where platform_name='TradePort'
    and date>= current_date-30
    and nft_address in (select nft from base)
    group by 1,2,3


    QueryRunArchived: QueryRun has been archived