Query editor
-- Column order here is important! Will be split up laterwith price_eth as (selectdate_trunc('day', timestamp) as day,pricefrom prices.daywhere blockchain = 'ethereum' and contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2and timestamp < current_dateand timestamp >= current_date - interval '{{days}}' day)SELECTblock_date AS day,"to" AS address,ROW(SUM((gas_used / POWER(10,18) * CAST(gas_price AS DOUBLE)) + l1_fee / POWER(10,18)), -- gas_fees_ethROUND(SUM((gas_used / POWER(10,18) * price * CAST(gas_price AS DOUBLE)) + l1_fee / POWER(10,18) * price),4), -- gas_fees_usdCOUNT(*), -- txcountCOUNT(DISTINCT "from"), -- daaSUM(CASE WHEN success THEN 1 ELSE 0 END) * 1.0 / COUNT(*), -- success_rateapprox_percentile((gas_used / POWER(10,18) * CAST(gas_price AS DOUBLE)) + l1_fee / POWER(10,18),0.5), -- median_tx_feeSUM(gas_used) -- gas_used) AS metricsFROM megaeth.transactions tleft join price_eth p on t.block_date = p.dayWHERE block_date < current_dateAND block_date >= current_date - interval '{{days}}' dayAND "to" IS NOT NULLAND "data" IS NOT NULLAND gas_price > 0GROUP BY 1,2--Having count(*) > 3