Query editor
SELECT SUM(mahaxvp) as total_mahaxvp FROM (SELECT *,maha_locked / (4 / duration_in_year) as mahaxvpFROM (select evt_block_time,CAST(value as DOUBLE)/POW(10,18) as maha_locked,(CAST(locktime AS DOUBLE) - to_unixtime(evt_block_time))/31536000 as duration_in_year,ROW_NUMBER() OVER (PARTITION BY tokenId ORDER BY evt_block_time,evt_index DESC) as rn,locktimefrom mahadao_ethereum.MAHAXLocker_evt_DepositWHERE CAST(tokenId AS BIGINT) != 586) qWHERE rn = 1) pWHERE from_unixtime(CAST(locktime AS BIGINT)) > current_timestamp-- select *,CAST(value AS DOUBLE)/1e18 from mahadao_ethereum.MAHAXLocker_evt_Withdraw