Query editor
/* Success! If you're still running into issues, check out https://dune.com/docs/query/syntax-differences/ or reach out in the #dune-sql Discord channel. */WITH alltransactions AS (SELECTblock_time,success,gas_price / POWER(10, 9) AS gas_prices,gas_used,(gas_price * gas_used) / POWER(10, 18) AS eth_paid_for_tx,hashFROM ethereum.transactionsWHERE"from" = TRY_CAST(CONCAT(0x, SUBSTRING('{{1. Eth Address}}', 3)) AS VARBINARY)AND block_time >= CAST('{{2. Start Date}}' AS TIMESTAMP))SELECTDATE_TRUNC('minute', block_time),SUM(eth_paid_for_tx * price) OVER (ORDER BY DATE_TRUNC('minute', block_time)) AS "Total Gas Fees Paid in USD"FROM alltransactionsLEFT JOIN (SELECTminute,priceFROM prices.usdWHEREblockchain = 'ethereum'AND symbol = 'WETH'AND minute > CAST('{{2. Start Date}}' AS TIMESTAMP)) AS pricesON DATE_TRUNC('minute', block_time) = minuteORDER BYblock_time DESC NULLS FIRSTLIMIT 10