alitaslimiHolders Overview
    Updated 2023-03-10
    WITH
    votes AS (
    SELECT
    proposal_id,
    COUNT(DISTINCT voter) AS voters,
    SUM(voting_power) / POW(10, 18) AS voting_power,
    AVG(voting_power) / POW(10, 18) AS average_voting_power
    FROM
    ethereum.aave.ez_votes
    GROUP BY
    proposal_id
    ),
    holders AS (
    SELECT
    proposal_id,
    COUNT(DISTINCT user_address) AS holders,
    SUM(current_bal) AS balance,
    AVG(current_bal) AS average_balance
    FROM
    ethereum.core.ez_current_balances balances
    JOIN ethereum.aave.ez_proposals proposals ON balances.last_activity_block <= proposals.end_voting_period
    WHERE
    balances.contract_address IN ('0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9', '0x4da27a545c0c5b758a6ba100e3a049001de870f5')
    GROUP BY
    proposal_id
    )
    SELECT
    TO_NUMBER(votes.proposal_id) AS "Proposal",
    holders AS "Holders",
    voters AS "Voters",
    "Voters" / "Holders" * 100 AS "Participation Rate",
    balance AS "Balance",
    voting_power AS "Voting Power",
    "Voting Power" / "Balance" * 100 AS "Relative Power Share",
    "Voting Power" / 16000000 * 100 AS "Absolute Power Share",
    average_balance AS "Average Balance",
    Run a query to Download Data