Query editor
-- ============================================================-- Card x Swap Overlap — using Picnic dataset as the bridge-- ============================================================WITHcard_users AS (SELECT pay_wallet, owner, activation_timeFROM query_3707804),picnic AS (SELECT DISTINCT address, blockchainFROM dune.safe.dataset_safe_picnic_data),-- Card wallets that are also in Picnic dataset (known Picnic users)card_picnic_users AS (SELECT DISTINCT c.pay_wallet, c.ownerFROM card_users cINNER JOIN picnic p ON c.pay_wallet = p.address),-- All Picnic wallets that did DEX trades (any chain, any wallet)picnic_dex_wallets AS (SELECT DISTINCTp.address,p.blockchainFROM picnic pINNER JOIN dex.trades tON t.taker = p.addressAND t.blockchain = p.blockchainAND t.block_time >= DATE '2024-01-01'WHERE p.blockchain IN ('gnosis','polygon','ethereum','arbitrum','base','bnb','optimism','avalanche_c')),-- Also check via tx_hash join (ERC4337 trades show up differently)picnic_dex_via_tx AS (SELECT DISTINCT p.addressFROM picnic pINNER JOIN safe.transactions_all stON st.address = p.addressAND st.blockchain = p.blockchainINNER JOIN dex.trades tON t.tx_hash = st.tx_hashAND t.blockchain = st.blockchainWHERE t.block_time >= DATE '2024-01-01'AND p.blockchain IN ('gnosis','polygon','ethereum','arbitrum','base','bnb','optimism','avalanche_c')),-- Combine both methodsall_swap_wallets AS (SELECT address FROM picnic_dex_walletsUNIONSELECT address FROM picnic_dex_via_tx),-- Card users who also swapped (via any of their Picnic wallets)-- Match via owner: card user's owner = picnic wallet ownercard_owners_who_swap AS (SELECT DISTINCT cu.pay_wallet, cu.ownerFROM card_users cu