Query editor
WITH wallet_contracts AS (-- Get the distinct wallets and the contract addresses they bought fromSELECTtrader_id,token_bought_mint_addressFROMdex_solana.tradesWHEREtoken_bought_mint_address IN ('9wK8yN6iz1ie5kEJkvZCTxyN1x5sTdNfx8yeMY8Ebonk','JosjEXh69RckgSs2AWsN1xN8zmiSHxBuJjHLURJnHhg','DLLBw7Ecw8pQ8TBxRkY45P6wX9U6PsxpRgzKR7EDpump','ANV67ojLzxLeout1zi1q5yZAKdUTmhMjH5EaZn3zpump')GROUP BYtrader_id, token_bought_mint_address),wallets_with_all_contracts AS (-- Find wallets that bought from all the specified contract addressesSELECTtrader_idFROMwallet_contractsGROUP BYtrader_idHAVINGCOUNT(DISTINCT token_bought_mint_address) = 4 -- Number of unique contract addresses)SELECTtrader_idFROMwallets_with_all_contractsORDER BYtrader_id