Query editor
-- Purpose:-- Select the 100 Ethereum NFT collection addresses with the most OpenSea trades-- from 2024-05-01 to 2024-07-23, restricted to collections that are very likely-- in the optional-royalty regime.---- Operational definition of "optional royalty":-- A collection is treated as optional if at least one OpenSea sale in the sample-- paid zero creator royalty. This is conservative: it confirms that a seller-- could pay 0, but it may exclude optional collections where every seller chose-- to pay royalty during the window.---- Collection age restriction:-- The NFT contract must be first seen in nft.transfers before 2024-05-01.WITH params AS (SELECTTIMESTAMP '2025-10-06 00:00:00' AS start_time,TIMESTAMP '2025-12-29 00:00:00' AS end_time,TIMESTAMP '2025-10-06 00:00:00' AS collection_cutoff),collection_first_seen AS (SELECTcontract_address AS collection_address,MIN(block_time) AS first_seen_timeFROM nft.transfersWHERE blockchain = 'ethereum'AND block_time < (SELECT collection_cutoff FROM params)GROUP BY 1),opensea_sales AS (SELECTt.nft_contract_address AS collection_address,t.collection,t.unique_trade_id,t.token_id,t.tx_hash,COALESCE(t.royalty_fee_amount, 0) AS royalty_fee_amount,COALESCE(t.royalty_fee_percentage, 0) AS royalty_fee_percentageFROM nft.trades tINNER JOIN collection_first_seen cON t.nft_contract_address = c.collection_addressWHERE t.blockchain = 'ethereum'AND t.project = 'opensea'AND t.block_time >= (SELECT start_time FROM params)AND t.block_time < (SELECT end_time FROM params)AND t.block_month >= DATE '2025-10-06'AND t.block_month < DATE '2025-12-29'AND t.evt_type = 'Trade'AND t.amount_original IS NOT NULLAND t.amount_original > 0AND LOWER(t.currency_symbol) IN ('eth', 'weth'))SELECTcollection_address,MAX(collection) AS collection_name,COUNT(DISTINCT CONCAT(CAST(tx_hash AS VARCHAR), '-', collection, '-', CAST(token_id AS VARCHAR))) AS opensea_trade_count,SUM(CASE WHEN royalty_fee_amount = 0 THEN 1 ELSE 0 END) AS zero_royalty_trade_count,