Yousefi_1994Compare ETH daily price with Gas used in Sushiswap transactions
Updated 2022-06-08
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
28
29
30
31
›
⌄
with sushiswap_gas_used as (
select swaps.block_timestamp::date as days,
sum(transactions.gas_used) as gas_used_amount,
sum(transactions.gas_used/1e9) as gas_used_ether_amount
from ethereum.core.ez_dex_swaps swaps
join ethereum.core.fact_transactions transactions using(tx_hash)
where swaps.platform = 'sushiswap'
and swaps.block_timestamp::date >= '2022-01-01'
group by days
order by days
),
eth_price as (
select
hour::date as days,
avg(price) as eth_price
from ethereum.core.fact_hourly_token_prices
where token_address is null
and symbol is null
and hour(hour) = 0
and hour::date >= '2022-01-01'
group by days
order by days
)
select
sushiswap_gas_used.days as days,
sushiswap_gas_used.gas_used_amount as gas_used_amount,
sushiswap_gas_used.gas_used_ether_amount,
eth_price.eth_price as eth_price
from sushiswap_gas_used
left join eth_price using(days)
Run a query to Download Data