alitaslimiFees 180 Over Time
    Updated 2023-03-22
    WITH
    prices AS (
    SELECT
    hour::date AS day,
    AVG(price) AS price
    FROM
    ethereum.core.fact_hourly_token_prices
    WHERE
    symbol = 'WETH'
    GROUP BY
    day
    ),
    votes AS (
    SELECT
    votes.block_timestamp,
    votes.proposal_id,
    votes.support,
    votes.voting_power / POW(10, 18) AS voting_power,
    votes.voter,
    votes.tx_hash,
    transactions.tx_fee,
    transactions.tx_fee * prices.price AS tx_fee_usd,
    transactions.gas_used
    FROM
    ethereum.aave.ez_votes votes
    JOIN ethereum.core.fact_transactions transactions ON votes.tx_hash = transactions.tx_hash
    JOIN prices ON votes.block_timestamp::date = prices.day
    WHERE
    votes.block_timestamp::date >= CURRENT_DATE - 180
    )
    SELECT
    DATE_TRUNC(week, block_timestamp) AS "Date",
    COUNT(DISTINCT proposal_id) AS "Proposals",
    COUNT(DISTINCT tx_hash) AS "Votes",
    COUNT(DISTINCT voter) AS "Voters",
    SUM(voting_power) AS "Voting Power",
    Run a query to Download Data