mo115Untitled Query
    Updated 2022-04-14
    (with D as(with A as (select PURCHASER, sum(SALES_AMOUNT) as total_amount
    from solana.fact_nft_sales
    where block_timestamp >= '2022-03-01'
    and (MARKETPLACE = 'magic eden v1' or MARKETPLACE = 'magic eden v2')
    group by PURCHASER
    order by total_amount desc
    limit 20)
    select DATE_TRUNC('hour', b.block_timestamp) AS time , a.PURCHASER, count (mint) as NFTs, case when NFTs > 10 then 'yes' end as sweep
    from A a join solana.fact_nft_sales b on a.PURCHASER=b.PURCHASER
    where block_timestamp >= '2022-03-01'
    group by 1,2)
    select Count(d.sweep)
    from D )
    union
    (with D as(with A as (select PURCHASER, sum(SALES_AMOUNT) as total_amount
    from solana.fact_nft_sales
    where block_timestamp >= '2022-03-01'
    and (MARKETPLACE = 'magic eden v1' or MARKETPLACE = 'magic eden v2')
    group by PURCHASER
    order by total_amount desc
    limit 20)
    select DATE_TRUNC('hour', b.block_timestamp) AS time , a.PURCHASER, count (mint) as NFTs, case when NFTs <= 10 then 'no' end as sweep
    from A a join solana.fact_nft_sales b on a.PURCHASER=b.PURCHASER
    where block_timestamp >= '2022-03-01'
    group by 1,2)
    select Count(d.sweep)
    from D )
    Run a query to Download Data