Afonso_Diazaave-4
Updated 2023-03-22
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
›
⌄
with t as (
select
hour::date as date,
median(price) as price_usd
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
group by 1
)
select
proposal_id,
count(distinct tx_hash) as votes,
count(distinct from_address) as voters,
sum(tx_fee) as fee_eth,
sum(tx_fee * price_usd) as fee_usd,
avg(tx_fee) as average_fee_eth,
avg(tx_fee * price_usd) as average_fee_usd,
avg(gas_used) as average_gas_used_gwei
from ethereum.core.fact_transactions
join ethereum.aave.ez_votes
using(tx_hash)
left outer join t
on block_timestamp::date = date
where block_timestamp > current_date - interval '{{ months }} months'
group by 1
order by fee_eth desc
limit 10
Run a query to Download Data