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.*/WITHApecoin AS (SELECTSUM(CAST(amount AS DOUBLE)) AS ApecoinFROM(SELECTSUM(CAST(amount AS DOUBLE) / 10e17) AS amountFROMapecoin_ethereum.ApeCoinStaking_evt_DepositUNIONSELECT- SUM(CAST(amount AS DOUBLE) / 10e17) AS amountFROMapecoin_ethereum.ApeCoinStaking_evt_Withdraw)),BAYC AS (SELECTSUM(CAST(amount AS DOUBLE)) AS BAYCFROM(SELECTSUM(CAST(amount AS DOUBLE) / 10e17) AS amountFROMapecoin_ethereum.ApeCoinStaking_evt_DepositNftWHEREpoolid = 1UNIONSELECT- SUM(CAST(amount AS DOUBLE) / 10e17) AS amountFROMapecoin_ethereum.ApeCoinStaking_evt_WithdrawNftWHEREpoolid = 1)),MAYC AS (SELECTSUM(CAST(amount AS DOUBLE)) AS MAYCFROM(SELECTSUM(CAST(amount AS DOUBLE) / 10e17) AS amountFROMapecoin_ethereum.ApeCoinStaking_evt_DepositNftWHEREpoolid = 2UNIONSELECT- SUM(CAST(amount AS DOUBLE) / 10e17) AS amountFROM