Query editor
withnfts_summary as (SELECTCOALESCE(collection_mint, verified_creator) as collection_or_creator --collection is best, verified_creator is second best, version, array_agg(distinct token_symbol) filter (where trim(token_symbol) != '' AND token_symbol not like '%#%' AND token_symbol is not null) as symbols, array_agg(distinct trim(split(token_name,'#')[1])) filter (where trim(token_name) is not null) as tokens, count(*) as supplyFROM tokens_solana.nftWHERE COALESCE(collection_mint, verified_creator) is not null --if it is null then we don't want it-- AND (collection_mint != '5PA96eCFHJSFPY9SWFeRJUHrpoNF5XZL6RrE1JADXhxf'-- OR (collection_mint = '5PA96eCFHJSFPY9SWFeRJUHrpoNF5XZL6RrE1JADXhxf' AND version = 'cNFT')-- )group by 1,2)SELECTget_href(get_chain_explorer('solana') || '/account/' || coll.collection_or_creator, case when coll.version = 'cNFT' then '⚛️ ' else '' end || try(coll.tokens[1])) as token_name, get_href(get_chain_explorer('solana') || '/account/' || coll.collection_or_creator, try(coll.symbols[1])) as token_symbol, coll.supply, '||' as split, approx_percentile(case when block_time >= now() - interval '1' day then amount_usd else null end, 0.5) as price_day, sum(case when block_time >= now() - interval '7' day then amount_usd else 0 end) as sol_volume_seven, sum(case when block_time >= now() - interval '30' day then amount_usd else 0 end) as sol_volume_thirty, sum(case when block_time >= now() - interval '90' day then amount_usd else 0 end) as sol_volume_ninety-- , sum(amount_original) as sol_volume, sum(amount_usd) as usd_volume, approx_percentile(royalty_fee_percentage, 0.5) as royalty_fee_percentage, sum(royalty_fee_amount_usd) as royalties, count(*) as trades, count(distinct buyer) as unique_buyers, count(distinct seller) as unique_sellers, sum(maker_fee_amount_usd) as maker_paid_fees, sum(taker_fee_amount_usd) as taker_paid_fees, array_agg(distinct coll.collection_or_creator) as contract_address-- , arbitrary(tr.tx) as swap_ex-- , collection_mint-- , verified_creatorFROM (SELECTtr.*, COALESCE(tk_m.collection_mint, tk_m.verified_creator, tk_c.collection_mint, tk_c.verified_creator) as collection_or_creator, COALESCE(tk_m.version, tk_c.version) as tk_versionFROM nft_solana.trades trLEFT JOIN tokens_solana.nft tk_mON (tr.account_mint is not null AND tk_m.account_mint = tr.account_mint)LEFT JOIN tokens_solana.nft tk_cOn (tr.account_merkle_tree is not null AND tk_c.account_merkle_tree = tr.account_merkle_tree AND tk_c.leaf_id = tr.leaf_id)-- WHERE tk_m.collection_mint != '5PA96eCFHJSFPY9SWFeRJUHrpoNF5XZL6RrE1JADXhxf' --manual remove tensorian dupeWHERE tr.block_time >= now() - interval '400' day) tr--IGNORE TRADES with no collection_mint, master edition, or verified creatorJOIN nfts_summary coll ON coll.collection_or_creator = tr.collection_or_creator AND coll.version = tr.tk_versiongroup by 1,2,3,4HAVING sum(amount_usd) > 10 --has to have had at least 10000 USD of tradesorder by sol_volume_seven desc --seven day volume sortLIMIT 1000000