Query editor
WITH usdc_dex_tx AS (SELECT DISTINCT tx_hashFROM dex.tradesWHERE blockchain = 'ethereum'AND block_time >= TIMESTAMP '2026-01-01 00:00:00'AND block_time < TIMESTAMP '2026-07-01 00:00:00'AND (token_bought_address = from_hex('a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48')OR token_sold_address = from_hex('a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'))),usdc_transfers AS (SELECT tx_hash, "from" AS from_addr, "to" AS to_addrFROM tokens.transfersWHERE blockchain = 'ethereum'AND contract_address = from_hex('a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48')AND block_time >= TIMESTAMP '2026-01-01 00:00:00'AND block_time < TIMESTAMP '2026-07-01 00:00:00'),categorized AS (SELECTt.tx_hash,CASEWHEN t.to_addr = from_hex('0000000000000000000000000000000000000000')AND t.from_addr IN (from_hex('bd3fa81b58ba92a82136038b25adec7066af3155'),from_hex('28b5a0e9c621a5badaa536219b3a228c8168cf5d'))THEN 'Bridge / Cross-chain (CCTP burn leg)'WHEN t.to_addr = from_hex('0000000000000000000000000000000000000000')THEN 'Issuer / Burn / Redemption'WHEN t.from_addr = from_hex('0000000000000000000000000000000000000000')THEN 'Issuer - Unclassified (Mint)'WHEN d.tx_hash IS NOT NULLTHEN 'DEX Swap'ELSE 'Unidentified'END AS categoryFROM usdc_transfers tLEFT JOIN usdc_dex_tx d ON t.tx_hash = d.tx_hash),tx_level AS (SELECTtx_hash,COUNT(DISTINCT category) AS distinct_categories,MIN(category) AS single_categoryFROM categorizedGROUP BY tx_hash)SELECTCASE WHEN distinct_categories = 1 THEN single_category ELSE 'Multi-action / Complex' END AS category,COUNT(*) AS tx_countFROM tx_levelGROUP BY 1ORDER BY 1;