select PURCHASER
,sum(SALES_AMOUNT)as sales_volume
,count(distinct MINT) as bought_token
,count(distinct TX_ID)as sales_count,rank()over(order by sales_volume)as rank
from solana.core.fact_nft_sales
where (MARKETPLACE='magic eden v1' or MARKETPLACE='magic eden v2')
and BLOCK_TIMESTAMP>='2022-11-07' and BLOCK_TIMESTAMP<'2022-11-14'
group by 1
order by 3 desc
limit 10