Difference between revisions of "Gas fees"

Jump to navigation Jump to search
325 bytes added ,  13:12, 26 April 2022
no edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 9: Line 9:
Since in a blockchain each node must independently execute every transaction, it is important to limit the amount of computational effort required from the nodes.
Since in a blockchain each node must independently execute every transaction, it is important to limit the amount of computational effort required from the nodes.
In EVM-based blockchains each transaction has a gas cost, which is defined by its complexity and its needs for storage.
In EVM-based blockchains each transaction has a gas cost, which is defined by its complexity and its needs for storage.
Each transaction has a minimum gas cost of 21.000 gas, to which more is added as the transaction gets more complicated.
Each transaction has a minimum gas cost of 21,000 gas, to which more is added as the transaction gets more complicated.
For example, a swap on [[Uniswap]] costs about 190.000 gas, an [[ERC20]] token transfer costs about 65.000 gas, adding liquidity in a Uniswap v3 pool costs about 220.000 gas.
For example, a swap on [[Uniswap]] costs about 190,000 gas, an [[ERC20]] token transfer costs about 65,000 gas, adding liquidity in a Uniswap v3 pool costs about 220,000 gas.
When sending out a transaction, the user (or more commonly the wallet) sets a '''gas limit''', which is the maximum amount of gas the transaction is allowed to spend. If the transaction ends up spending less gas, the user gets a '''refund'''; if it ends up needing more gas, the transaction is reverted and the gas is '''not refunded.'''
When sending out a transaction, the user (or more commonly the wallet) sets a '''gas limit''', which is the maximum amount of gas the transaction is allowed to spend. If the transaction ends up spending less gas, the user gets a '''refund'''; if it ends up needing more gas, the transaction is reverted and the gas is '''not refunded.'''


Line 24: Line 24:
# The other is the tip, which is variable and set by the user, depending on how fast they want their transaction included, and it goes entirely to the block producer.
# The other is the tip, which is variable and set by the user, depending on how fast they want their transaction included, and it goes entirely to the block producer.
These fee add up to be the final gas price which is then multiplied by the transaction gas cost to obtain the final transaction fee.
These fee add up to be the final gas price which is then multiplied by the transaction gas cost to obtain the final transaction fee.
== See More ==
[https://dune.com/hildobby/Gas All About Ethereum Gas Dashboard] by [https://twitter.com/hildobby_ @hildobby_]
[https://owlracle.info/eth Owlracle] is a multichain Gas Price tracker API
[https://www.useweb3.xyz/gas Ethereum Gas Tracker] is a tool by [https://www.useweb3.xyz/ UseWeb3]
[[Category:Glossary]]

Navigation menu