Query editor
WITH trades as (SELECThash,block_time,frontend,trade_usd,token_pair,liquidity_src,pmm,amount_usdFROM dune.flashbots.result_overall_lq_alltimeWHERE frontend like '%Uniswap%'and DATE(block_time) > DATE('2023-10-15') -- date of fee switchand DATE(block_time) != DATE(now())and frontend in ('Uniswap Website: Uniswap X ON','Uniswap Website & Wallet: Default') -- look at trades from universal router and XAND DATE(block_time) <= DATE('2024-06-20')--AND DATE(block_time) > DATE(now()) - interval '180' day),total_swaps as (SELECThash,COUNT(*) as total_swaps,COUNT(DISTINCT(token_pair)) as unique_token_pairsFROM tradesGROUP BY hash),-- remove duplicates and determine multi hopstemp as (SELECTCASEWHEN total_swaps > 1 or unique_token_pairs > 1 THEN 'Multi Swap'WHEN total_swaps = 1 and unique_token_pairs = 1 THEN 'Single Swap'END as order_type,token_pair,unique_token_pairs,t.hash,trade_usd,amount_usd,frontend,block_timeFROM trades tLEFT JOIN total_swaps ts ON ts.hash = t.hashWHERE token_pair = 'USDC-WETH'GROUP BY 1,2,3,4,5,6,7,8),-- confirmed frontend transactions from the websitetransfers as (SELECTcontract_address,evt_tx_hash as tx_hashFROM erc20_ethereum.evt_TransferWHERE to in (0x37a8f295612602f2774d331e562be9e61B83a327, 0x6460D14DbAeb27AEfec8eBeF85dB35DefA31c3b9, 0x27213E28D7fDA5c57Fe9e5dD923818DBCcf71c47)AND "from"=0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FADUNION ALLSELECT0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 as conctract_address,