Module 2 · On-chain
Gas, transactions & DEXes
How transactions actually settle, and what you pay for.
0/2 lessons
Gas & transaction fees
Learn
Every on-chain action consumes gas — a unit of computational work. Your fee is `gas used × gas price`, and the gas price floats with network demand. The same swap is cheap at 3am and brutal during a hyped mint.
Fee = Gas used × (Base fee + Priority fee)
Base fee: set by the protocol, burned
Priority fee: your tip to be included sooner
Recall0/1
Recall
Your transaction fee scales with…
AMMs & how DEX prices form
Learn
Most decentralized exchanges don't use an order book — they use an automated market maker (AMM). A pool holds two assets and prices them by a formula (classically `x · y = k`). Your trade moves along that curve, so larger trades get worse prices — that's slippage, baked into the math.
Constant product: x · y = k
Price = y / x (ratio of reserves)
Bigger trade → bigger move along the curve → more slippage
Recall0/1
Recall
In a constant-product AMM, larger trades…