Query editor
-- For Euler v2 liquidations on Ethereum where the EFFECTIVE priority fee per gas-- was 0 (gas_price = block.base_fee_per_gas), surface:-- * tx_index in block (0 = first; private-bundle MEV signal)-- * total ETH paid to block.miner via internal traces during the tx-- (the standard coinbase-tip MEV channel)---- Total payment to validator beyond base fee = 0 priority + coinbase tip.WITH liq_hashes AS (SELECT DISTINCT from_hex(tx_hash) AS tx_hashFROM dune.pibbles.euler_liquidationsWHERE blockchain = 'ethereum'),tx_with_base AS (SELECTtx.block_time, tx.block_number, tx.hash AS tx_hash, tx.index AS tx_index,tx.gas_used, tx.gas_price, tx."from" AS tx_from, tx."to" AS tx_to,b.base_fee_per_gas, b.minerFROM ethereum.transactions txJOIN ethereum.blocks bON b.date >= DATE '2024-03-01'AND b.number = tx.block_numberWHERE tx.block_date >= DATE '2024-03-01'AND tx.successAND tx.hash IN (SELECT tx_hash FROM liq_hashes)),zero_priority_tx AS (SELECT *FROM tx_with_baseWHERE gas_price - base_fee_per_gas = 0),block_tx_count AS (SELECT block_number, COUNT(*) AS tx_count_in_blockFROM ethereum.transactionsWHERE block_date >= DATE '2024-03-01'AND block_number IN (SELECT block_number FROM zero_priority_tx)GROUP BY 1),coinbase_payments AS (SELECT tr.tx_hash, SUM(CAST(tr.value AS double)) / 1e18 AS coinbase_payment_ethFROM ethereum.traces trJOIN zero_priority_tx zON z.block_number = tr.block_numberAND z.tx_hash = tr.tx_hashWHERE tr.block_date >= DATE '2024-03-01'AND tr.tx_success AND tr.successAND tr."to" = z.minerAND tr.value > UINT256 '0'GROUP BY 1),eth_price_hr AS (SELECT DATE_TRUNC('hour', minute) AS hr, AVG(price) AS eth_usdFROM prices.usdWHERE blockchain = 'ethereum'AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2