MLDZMNNCU3
Updated 2023-03-23Copy Reference Fork
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 t1 as (select
distinct b.TX_RECEIVER as contract_name,
min(b.block_timestamp) as first_appear
FROM near.core.fact_actions_events_function_call a
INNER JOIN near.core.fact_transactions b
ON a.TX_HASH = b.TX_HASH
INNER JOIN near.core.fact_receipts as c
ON a.TX_HASH=c.TX_HASH
WHERE ACTION_NAME = 'FunctionCall'
AND METHOD_NAME <> 'new'
group by 1 having first_appear>='2022-12-01'
)
select
distinct b.TX_RECEIVER as contract,
sum(TRANSACTION_FEE/pow(10,24)) as GAS,
count(b.TX_HASH) as no_txn,
avg(TRANSACTION_FEE/pow(10,24)) as averag_gas
FROM near.core.fact_actions_events_function_call a
INNER JOIN near.core.fact_transactions b
ON a.TX_HASH = b.TX_HASH
INNER JOIN near.core.fact_receipts as c
ON a.TX_HASH=c.TX_HASH
WHERE ACTION_NAME = 'FunctionCall'
AND METHOD_NAME <> 'new' and b.BLOCK_TIMESTAMP>='2022-12-01'
and contract in (select contract_name from t1)
group by 1
order by 3 desc
limit 10
Run a query to Download Data