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.*/WITHethOut AS (SELECT(SUM(CAST(value AS DOUBLE)) / 1e18) AS amountFROMethereum.tracesWHERE("from" = 0xEB9baEDB8e7D0875aF990368a6A82aDfd199F6f3AND CAST(value AS DOUBLE) > 0AND "call_type" = 'call')AND "success" = TRUE),ethAmount AS (SELECT((SUM(CAST(value AS DOUBLE)) / 1e18) - (SELECTCAST(amount AS DOUBLE)FROMethOut)) * (SELECTpriceFROMprices."usd"WHEREblockchain = 'ethereum'AND symbol = 'WETH'ORDER BYminute DESC NULLS FIRSTLIMIT1) AS valueFROMethereum.tracesWHERE("to" = 0xEB9baEDB8e7D0875aF990368a6A82aDfd199F6f3)AND "success" = TRUE),usdAmount AS (SELECTSUM(CAST(value AS DOUBLE)) / 1e6 AS valueFROMcircle_ethereum.USDC_evt_Transfer AS cetWHEREcet.to = 0xeb9baedb8e7d0875af990368a6a82adfd199f6f3),