NEAR Gas Guzzlers
Question:
What contracts are users spending the most gas on to use? How has this changed over the past week? Past month?
Overview of essay:
To perform any transaction or operation on the NEAR, we have to pay a fee using NEAR token. On the other hand, unlike Bitcoin, whose use is limited to money and financial transactions, in NEAR we can build decentralized applications using smart contracts. ==However, the code of applications implemented on NEAR are not the same, and it can be harder or easier for the network to implement one operation than another operation.== Therefore, we need a solution with which we can determine the required amount of processing and, as a result, the fee of each operation in relation to its difficulty or ease. ==This solution is a unit called gas (fuel).==
This essay seeks to find the contracts on NEAR that used more gas and find the movement of this gas use over time.
Approach:
-
First we should clarify the contracts by
distinct TX_RECEIVER as contract
-
The next step is calculating gas for these contracts
sum(GAS_USED/pow(10,12)) as GAS, --To adjust accordingly, divide by 10^12
avg(GAS_USED/pow(10,12)) as averag_gas
from near.core.fact_transactions
-
Finally order the contracts by gas use
order by GAS desc
-
Execute study over time by
BLOCK_TIMESTAMP::date as day
Total and average paid gas:
Three main tools have been adopted to study the contracts: Gas use, Average gas and number of transactions.
- By the use of used gas, the Aurora takes the lead among contracts on NEAR.
- Due to the count of transactions, the competition between Aurora and app.nearcrowd got heated and the share of them are very close together.
- The highest contract in Average gas use is nft.nearapps contract.
Paid gas over time:
The study of gas used by contracts over time reveals:
- The gas used by Aurora reduced after July 21 but among top contracts the v2.ref.finance experience enhancing in gas used.
- Other contracts have consistent movement in gas used aspect.
- In the monthly basis, the place of Aurora and app.nearcrowd did not changed and they kept the first two places.
- The rank of other top contracts changed over time and sometimes priceoracle.near takes the third place and sometimes v2.ref-finance.
- The client.bridge is also should be mentioned among top used contracts and has promising application on Near.
- The average gas used among these top contracts reveals the change in average gas used of Aurora and domination of client.bridge contract in weekly and monthly basis.
As mentioned in the first part of essay, some contracts are more complicated and need more gas for execution. The gas used on various blockchains has been related to the application of contract and complexity of it.