Query editor
/* Delegate changes after claiming: THOSE WHO LOST VOTING POWERtable1 with delegator, to whom they delegated prior, that person's VP previous balancetable2 with delegator, to whom they delegated now, that person's VP previous balance, current balance, Changes in VPtable3: delegator, previos delegate, prior delegate VP, change in VP, current delegate, current delagate VP, changes in VP*/withdelegateevent as (selectevt_block_time, evt_index-- , delegator, evt_tx_from -- same as delegator, evt_tx_hash, fromDelegate --old supported delegate, toDelegate -- new supported delegate, casewhen fromDelegate = 0x0000000000000000000000000000000000000000 then 'noPriorDelegation'else 'priorDelegation' end as delegationfrom op_optimism.GovernanceToken_evt_DelegateChangedwhere evt_block_date > cast('2024-02-20' as timestamp) -- limit for after airdrop 4and evt_tx_from in (select address from dune.oplabspbc.dataset_op_airdrop_4_addresses_detailed_list)-- and evt_tx_hash = 0x72d5bac931a0b49f98b92af014dd72b6ad645d55e5017009fe3c2ff67e3e7cf2), OPpriordelegated as(select e.evt_block_time, e.evt_index as eindex, v.evt_index as vindex, e.evt_tx_hash, e.evt_tx_from as delegator-- delegator or sender of OP governance token, e.fromDelegate as priorDelegate -- delegator or sender of OP governance token-- , e.toDelegate, v.delegate as delegate_vp_changes -- delegator whose votingPower balance changes, round(v.previousBalance/pow(10,18),2) as previousBalance, round(v.newBalance/pow(10,18),2) as newBalance, round((v.newBalance/pow(10,18) - v.previousBalance/pow(10,18)),2) as VotePowerChange, e.delegationfrom delegateevent ejoin op_optimism.GovernanceToken_evt_DelegateVotesChanged von e.evt_tx_hash = v.evt_tx_hashand e.fromDelegate = v.delegate--AND e.evt_index = v.evt_indexwhere evt_tx_to = 0x4200000000000000000000000000000000000042 -- filtering to make sure only OP tokens are included-- and (previousBalance > newBalance -- only those who lost VPorder by evt_block_time asc , e.evt_index asc)select *, round(VotePowerChange/previousBalance*(-100),2) as perc_changefrom OPpriordelegated