Abbas_ra21Aave Delegates Votes 2
    Updated 2023-03-22
    -- forked from 0cb1ae19-ae95-40df-9f8c-c1dd8d3f7ca3

    with
    tb AS (
    select
    TX_HASH
    from
    ethereum.aave.ez_votes
    )
    select
    'Last 180 Days' AS Period,
    sum(TX_FEE) AS "Generated Fee (ETH)",
    Avg(TX_FEE) AS "Average Generated Fee (ETH)",
    sum(GAS_USED/1e9) AS "Used GAS",
    Avg(GAS_USED/1e9) AS "Average Used GAS",
    avg(GAS_PRICE) AS "Average Gas Price (Gwei)"
    from
    ethereum.core.fact_transactions
    where
    TX_HASH in (
    Select
    TX_HASH
    from
    tb
    ) and BLOCK_TIMESTAMP >= dateadd('Day',-180,current_Date)
    group by
    1
    UNION ALL
    select
    'Last 90 Days' AS Period,
    sum(TX_FEE) AS "Generated Fee (ETH)",
    Avg(TX_FEE) AS "Average Generated Fee (ETH)",
    sum(GAS_USED/1e9) AS "Used GAS",
    Avg(GAS_USED/1e9) AS "Average Used GAS",
    avg(GAS_PRICE) AS "Average Gas Price (Gwei)"
    from
    Run a query to Download Data