maybeyonassushi_uni_gas
Updated 2022-01-29
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
32
33
34
35
36
›
⌄
with
swaps as (
select distinct
tx_id,
platform
from ethereum.dex_swaps
where platform in (
'sushiswap',
'uniswap-v3',
'uniswap-v2'
)
),
gas as (
select
block_timestamp,
t.tx_id,
platform,
gas_limit,
gas_price,
gas_used,
tx_fee,
fee_usd
from ethereum.transactions t join swaps s on s.tx_id=t.tx_id
)
select
date(block_timestamp) date,
platform,
count(tx_id) as swaps,
avg(gas_price/pow(10,9)) as avg_gwei,
sum(gas_used) as gas_used,
sum(tx_fee) as tx_fees,
avg(tx_fee) as avg_tx_fee
from gas
where date(block_timestamp) >= current_date - interval '60 days'
group by 1,2
Run a query to Download Data