Query editor
WITH Fees AS (SELECTdate_trunc('day', block_time) AS transaction_day,SUM((gas_used / 1e9) * (CASEWHEN (effective_gas_price / 1e9) < 0.1 THEN 0.1 -- Apply the hypothetical 0.1 minimumELSE (effective_gas_price / 1e9) -- Use actual base fee when it's higherEND)) AS estimated_fees_eth, -- Calculate estimated fees if minimum base fee were adjustedSUM((gas_used / 1e9) * (effective_gas_price / 1e9)) AS actual_fees_eth, -- Calculate actual fees paidSUM((gas_used / 1e9) * (CASEWHEN (effective_gas_price / 1e9) < 0.05 THEN 0.05 -- Apply the hypothetical 0.05 minimumELSE (effective_gas_price / 1e9) -- Use actual base fee when it's higherEND)) AS estimated_fees_eth2, -- Calculate estimated fees if minimum base fee were adjusted to 0.05SUM((gas_used / 1e9) * (CASEWHEN (effective_gas_price / 1e9) < 0.02 THEN 0.02 -- Apply the hypothetical 0.05 minimumELSE (effective_gas_price / 1e9) -- Use actual base fee when it's higherEND)) AS estimated_fees_eth3 -- Calculate estimated fees if minimum base fee were adjusted to 0.05FROMarbitrum.transactionsWHEREblock_time >= now() - interval '6' month -- Limit data to the last monthGROUP BYdate_trunc('day', block_time) -- Ensure the group by uses the and alias)-- Select the final output using the correct aliasSELECTtransaction_day AS day,actual_fees_eth AS "Actual Revenue",estimated_fees_eth3 AS "Estimated Revenue at 0.02",estimated_fees_eth2 AS "Estimated Revenue at 0.05",estimated_fees_eth AS "Estimate Revenue at 0.1"FROMFeesORDER BYtransaction_day;