Uniswap Voting Behavior
Analysis of Voting Behavior In Uniswap
Introduction
UNI tokens have a deeper power as a voting mechanism. In order for UNI to be used as a vote, the owner must first go through the delegation process. Delegating UNI binds the voting power of tokens to an address so it may be used to vote. This address could be yourself, or a trusted party who you believe will vote in the best interest of Uniswap Governance.
Under the hood, voting power is an unsigned 256bit integer that is transferred from the delegator to delegatee, and the new voting power of the delegatee (now delegate) is recorded. UNI delegation function is deployed at 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
and emits events when delegation is successful.
Methodology
- Delegations are captured by the
ethereum.events_emitted
table.events_emitted
provides two event types related to vote delegation. These are "DelegateChanged" and "DelegateVotesChanged". - To track voting power across delegates, we query
DelegateVotesChanged
events. - From the event input, we can get the delegate's address and the updated voting power.
- Next, we take the maximum voting power value associated with each address using the MAX() function.
- The result is ordered in descending order and limited to 5. This is to get the top 5 addresses with the largest voting power.
This is how our final query and result table looks like.
SELECT event_inputs:delegate::string AS delegate, MAX(ABS(event_inputs:newBalance)) AS voting_power
FROM ethereum.events_emitted
WHERE contract_address='0x1f9840a85d5af5bf1d1762f925bdaddc4201f984' AND event_name = 'DelegateVotesChanged'
GROUP BY 1
ORDER BY 2 DESC
LIMIT 5