Query editor
withbinance_ethusdc as (selecttimestamp_sec,midprice_ratio as midpricefromdune.dune.dataset_binance_ethusdc_11_09_11_16),get_trades as (selecttx.hash,tx.block_time,to_unixtime(tx.block_time) as unix_time,tx.block_number,tx.index as tx_index,builder_label as blockbuilder,coalesce(bots.alias, 'Other') as bot,bots.address as bot_address,amount_usd,casewhen dt.project = 'uniswap'and dt.version = '2' then 'Uniswap V2'when dt.project = 'uniswap'and dt.version = '3' then 'Uniswap V3'else CONCAT(UPPER(SUBSTRING(dt.project, 1, 1)),SUBSTRING(dt.projectFROM2))end as liquidity_src,token_sold_symbol,token_bought_symbol,token_sold_amount,token_bought_amount,casewhen token_sold_symbol = 'USDC' then token_sold_amount / token_bought_amountwhen token_bought_symbol = 'USDC' then token_bought_amount / token_sold_amountend as dexprice,(tx.gas_price * tx.gas_used) / 1e18 as gas_fee_eth,blocks.minerfromethereum.transactions txleft join dex.trades dt on tx.hash = dt.tx_hashjoin query_2922979 AS bots ON tx."to" = bots.addressleft join query_3184477 builderlabel on tx.block_number = builderlabel.blocknumberleft join ethereum.blocks blocks on tx.block_number = blocks."number"whereto_unixtime(tx.block_time) >= 1699488001and to_unixtime(tx.block_time) <= 1700092799and (token_pair = 'ETH-USDC'or token_pair = 'USDC-WETH')and dt.project != '0x API' -- 0x API logs PMM trades in dex.trades),markouts as (select