Query editor
WITH t AS (SELECT hash,"to" executor FROM robinhood.transactions WHERE block_date=DATE '2026-10-26' AND "to" NOT IN (FROM_HEX('520ed467860d840ec6ca20f1dacb9c0fa5168aa7'),FROM_HEX('278d858f05b94576c1e6f73285886876ff6ef8d2'),FROM_HEX('e4876611ed2e2654887339c601a16c98cd043cd8'),FROM_HEX('203bffa697bee74d39d255c1c028e3efa689b5f7'),FROM_HEX('7ddbd3952d9fd58cc7d344ad0931d08db072114a'))),rh AS (SELECT DISTINCT FROM_HEX(REPLACE(LOWER(contract_address),'0x','')) a FROM dune.bitgetwallet.result_robinhood_rhj_registry WHERE chain='robinhood'),d AS (SELECT v.tx_hash,v.project_contract_address pool,v.amount_usd,(a.a IS NOT NULL OR b.a IS NOT NULL) rwa FROM dex.trades v JOIN t ON t.hash=v.tx_hash LEFT JOIN rh a ON a.a=v.token_sold_address LEFT JOIN rh b ON b.a=v.token_bought_address WHERE blockchain='robinhood' AND block_month=DATE '2026-10-01' AND block_date=DATE '2026-10-26'),summary AS (SELECT tx_hash,SUM(IF(rwa,amount_usd,0)) rwa_usd,COUNT_IF(rwa) rwa_events,ARRAY_AGG(DISTINCT pool) FILTER(WHERE pool IS NOT NULL) pools FROM d GROUP BY 1 HAVING COUNT_IF(rwa)>0),ev AS (SELECT x.tx_hash,x.evt_index,x.contract_address token,x."from" sender,x."to" recipient,NOT CONTAINS(s.pools,x."from") AND x."from"<>t.executor src_external,NOT CONTAINS(s.pools,x."to") AND x."to"<>t.executor dst_externalFROM tokens.transfers x JOIN summary s ON s.tx_hash=x.tx_hash JOIN t ON t.hash=x.tx_hashWHERE x.blockchain='robinhood' AND x.block_month=DATE '2026-10-01' AND x.block_date=DATE '2026-10-26'AND x.evt_index IS NOT NULL AND x.contract_address IS NOT NULLAND x."from"<>FROM_HEX('0000000000000000000000000000000000000000') AND x."to"<>FROM_HEX('0000000000000000000000000000000000000000')),boundary AS (SELECT tx_hash,MIN_BY(IF(src_external,sender,NULL),IF(src_external,evt_index,999999999)) payer,MAX_BY(IF(dst_external,recipient,NULL),IF(dst_external,evt_index,-1)) receiverFROM ev GROUP BY 1),wallet AS (SELECT b.tx_hash,b.payer,b.receiver,COUNT(DISTINCT IF(e.sender=b.payer,e.token,NULL)) paid_types,COUNT(DISTINCT IF(e.recipient=b.payer,e.token,NULL)) got_types,MAX_BY(IF(e.sender=b.payer,e.token,NULL),IF(e.sender=b.payer,e.evt_index,-1)) paid_token,MAX_BY(IF(e.recipient=b.payer,e.token,NULL),IF(e.recipient=b.payer,e.evt_index,-1)) received_tokenFROM boundary b JOIN ev e ON e.tx_hash=b.tx_hash GROUP BY 1,2,3),oldbounds AS (SELECT tx_hash,MIN_BY(sender,evt_index) sender_first,MAX_BY(recipient,evt_index) receiver_last,MIN_BY(recipient,evt_index) first_hub,MAX_BY(sender,evt_index) last_hub,MIN_BY(token,evt_index) asset_first,MAX_BY(token,evt_index) asset_lastFROM ev GROUP BY 1),oldstats AS (SELECT b.tx_hash,b.sender_first,b.receiver_last,b.first_hub,b.last_hub,b.asset_first,b.asset_last,COUNT_IF(e.sender=b.sender_first) n_debits,COUNT_IF(e.recipient=b.sender_first) n_creditsFROM oldbounds b JOIN ev e ON e.tx_hash=b.tx_hash GROUP BY 1,2,3,4,5,6,7),classed AS (SELECT w.*,s.rwa_usd,s.rwa_events,(w.payer=w.receiver AND w.paid_types=1 AND w.got_types=1 AND w.paid_token<>w.received_token) new_pool_aware,(o.sender_first=o.receiver_last AND o.first_hub=o.last_hub AND o.asset_first<>o.asset_last AND o.n_debits=1 AND o.n_credits=1) old_strict,a.a IS NOT NULL first_rwa,b.a IS NOT NULL last_rwaFROM wallet w JOIN summary s ON s.tx_hash=w.tx_hash JOIN oldstats o ON o.tx_hash=w.tx_hashLEFT JOIN rh a ON a.a=w.paid_token LEFT JOIN rh b ON b.a=w.received_token)SELECT CONCAT('0x',TO_HEX(t.executor)) executor,COUNT(*) unknown_txs,ROUND(SUM(c.rwa_usd),2) unknown_usd,COUNT_IF(c.payer IS NULL OR c.receiver IS NULL) missing_outside_payer_or_recipient,COUNT_IF(c.payer<>c.receiver) distinct_payer_receiver,COUNT_IF(c.payer=c.receiver AND (c.paid_types>1 OR c.got_types>1)) multi_token_same_party,COUNT_IF(c.payer=c.receiver AND c.paid_token=c.received_token) same_token_payer_roundtrip,COUNT(DISTINCT c.payer) distinct_payer_wallets,MAX_BY(CONCAT('0x',TO_HEX(c.tx_hash)),c.rwa_usd) largest_txFROM classed c JOIN t ON t.hash=c.tx_hashWHERE NOT c.old_strict AND NOT COALESCE(c.new_pool_aware,false)GROUP BY 1 ORDER BY unknown_usd DESC LIMIT 35