top of page

1.1

Chains & Ecosystem Awareness

1.2

Basic Mechanics

1.3

Reality Check

2.1

Wallet Architecture

2.2

Core Safety Skills

2.3

System Risks

3.1

Protocol Fundamentals

3.2

Execution Mechanics

3.3

Risk Mechanics: Impermanent Loss

4.1

Yield Systems

4.2

Liquidity Analysis

4.3

Stablecoin Strategies

4.4

Practical Awareness

4.5

DeFi Position Strategy

4.6

Exit Strategy

5.1

Core: Cross-Chain Operations

5.2

Advanced: Cross-Chain Tools & Stablecoin Systems

6.1

Verification & Monitoring

6.2

On-Chain Awareness

6.3

Protocol Evaluation

6.4

DeFi Risk Framework

6.5

Operator Mental Models

6.6

Monitoring Systems

7.1

Advanced Risks in DeFi

7.2

Advanced Ecosystem

DeFi Operator Path

Stage 1 of 7

Document.png

On This Page

PART 1: What Happens When You Click “Swap”?

PART 2: Gas Mechanics

PART 3: Router Contracts

PART 4: Swap Fees

PART 5: Confirmations

PART 6: Trade Impact (Slippage)

PART 7: Expected Output

PART 8: Why Trades Fail

PART 9: Real Execution Risks

Putting It All Together

idea.png

Key Takeaways

• Every transaction is an on-chain instruction

• Gas is unavoidable and varies by chain

• Router contracts execute your trades

• Slippage and liquidity affect outcomes

• Expected output is not guaranteed

• Execution mistakes = real losses

Lesson

1.2

Basic Mechanics

What You’ll Learn

• How gas works (and why it matters)

• What router contracts do

• How swaps are executed

• How to estimate trade outcomes (before confirming)

This lesson teaches you what actually happens when you click “Swap”



PART 1: What Happens When You Click “Swap”?



Behind the scenes:

  1. You submit a transaction

  2. It goes to the blockchain

  3. A smart contract executes it

  4. You receive tokens



Key Insight:

You are not trading “instantly” You are sending instructions to the blockchain


PART 2: Gas Mechanics



What is Gas?

Gas = the fee you pay to execute a transaction



On Ethereum:

  • Gas can be expensive

  • Depends on network congestion



On EVM chains (like Arbitrum, Avalanche):

  • Gas is cheaper

  • Faster confirmations



Why Gas Exists:

  • Pays validators

  • Prevents spam

  • Secures the network



Key Insight:

Gas is not optional Every action = cost


Important Components:



Gas Price

  • Cost per unit


Gas Limit

  • Max gas you’re willing to use



Operator Rule:

Always leave enough gas tokens in your wallet



PART 3: Router Contracts



What is a Router?

A smart contract that executes your trade



Example:

Using Uniswap:

  • You don’t trade with another person

  • You interact with a router contract



What the Router Does:



🔹 Finds liquidity pool

🔹 Calculates price

🔹 Executes swap



Key Insight:

You are interacting with code—not a human


PART 4: Swap Fees



Types of Costs:



🔹 Gas fee (network)

🔹 Swap fee (DEX)



Example:

  • Uniswap fee: ~0.3%

  • Gas: varies



Key Insight:

Your total cost = gas + swap fee + slippage


PART 5: Confirmations



What is Confirmation?

When the network finalizes your transaction



Depends on:


  • Chain speed

  • Network congestion



Key Insight:

Until confirmed, your trade is NOT final


PART 6: Trade Impact (Slippage)



What is Trade Impact?

How much your trade moves the price



Example:

  • Small pool + big trade 👉 price moves against you



Key Insight:

You are part of the market—you move it



Slippage:

Difference between expected and executed price



Operator Rule:

Always check slippage before confirming



PART 7: Expected Output



Before confirming a trade, you’ll see:



🔹 Tokens you receive

🔹 Minimum received

🔹 Price impact



Critical:



“Minimum received” protects you from bad execution



Example:


  • Expected: 100 tokens

  • Minimum: 95 tokens

👉 If worse → trade fails



PART 8: Why Trades Fail



❌ Not enough gas

❌ Slippage too low

❌ Price moved too fast



Key Insight:

Failed trades still cost gas


PART 9: Real Execution Risks



Hidden realities:



  • Price changes during confirmation

  • MEV bots (front-running)

  • Low liquidity traps



Key Insight:

The price you see is not guaranteed


PART 10: Ethereum vs EVM Chains (Practical View)



Ethereum:

  • Expensive

  • Reliable

  • Deep liquidity



Arbitrum / Avalanche:

  • Cheap

  • Faster

  • Slightly more risk



Operator Rule:

Match chain to trade size



Putting It All Together



Before every trade:



Do I have enough gas?



What are total fees?



What is slippage?



What is minimum received?



Final Question:


If this executes worse than expected… am I still okay with it?



Practice Mission



Open a DEX (like Uniswap)


Simulate a trade


Observe:

  • Gas fee

  • Price impact

  • Minimum received



Challenge:


Compare the same trade on:

  • Ethereum

  • Arbitrum

👉 Notice cost difference


Final Thought

In DeFi, clicking “Swap” is easy… understanding what happens after is where your edge comes from

bottom of page