maybeyonasnear_gas_weekly_top10
Updated 2022-07-25
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
›
⌄
with
tx_details as (
select
block_timestamp,
txn_hash,
tx_receiver,
tx_signer,
gas_used/pow(10,9) as giga_gas,
transaction_fee/pow(10,24) as tx_fee
from mdao_near.transactions
)
select * from (
select
last_day(block_timestamp,'week') as date,
tx_receiver as contract,
sum(giga_gas) as gas_total,
sum(tx_fee) as fee_total,
count(distinct txn_hash) as txs,
fee_total/txs as fee_per_tx,
rank() over(partition by date order by gas_total desc) as rank
-- count(distinct tx_signer) as users
from tx_details
group by 1,2
order by gas_total desc
)
where rank <= 10
and date >= '2022-04-01'
-- limit 10
Run a query to Download Data