Query editor
/* =============================================================================TOP 100 USDC HOLDERS ON ETHEREUM — trimmed baselineEngine: DuneSQL (Trino)COLUMN -> SOURCErank, address, usdc_balance, total_usdc_circulating_eth,pct_of_circulating, cumulative_pct_of_circulating derived here fromerc20_ethereum.evt_Transferentity_name, entity_primary_category labels.owner_details(reached via labels.owner_addresses.owner_key)label_bridge labels.addresses, category='bridge'bytecode_deploy_rank, bytecode_created_time contracts.contract_mappingevidence_has_creation_trace ethereum.creation_tracesevidence_emitted_log_180d ethereum.logsevidence_sent_tx_180d ethereum.transactionsn_usdc_* , *_usdc_sender derived here from the transfer scanINTERPRETATION RULES* NULL = the source has no row for this address. It is never a fact aboutthe address, only about coverage.* evidence_emitted_log_180d TRUE => contract (only contracts emit logs).* evidence_sent_tx_180d TRUE => EOA (only EOAs sign transactions),except EIP-7702 delegated EOAs, which can be both since Pectra.* evidence_has_creation_trace FALSE does NOT prove EOA — genesis contractsand trace-coverage gaps produce false negatives.* FALSE on the two windowed columns means "not observed in 180 days",not "never". Widen LOOKBACK to trade cost for certainty.* Dune has no definitive is_contract column. That requires eth_getCode(account state), which Dune does not index. These three columns togetherare the closest achievable proxy.* bytecode_deploy_rank = this address's position among all deployments ofthe SAME bytecode on this chain. 1 = first/bespoke deployment. A highrank = mass-produced clone (proxy, factory template, smart-account).Rows sharing a rank sequence are instances of one template. NULL = theaddress is not in contract_mapping (in practice: not a contract, or nobytecode record).Does NOT identify the template — for that, self-join contract_mapping on`code` to find labeled byte-identical twins. That join is expensive(full bytecode as join key); run it separately on this subset.SENDER COLUMNSOrdered by block time over INBOUND transfers only:first / second = two earliest senderslast / secondlast = two most recent sendersNULL where the address has fewer than 2/1 inbound transfers.COST* The transfer scan reads all USDC Transfer events. Expect minutes.* ev_logs and ev_tx read ethereum.logs / ethereum.transactions and are theexpensive part. Shorten LOOKBACK, or delete either CTE plus its LEFT JOIN.* block_date predicates exist only for partition pruning (these two tableshave no block_month column) and can be dropped without changing results.============================================================================= */WITHflows AS (SELECT"to" AS address,"from" AS counterparty,CAST(value AS decimal(38,0)) AS amount,