-- forked from [NFT Overview] Top 10 most traded collections (by volume) @ https://flipsidecrypto.xyz/studio/queries/d6155984-5d19-43b3-9fdb-f31148f050ff
with collections as (
select
date_trunc('month', block_timestamp) as date,
project_name as collection,
count(distinct tx_hash) as volume
from ethereum.nft.ez_nft_sales
where block_timestamp >= dateadd(month, -1, date_trunc('month', current_date()))
and block_timestamp < date_trunc('month', current_date())
and event_type = 'sale'
and collection is not null
group by 1,2
order by 3 desc
limit 10
)
select * from collections
order by 3 asc