Query editor
with locked as (select sum(amount) as total_staked from (select sum("_lockedAmount")/1e18 as amount from convex."CvxLockerV2_evt_Staked"-- where contract_address = '\xd18140b4b819b895a3dba5442f959fa44994af50'union allselect -sum("_amount")/1e18 as amount from convex."CvxLockerV2_evt_Withdrawn"-- where contract_address = '\xd18140b4b819b895a3dba5442f959fa44994af50')a), temp as (select value / 1e18 vecrvfrom curvefi."voting_escrow_evt_Deposit"where provider='\x989aeb4d175e16225e39e87d0d97a3360524ad80'union allselect -(value / 1e18) vecrvfrom curvefi."voting_escrow_evt_Withdraw"where provider='\x989aeb4d175e16225e39e87d0d97a3360524ad80')select (select sum(vecrv) as vecrv from temp)/total_staked--(select sum(vecrv) as vecrv from temp),--total_stakedas vecrv_cvx from locked