Query editor
/* Migration success :)There are some cases such as unnest/sequence and array/json functions the migrator won't take care of for you(but we have examples of in the docs linked below!)If you're still running into issues, check out the doc examples https://dune.com/docs/reference/dune-v2/query-engine/or reach out to us in the Dune discord in the #dune-sql channel.*//* !Bytea parameter warning: Make sure to change \x to 0x in the parameters, bytea types are native now (no need for quotes or lower or \x)' */SELECTSUM(CAST(amount_usd AS DOUBLE)) AS total_volume,SUM(CAST(amount_usd AS DOUBLE)) FILTER (WHERE tx_from = {{Wallet Address}}) AS personal_volume,(SUM(CAST(amount_usd AS DOUBLE)) FILTER (WHERE tx_from = {{Wallet Address}})) / SUM(CAST(amount_usd AS DOUBLE)) * 100 AS volume_impactFROMdex."trades"WHERE(blockchain = 'ethereum'AND tx_to = 0x881d40237659c251811cec9c364ef91dc08d300c)OR(blockchain = 'polygon'and tx_to = 0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31)