Query editor
with tok as (select t.blockchain, t.block_date as day, t.tx_from as walletfrom dex.trades tjoin evms.transactions xon x.blockchain = t.blockchain and x.hash = t.tx_hash and x.block_date = t.block_datewhere t.block_date >= date '2026-09-01' and t.block_date < date '2026-09-16'and x.block_date >= date '2026-09-01' and x.block_date < date '2026-09-16'and t.blockchain in ('ethereum','robinhood','base','arbitrum','polygon','optimism','avalanche_c','hyperevm','monad','ink','megaeth','soneium','berachain','blast','unichain','zora','stable')and x.successand bytearray_length(x.data) >= 4and bytearray_substring(x.data, bytearray_length(x.data) - 3, 4) = 0x865d8597),rh_ev as (select block_date, data, topic1,cast(varbinary_to_bigint(substr(data, 89, 8)) as integer) as offer_off,cast(varbinary_to_bigint(substr(data, 121, 8)) as integer) as cons_offfrom robinhood.logswhere block_date >= date '2026-09-01' and block_date < date '2026-09-16'and contract_address = 0x0000000000000068f116a894984e2db1123eb395and topic0 = 0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31),rh_nft as (select block_date, data, topic1from rh_evwhere (varbinary_to_bigint(substr(data, offer_off + 57, 8)) in (2, 3)or varbinary_to_bigint(substr(data, cons_off + 57, 8)) in (2, 3))and varbinary_to_bigint(substr(data, cons_off + 25, 8)) between 1 and 10),nft as (select blockchain, block_date as day, buyer as walletfrom nft.tradeswhere block_date >= date '2026-09-01' and block_date < date '2026-09-16'and project = 'opensea' and blockchain <> 'robinhood'union allselect blockchain, block_date, sellerfrom nft.tradeswhere block_date >= date '2026-09-01' and block_date < date '2026-09-16'and project = 'opensea' and blockchain <> 'robinhood'union allselect 'robinhood', block_date, substr(topic1, 13, 20) from rh_nftunion allselect 'robinhood', block_date, substr(data, 45, 20) from rh_nft),w as (select day, blockchain, wallet, max(is_tok) as is_tok, max(is_nft) as is_nftfrom (select day, blockchain, wallet, 1 as is_tok, 0 as is_nft from tokunion allselect day, blockchain, wallet, 0, 1 from nftwhere wallet <> 0x0000000000000000000000000000000000000000) ugroup by 1, 2, 3),wd as (select day, wallet, max(is_tok) as is_tok, max(is_nft) as is_nftfrom wgroup by 1, 2),res as (select day, 'all' as chain, sum(is_tok * is_nft) as overlap