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 / 1e9 AS gas_price,gas_used,(gas_price * gas_used) / 1e18 AS eth_paid_for_tx,hashFROM ethereum.transactionsWHERE/* "from" = CONCAT('\x', substring('{{1. Wallet}}' from 3)) */"from" = {{1. Wallet}}AND block_time >= CAST('{{2. Start Date}}' AS timestamp)AND block_time < CAST('{{3. End Date}}' AS timestamp))SELECTDATE_TRUNC('minute', block_time),hash,eth_paid_for_tx AS "Spent ETH",price,(eth_paid_for_tx * price) AS "Spent USD",SUM(eth_paid_for_tx * price) OVER (ORDER BY DATE_TRUNC('minute', block_time)) AS "Total Gas Fees Paid in USD",SUM(eth_paid_for_tx) OVER (ORDER BY DATE_TRUNC('minute', block_time)) AS "Total Gas Fees Paid in ETH"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 FIRST