jkhuhnke11AAVE - Stagnant Voters
    Updated 2023-05-13
    WITH monthly_v AS (
    SELECT
    voter,
    max(vote_timestamp :: date) as date
    FROM ethereum.core.ez_snapshot
    WHERE space_id = 'aave.eth'
    GROUP BY voter, voting_power

    UNION

    SELECT
    voter,
    max(block_timestamp :: date) AS date
    FROM ethereum.aave.ez_votes
    GROUP BY voter, voting_power
    ),
    bals AS (
    SELECT
    v.voter,
    date,
    t.voting_power / POW(10, 18) + s.voting_power as vp
    FROM monthly_v v
    LEFT OUTER JOIN ethereum.aave.ez_votes t
    ON v.voter = t.voter
    AND v.date = t.block_timestamp :: date
    LEFT OUTER JOIN ethereum.core.ez_snapshot s
    ON v.voter = s.voter
    AND v.date = s.vote_timestamp :: date
    ),
    voted AS (
    SELECT
    sum(vp) AS vt
    FROM bals
    WHERE date > CURRENT_DATE - 30
    ),
    last_30 AS (
    Run a query to Download Data