vahid-2jsEENtier_2_status
    Updated 2022-05-17
    with mint_table as (select MINT from solana.dim_nft_metadata where CREATOR_NAME = 'Catalina Whale Mixer' )

    , unique_holder as (select count(distinct PURCHASER) as holders ,date(BLOCK_TIMESTAMP) as dt from solana.fact_nft_sales
    inner join mint_table on solana.fact_nft_sales.MINT=mint_table.MINT
    group by dt)
    , sales_history as (select sum(SALES_AMOUNT) as sales ,date(BLOCK_TIMESTAMP) as dt from solana.fact_nft_sales
    inner join mint_table on solana.fact_nft_sales.MINT=mint_table.MINT
    group by dt)

    , tier_2_status_temp as (select count(1) as tier_2_whales_count ,purchaser,month(BLOCK_TIMESTAMP) as dt from solana.fact_nft_sales
    inner join mint_table on solana.fact_nft_sales.MINT=mint_table.MINT
    group by purchaser,dt
    having tier_2_whales_count>=5 and tier_2_whales_count<10)
    , tier_2_status as (select count(distinct purchaser) , dt from tier_2_status_temp
    group by dt)

    , tier_3_status_temp as (select count(1) as tier_3_whales_count ,purchaser,month(BLOCK_TIMESTAMP) as dt from solana.fact_nft_sales
    inner join mint_table on solana.fact_nft_sales.MINT=mint_table.MINT
    group by purchaser,dt
    having tier_3_whales_count>10)
    , tier_3_status as (select count(distinct purchaser) , dt from tier_3_status_temp
    group by dt)

    ,before_5_11_holders as (select count(distinct PURCHASER) as holders ,date(BLOCK_TIMESTAMP) as dt from solana.fact_nft_sales
    inner join mint_table on solana.fact_nft_sales.MINT=mint_table.MINT
    where dt <= '2022-05-11' and dt >= '2022-04-11'
    group by dt)
    ,before_5_11_sales as (select sum(SALES_AMOUNT) as sales ,date(BLOCK_TIMESTAMP) as dt from solana.fact_nft_sales
    inner join mint_table on solana.fact_nft_sales.MINT=mint_table.MINT
    where dt <= '2022-05-11' and dt >= '2022-04-11'
    group by dt)
    select * from tier_2_status
    Run a query to Download Data