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.*/-- WITH-- total_cvx AS (-- SELECT DISTINCT-- day,-- total_staked,-- SUM(total_staked) OVER (-- ORDER BY-- day-- ) AS cum_from-- FROM-- (-- SELECT-- DATE_TRUNC('day', evt_block_time) AS day,-- SUM(CAST(value AS DOUBLE) / 1e18) AS total_staked-- FROM-- erc20_ethereum.evt_Transfer AS t-- WHERE-- contract_address = 0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b-- AND t."from" = 0x0000000000000000000000000000000000000000-- GROUP BY-- 1-- ) AS t-- ),-- total_cvx_staked AS (-- SELECT DISTINCT-- day,-- SUM(total_staked) OVER (-- ORDER BY-- day-- ) AS cum_from-- FROM-- (-- SELECT-- (-- SUM(-- CASE-- WHEN "to" = '0xCF50b810E57Ac33B91dCF525C6ddd9881B139332' THEN CAST(value AS DOUBLE)-- ELSE 0-- END-- ) - SUM(-- CASE-- WHEN "from" = '0xCF50b810E57Ac33B91dCF525C6ddd9881B139332' THEN CAST(value AS DOUBLE)-- ELSE 0-- END-- )-- ) / 1000000000000000000 AS TOTAL_STAKED,-- DATE_TRUNC('day', evt_block_time) AS day-- FROM-- erc20_ethereum.evt_Transfer-- WHERE-- contract_address = '0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B'-- AND (