Query editor
/* TOP 100 Holders with Accumulation/Selling and PNL Analysis (Formatted Numbers) */WITH all_transfers AS (SELECTevt_block_time,evt_block_number,evt_tx_hash,"from" AS address,-value AS amount_change,'sell' AS action_typeFROM erc20_ethereum.evt_TransferWHEREcontract_address = 0xc11158c5da9db1d553ed28f0c2ba1cbedd42cfcbAND "from" <> 0x0000000000000000000000000000000000000000UNION ALLSELECTevt_block_time,evt_block_number,evt_tx_hash,"to" AS address,value AS amount_change,'buy' AS action_typeFROM erc20_ethereum.evt_TransferWHEREcontract_address = 0xc11158c5da9db1d553ed28f0c2ba1cbedd42cfcbAND "to" <> 0x0000000000000000000000000000000000000000), holder_balances AS (SELECTaddress,SUM(amount_change) AS current_balance,MIN(evt_block_time) AS first_interaction,MAX(evt_block_time) AS last_interaction,COUNT(*) AS total_transactions,COUNT(CASE WHEN action_type = 'buy' THEN 1 END) AS buy_transactions,COUNT(CASE WHEN action_type = 'sell' THEN 1 END) AS sell_transactionsFROM all_transfersGROUP BYaddressHAVINGSUM(amount_change) > 0), top_100_holders AS (SELECTaddress,current_balance / 1e18 AS balance_tokens,first_interaction,last_interaction,total_transactions,buy_transactions,sell_transactions,CASEWHEN current_balance >= 5000000000000 * 1e18THEN 'White Whale'WHEN current_balance >= 2500000000000 * 1e18THEN 'Whale'WHEN current_balance >= 1000000000000 * 1e18THEN 'Dolphin'WHEN current_balance >= 500000000000 * 1e18THEN 'Shark'ELSE 'Crab'END AS whale_category,ROW_NUMBER() OVER (ORDER BY current_balance DESC) AS rank