Query editor
WITH address_list AS (-- Get your list of 150 addresses from your datasetSELECT addressFROM dune.artemisrsch.dataset_new_list_150_2),sender_tx_count AS (-- Pre-aggregate total tx count per sender, excluding those with more than 5000 transactionsSELECTt."from" AS sender,count(*) AS total_txFROM ethereum.transactions tGROUP BY t."from"HAVING count(*) <= 5000),incoming_txs AS (-- Retrieve transactions where the recipient is in your address list and the sender qualifiesSELECTt."from" AS from_address,t."to" AS to_address,t.hash,t.block_timeFROM ethereum.transactions tINNER JOIN address_list alON t."to" = al.addressINNER JOIN sender_tx_count stcON t."from" = stc.sender)SELECTfrom_address AS common_sender,array_join(array_agg(DISTINCT to_address), '; ') AS common_receivers,max_by(hash, block_time) AS latest_tx_hashFROM incoming_txsGROUP BY from_address-- Optional: only include senders that have sent to more than one address from your listHAVING count(DISTINCT to_address) > 1;