Query editor
-- Monthly aggregate: gas fees + MEV coinbase tips for Euler v2 liquidations on Ethereum,-- joined with monthly-average Euler Ethereum protocol liquidity.-- total_paid = base_fee + priority_fee + coinbase_tip-- coinbase_tip = sum of internal trace ETH value sent to block.miner inside the tx-- Liquidity = SUM(supplied_amount_cumulative_usd) per day across vaults,-- excluding rows >$5B (broken-oracle filter).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.gas_used,tx.gas_price,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)),coinbase_payments AS (SELECTtr.tx_hash,SUM(CAST(tr.value AS double)) / 1e18 AS coinbase_payment_ethFROM ethereum.traces trJOIN tx_with_base 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 (SELECTDATE_TRUNC('hour', minute) AS hr,AVG(price) AS eth_usdFROM prices.usdWHERE blockchain = 'ethereum'AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2AND minute >= TIMESTAMP '2024-03-01 00:00'GROUP BY 1),tx_fees_usd AS (SELECTz.block_time,