with tb AS (select
date_trunc('{{Timeframe}}',BLOCK_TIMESTAMP) AS date,
LABEL AS collection,
sum(PRICE_USD) AS Volume,
rank() over (partition by date order by Volume desc) As rank
from ethereum.core.ez_nft_sales inner join ethereum.core.dim_labels on NFT_ADDRESS=ADDRESS
where PLATFORM_NAME='opensea' and Price_USD is not NULL and date >= '2022-03-28'
group by 1,2)
select * from tb
where rank = 1