Query editor
with-- Undelegations of ARB that transforms into idle ARB (not delegated)undelegations_pure as (SELECTa.evt_tx_hash,a.evt_block_time,a.evt_index,b.evt_index as index2,b.to as delegator,a.delegate,b."from",b.to,cast(a.newBalance as double) / 1e18 as newBalance,cast(a.previousBalance as double) / 1e18 as previousBalance,cast(b.value as double) / 1e18 as valueFROMarbitrum_arbitrum.L2ArbitrumToken_evt_DelegateVotesChanged aINNER JOIN arbitrum_arbitrum.L2ArbitrumToken_evt_Transfer b ON a.evt_tx_hash = b.evt_tx_hashAND a.delegate = b."from"AND a.evt_index = (b.evt_index + 1)),undelegations_delegate_changed as (SELECT*,abs(newBalance - previousBalance) as balanceChangeFROM(SELECTa.evt_tx_hash,a.evt_index,b.evt_index as index2,a.evt_block_time,a.delegator,a.fromDelegate,a.toDelegate,b.delegate,cast(b.newBalance as double) / 1e18 as newBalance,cast(b.previousBalance as double) / 1e18 as previousBalanceFROMarbitrum_arbitrum.L2ArbitrumToken_evt_DelegateChanged aINNER JOIN arbitrum_arbitrum.L2ArbitrumToken_evt_DelegateVotesChanged b ON a.evt_tx_hash = b.evt_tx_hashAND a.fromDelegate = b.delegateAND a.evt_index = (b.evt_index - 1))),delegations_previously_idle as (SELECTa.evt_tx_hash,a.evt_block_time,a.evt_index,b.evt_index as index2,b."from" as delegator,a.delegate,b."from",b.to,cast(a.newBalance as double) / 1e18 as newBalance,cast(a.previousBalance as double) / 1e18 as previousBalance,cast(b.value as double) / 1e18 as valueFROMarbitrum_arbitrum.L2ArbitrumToken_evt_DelegateVotesChanged a