KaskoazulPopular Traits without Background and Skin
    Updated 2022-03-30
    with sales as
    (
    SELECT
    block_timestamp as fecha,
    mint,
    marketplace
    FROM solana.fact_nft_sales
    WHERE succeeded = TRUE
    and lower(marketplace) in ('magic eden v1','magic eden v2')
    and fecha >= '2022-01-01'
    ),

    traits as
    (
    select *,
    key as trait_type,
    value as popular_traits
    from solana.dim_nft_metadata, table(flatten(solana.dim_nft_metadata.token_metadata)) tm
    where contract_name = 'DeGods'
    and key != 'Attribute Count'
    and value != 'None'

    )

    SELECT
    date_trunc('week', fecha),
    trait_type,
    popular_traits,
    count(popular_traits) as total_reps
    FROM SALES S
    INNER JOIN TRAITS T
    ON T.mint = S.mint
    where trait_type in ('Background')

    GROUP BY 1,2,3
    order by 1, total_reps desc

    Run a query to Download Data