WITH quixotic AS (
SELECT *
from optimism.core.ez_nft_sales
WHERE event_type = 'sale'
AND PLATFORM_NAME = 'quixotic'
AND price <> '0'
)
SELECT
tokenid,
count(DISTINCT tx_hash) as Number_sales ,
SUM(price_usd) AS "total volume of transactions",
MIN(price_usd) AS MIN_price_usd,
AVG(price_usd) AS AVG_price_usd,
MAX(price_usd) AS MAX_price_usd
FROM quixotic
where price_usd is not null
group by 1
ORDER BY 3 DESC
LIMIT 10