HessishNBATOPSH -users
    Updated 2024-09-06
    -- forked from NBATOPSH - trades @ https://flipsidecrypto.xyz/studio/queries/4cfa0eda-7d0a-416f-8615-c26d03193c50


    with pr as (select HOUR::date as date1 , avg(close) as prc
    from crosschain.price.fact_prices_ohlc_hourly
    where
    ASSET_ID = 'flow'
    group by all),

    nba as
    (SELECT BLOCK_TIMESTAMP::date as date , tx_id , seller as user, MARKETPLACE
    from flow.nft.ez_nft_sales
    where nft_collection = 'A.0b2a3299cc857e29.TopShot'
    and BLOCK_TIMESTAMP::date >= '2024-01-01'

    union

    SELECT BLOCK_TIMESTAMP::date as date , tx_id , BUYER as user , MARKETPLACE
    from flow.nft.ez_nft_sales
    where nft_collection = 'A.0b2a3299cc857e29.TopShot'
    and BLOCK_TIMESTAMP::date >= '2024-01-01'
    )



    select date_trunc('week',date) as date,
    case when MARKETPLACE ilike '%TopShot%' then 'TopShot marketplace'
    when MARKETPLACE = 'A.b8ea91944fd51c43.OffersV2' then 'Dapper offer'
    else 'Other markets' end as "NFT marketplace"
    , count(DISTINCT user) as users
    from nba
    group by 1, "NFT marketplace"

    QueryRunArchived: QueryRun has been archived