Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions `Gas_and_Fees_Obinna.adoc`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
1. What is Gas?

Gas is a unit that measures the amount of computational effort required to perform operations on the Ethereum network, such as sending ETH, interacting with smart contracts, or swapping tokens.
Purpose in Ethereum Transactions:
Prevents abuse: By requiring gas for every operation, Ethereum avoids spam and infinite loops.
Incentivizes miners/validators: Users pay gas fees, which go to validators for processing and confirming transactions.
Limits computation per block: Each block has a gas limit to manage how much computation can happen in one block, ensuring network stability.

2. EIP-1559: Gas Fee Reform
Ethereum Improvement Proposal 1559 (EIP-1559), introduced in August 2021 (London Hard Fork), changed how gas fees work.
Key Components:

Base Fee:
A mandatory fee set algorithmically based on network demand. It adjusts up or down depending on how full the previous block was.
This fee is burned (removed from circulation), reducing ETH supply.

Priority Fee (Tip):
Optional extra fee users add to incentivize validators to include their transaction faster.

Burning Mechanism:
The base fee is burned, making ETH deflationary over time as high usage leads to more ETH being destroyed.
This aligns incentives and potentially increases ETH value long term.
3. Slippage
Slippage refers to the difference between the expected price of a trade and the actual price at execution.
In Ethereum & Token Swaps:
Common in DEXs (like Uniswap, SushiSwap).
When you swap tokens, rapid price changes (from volatility or other transactions) can cause your trade to execute at a less favorable rate.

Relation to Gas:

Low gas fees → slower transaction confirmation → higher risk of slippage.
High gas fees → faster processing → lower slippage risk.
DEX users often set a "slippage tolerance" (e.g., 1%) to prevent excessive loss. If the price changes beyond this, the trade fails.