DataShogun1. delegators and delegatees
Updated 2023-03-22
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
WITH
delegator_delegatee_table AS (
SELECT
-- DISTINCT EVENT_NAME
DATE_TRUNC('day', BLOCK_TIMESTAMP)::date as DATE,
TX_HASH,
DECODED_LOG:delegator as DELEGATOR,
DECODED_LOG:delegatee as DELEGATEE,
CASE
WHEN DECODED_LOG:delegationType::float = 0 THEN 'Vote'
WHEN DECODED_LOG:delegationType::float = 1 THEN 'Proposition'
END AS delegationType,
CASE
WHEN CONTRACT_ADDRESS = '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9' THEN 'stkAAVE'
WHEN CONTRACT_ADDRESS = '0x4da27a545c0c5b758a6ba100e3a049001de870f5' THEN 'AAVE'
END AS TOKEN
FROM
ethereum.core.fact_decoded_event_logs
WHERE
CONTRACT_ADDRESS IN (
'0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9',
'0x4da27a545c0c5b758a6ba100e3a049001de870f5'
)
AND EVENT_NAME = 'DelegateChanged'
ORDER BY
DATE
),
delegatees_votes_transactions AS (
SELECT
DISTINCT
DATE_TRUNC('day', votes_t.BLOCK_TIMESTAMP)::date as DATE,
votes_t.GOVERNANCE_CONTRACT,
votes_t.PROPOSAL_ID,
votes_t.SUPPORT,
votes_t.VOTING_POWER,
votes_t.VOTER AS VOTER_DELEGATEE,
Run a query to Download Data