Query editor
WITH airdrop_recipients AS (SELECT"to" AS wallet,SUM(CAST(value AS DOUBLE)) / 1e18 AS airdrop_amountFROM erc20_ethereum.evt_TransferWHERE contract_address = 0x910812c44ed2a3b611e4b051d9d83a88d652e2ddAND "from" = 0x0000000000000000000000000000000000000000GROUP BY "to"),-- All non-mint, non-burn transfers involving airdrop walletsactivity AS (SELECTar.wallet,ar.airdrop_amount,-- Total tokens received AFTER the airdrop (= bought or received)COALESCE(SUM(CASEWHEN t."to" = ar.walletAND t."from" != 0x0000000000000000000000000000000000000000THEN CAST(t.value AS DOUBLE)ELSE 0END) / 1e18, 0) AS total_bought,-- Total tokens sent outCOALESCE(SUM(CASEWHEN t."from" = ar.walletAND t."to" != 0x0000000000000000000000000000000000000000THEN CAST(t.value AS DOUBLE)ELSE 0END) / 1e18, 0) AS total_soldFROM airdrop_recipients arLEFT JOIN erc20_ethereum.evt_Transfer tON (t."to" = ar.wallet OR t."from" = ar.wallet)AND t.contract_address = 0x910812c44ed2a3b611e4b051d9d83a88d652e2ddGROUP BY ar.wallet, ar.airdrop_amount)SELECTwallet,airdrop_amount,total_bought,total_sold,airdrop_amount + total_bought - total_sold AS current_balance,CASEWHEN total_sold <= 0 AND total_bought > 0THEN 'Accumulator (bought more, sold nothing)'WHEN total_sold <= 0 AND total_bought <= 0THEN 'Untouched (never moved)'WHEN total_bought > 0 AND (airdrop_amount + total_bought - total_sold) > airdrop_amountTHEN 'Net Accumulator (bought + sold, still up)'WHEN (airdrop_amount + total_bought - total_sold) >= airdrop_amount * 0.9THEN 'Diamond Hands (90%+ of airdrop held)'WHEN (airdrop_amount + total_bought - total_sold) >= airdrop_amount * 0.5THEN 'Partial Seller (50-90% left)'WHEN (airdrop_amount + total_bought - total_sold) > 0THEN 'Mostly Sold (<50% left)'ELSE 'Fully Dumped (0 balance)'END AS behaviorFROM activityORDER BY current_balance DESC;