Query editor
-- query 3 active vesting positionswith active_vesting_pos as (-- select only vesting position without abortselect vest.*from hmx_arbitrum.Vester_evt_LogVest vestleft join (select * from hmx_arbitrum.Vester_evt_LogAbort) abort on vest.owner = abort.owner and vest.itemIndex = abort.itemIndexwhere abort.owner is null),claim_history as (select owner, itemIndex, max(evt_block_time) as last_claimed ,sum(vestedAmount) as claimed from hmx_arbitrum.Vester_evt_LogClaimgroup by owner, itemIndex)-- pendingClaimAmount = (amount * (min(now, endTime) - min(endTime, coalesce(lastClaimTime, startTime)))) / 365 days-- vestingEsHmxBeforeClaim = amount - claimedAmount-- vestingEsHmxAfterClaim = amount - claimedAmount - pendingClaimAmount-- select sum(vestingEsHmxAfterClaim) / 1e18 fromselect evt_tx_hash, owner, itemIndex, amount, claimedAmount, pendingClaimedAmount, from_unixtime(startTime) as startTime, from_unixtime(endTime) as endTime,endTime - startTime as duration,amount - claimedAmount as vestingEsHmxBeforeClaim,amount - claimedAmount - pendingClaimedAmount as vestingEsHmxAfterClaimfrom(select evt_tx_hash, active_vesting_pos.owner, active_vesting_pos.itemIndex, amount, startTime, endTime,coalesce(claimed, 0) as claimedAmount,amount * ((least(to_unixtime(current_timestamp), endTime)) - least(endTime, to_unixtime(coalesce(last_claimed, from_unixtime(startTime))))) / (endTime - startTime) as pendingClaimedAmountfrom active_vesting_posleft join claim_history on active_vesting_pos.owner = claim_history.owner and active_vesting_pos.itemIndex = claim_history.itemIndex)-- order by endTime asc)