MLDZMNGOS13
    Updated 2023-02-10
    with t1 as (select
    distinct SIGNERS[0] as u_atlas
    from solana.core.fact_events
    where SUCCEEDED='TRUE'
    and BLOCK_TIMESTAMP >= CURRENT_DATE - {{Time_period_days}}
    and PROGRAM_ID in ('traderDnaR5w6Tcoi3NFm53i48FTDNbGjBSZwWXDRrg','FLEET1qqzpexyaDpqb2DGsSzE2sDCizewCg9WjrA6DBW','gateVwTnKyFrE8nxUUgfzoZTPKgJQZUbLsEidpG4Dp2')
    ),

    t2 as (select
    distinct SIGNERS[0] as u_aurory
    from solana.core.fact_events
    where SUCCEEDED='TRUE'
    and BLOCK_TIMESTAMP >= CURRENT_DATE - {{Time_period_days}}
    and PROGRAM_ID in ('EXpwP3pqPzA4arF8i89w7smtvxHzyYETmCpPspLPrR7J','STkwf3sbMapjy7KV3hgrJtcVvY4SvRxWQ8pj4Enw1i5','comp8FLpN5bbNUC2fhnkFtM7T16DWvaHs8N5dcaoZWP')
    ),

    t3 as (select
    distinct SIGNERS[0] as u_genopets
    from solana.core.fact_events
    where SUCCEEDED='TRUE'
    and BLOCK_TIMESTAMP >= CURRENT_DATE - {{Time_period_days}}
    and PROGRAM_ID in ('srmv4uTCPF81hWDaPyEN2mLZ8XbvzuEM6LsAxR8NpjU','StaKe9nb7aUjXpjpZ45o6uJBsZxj2BWCDBtjk8LCg2v','CrAFTUv7zKXBaS5471aCwHx7mq9Jp1eQQB5FQgdiSLyi','HAbiTatJVqoCJd9asyr6RxMEdwtfrQugwp7VAFyKWb1g')
    )

    select
    b.PROJECT_NAME as NFTs,
    case
    when purchaser in (select u_atlas from t1) then 'Atar Atlas'
    when purchaser in (select u_aurory from t2) then 'Aurory'
    when purchaser in (select u_genopets from t3) then 'Genopets'
    end as users,
    count(distinct purchaser) as no_users,
    count(distinct tx_id) as no_txn
    from solana.core.fact_nft_sales s left outer join solana.core.dim_nft_metadata b on s.mint=b.MINT
    where block_timestamp>=CURRENT_DATE - {{Time_period_days}}
    and SUCCEEDED='TRUE' and NFTs is not null
    Run a query to Download Data