ArioGas Guzzlers - OP - 1
Updated 2022-11-16
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 ETH_price as (
select
HOUR::date as date,
avg(PRICE) as ETH_price
from ethereum.core.fact_hourly_token_prices
where 1=1
and symbol = 'WETH'
and hour >= CURRENT_DATE - 30
group by 1
order by date ASC
),
OP_Price as (
select
HOUR::date as date,
avg(PRICE) as OP_price
from optimism.core.fact_hourly_token_prices
where SYMBOL = 'OP'
and HOUR >= CURRENT_DATE - 30
group by 1
),
gas as (
select
BLOCK_TIMESTAMP::date as date,
tx_hash,
TX_FEE * ETH_price as Gas_USD
from optimism.core.fact_transactions a join ETH_price b on a.BLOCK_TIMESTAMP::date = b.date
where 1=1
and STATUS = 'SUCCESS'
and BLOCK_TIMESTAMP >= CURRENT_DATE - 30
and BLOCK_TIMESTAMP < CURRENT_DATE
and TX_FEE is not null
)
select
a.date,
count(distinct tx_hash) as "# TXs",
sum(Gas_USD) as "Gas Amount-USD",
Run a query to Download Data