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.*/WITHgetLockAmountAndPeriod AS (SELECT"evt_block_time","provider","tokenId",locktime,from_unixtime(CAST(locktime AS BIGINT)) AS "unlock_period","ts",CAST(value AS DOUBLE) / 1e18 AS "maha_locked","evt_tx_hash"FROMmahadao_ethereum.MAHAXLocker_evt_Deposit)SELECT * FROM (SELECT"evt_block_time",provider,"tokenId",locktime,"maha_locked",unlock_period - CAST(NOW() AS TIMESTAMP) AS "days_to_unlock","unlock_period","evt_tx_hash"FROM getLockAmountAndPeriod) xORDER BY 1 DESC-- WHERE from_unixtime(CAST(locktime AS BIGINT)) > current_timestamp