Query editor
with data as(selectDATE_TRUNC('day', t.block_time) AS time_,SUM(t.gas_used * t.gas_price / 1e18) AS total_gas_fee_eth,SUM(t.l1_fee / 1e18) AS total_l1_fee_eth,SUM(t.gas_used * t.gas_price / 1e18 * p.price) as total_gas_fee_usd,SUM(t.l1_fee / 1e18 * p.price) as total_l1_fee_usd,ROUND(SUM(t.gas_used * t.gas_price / 1e18 * p.price) + SUM(t.l1_fee / 1e18 * p.price)) as revenue,ROUND(SUM(t.gas_used * t.gas_price / 1e18 * p.price)) as profitfrom base.transactions tleft join prices.usd pon DATE_TRUNC('minute', t.block_time) = p.minuteand p.contract_address = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2where date_trunc('day', block_time) > cast('2023-07-12' as date)group by 1order by 1 desc)select time_,revenue,profit,sum(revenue) over(order by time_) as "total revenue",sum(profit) over(order by time_) as "total profit"from datagroup by 1, 2, 3limit 1000