Query editor
-- DUNE Query to fetch the Proportion of Total Gas Paid on different DEX projects within 1 day--> Enables understanding of which DEXs are currently most active or in-demand.--> Can give DeFi projects insights into potential partnerships or competitive analysis.-- Begin the SELECT statementSELECT-- Select the DEX project names from the dex.trades datasetdex.trades.project,-- Calculate the total gas paid for each DEX, converting gas_price from wei to ETH and rounding the result to 2 decimalsROUND(SUM(ethereum.transactions.gas_used * (ethereum.transactions.gas_price / 1e18)),2) AS gas_paid-- Specify the primary dataset for the queryFROM dex.trades-- Perform a LEFT JOIN to combine data from dex.trades and ethereum.transactions based on their respective transaction hashesLEFT JOIN ethereum.transactionsON dex.trades.tx_hash = ethereum.transactions.hash-- Include a condition to only select transactions from the last dayWHEREethereum.transactions.block_time >= NOW() - INTERVAL '1' DAY-- Group the results by DEX project name to get aggregated data for each DEX projectGROUP BYdex.trades.project-- Sort the results by gas_paid in descending order to see the DEX projects with the highest gas consumption firstORDER BYgas_paid DESC