maybeyonasTerra Gas stats - Average and Median
Updated 2021-09-11
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 gas as(
select
block_timestamp,
tx_id,
fee[0]:amount as amt,
fee[0]:denom::string as denom,
gas_used,
gas_wanted
from terra.transactions
),
prices as(
select
date(block_timestamp) as t_hour,
currency,
avg(price_usd) as price_usd
from terra.oracle_prices
group by date(block_timestamp),currency
),
txs as(
select
block_timestamp,
tx_id,
amt,
denom,
gas_used,
gas_wanted,
price_usd,
amt*price_usd/pow(10,6) as tx_value
from gas g join prices p on g.denom=p.currency and date(block_timestamp) = t_hour
where amt is not null
),
final as(
select
block_timestamp,
tx_id,
gas_used,
Run a query to Download Data