FatemeTheLady01 Aave 180 days -changes
    Updated 2023-03-22
    with tbl1 as
    (
    select
    v.block_timestamp,
    v.tx_hash,
    v.voter,
    t.tx_fee
    from
    ethereum.aave.ez_votes as v
    left join
    ethereum.core.fact_transactions as t
    on v.tx_hash = t.tx_hash
    where
    v.block_timestamp::date < current_date
    and v.block_timestamp::date >= current_date - 180
    order by
    1 desc
    )
    ,
    tbl2 as
    (
    select
    date_trunc('hour', hour) as hour,
    avg(price) as price
    from
    ethereum.core.fact_hourly_token_prices
    where
    symbol like 'WETH'
    group by
    1
    )
    select
    -- date_trunc('day', tbl1.block_timestamp) as "date",
    case when date_trunc('day', tbl1.block_timestamp)>=( current_date - 90 ) then 'second 90 days' else 'first 90 days' end as label,
    count(distinct tx_hash) as "votes",
    count(distinct voter) as "voters",
    Run a query to Download Data