kiacryptoSales count of top 5 collection of each day
    Updated 2022-08-02
    select
    date_trunc('day', block_timestamp) as date,
    project_name,
    nft_address,
    case when nft_address = '0xbe81eabdbd437cba43e4c1c330c63022772c2520' then 'unknown'
    when nft_address = '0x69a68eb548a37ee475d9f89646945588558796d1' then 'Oliens'
    when nft_address = '0x81b30ff521d1feb67ede32db726d95714eb00637' then 'Optimistic Explorer'
    when nft_address = '0xa95579592078783b409803ddc75bb402c217a924' then 'Optimism Collective: Hello World'
    when nft_address = '0xe0a3711d4286e628998d47bef524c292defd1719' then 'Holo Mask : White & Black' else project_name end as collection,
    count(*) as sales_count,
    row_number() over(partition by date order by sales_count desc) as amount_rank,
    case when amount_rank < 5 then collection else 'rest' end as collecton_category
    from optimism.core.ez_nft_sales left join optimism.core.dim_labels on address = nft_address
    where
    platform_address in ('0x20975da6eb930d592b9d78f451a9156db5e4c77b', '0x065e8a87b8f11aed6facf9447abe5e8c5d7502b6', '0x3f9da045b0f77d707ea4061110339c4ea8ecfa70') and
    event_type = 'sale'
    group by 1, 2, 3, 4
    order by 5 desc
    Run a query to Download Data