MasiMonthly NFT Sales
    Updated 2024-11-02
    with tb1 as ( select trunc(block_timestamp,'day') as day,
    tx_hash,
    buyer_address,
    TOTAL_PRICE
    from aptos.nft.ez_nft_sales)

    select trunc(day,'month') as monthly,
    case when day < '2023-01-01' then 'Q4 2022 (Launch)'
    when day >= '2023-01-01' and day < '2023-04-01' then 'Q1-2023'
    when day >= '2023-04-01' and day < '2023-07-01' then 'Q2-2023'
    when day >= '2023-07-01' and day < '2023-10-01' then 'Q3-2023'
    when day >= '2023-10-01' and day < '2024-01-01' then 'Q4-2023'
    when day >= '2024-01-01' and day < '2024-04-01' then 'Q1-2024'
    when day >= '2024-04-01' and day < '2024-07-01' then 'Q2-2024'
    when day >= '2024-07-01' and day < '2024-10-01' then 'Q3-2024'
    when day >= '2024-10-01' and day < '2025-01-01' then 'Q4-2024' end as breakdown,
    count(*) as sales,
    count(DISTINCT buyer_address) as buyers,
    sum(total_price) as volume,
    avg(total_price) as avg_price,
    sum(volume) over (partition by breakdown order by monthly asc) as cumulative
    from tb1
    group by 1,2





    QueryRunArchived: QueryRun has been archived