Your First 90 DaysAcademy
The Protocols · The Machines, One at a Time · Week 4 · Checkpoint 7

The AMM

By the end you will understand how a pot of two tokens and one formula replaced the order book, why the price moves when you trade, and who keeps a robot's price honest.

10 steps~20 min3 nodes for your map
01 · The market with nobody in it

You learned the machine in checkpoint one: instant fills exist because market makers stand in the queues all day, quoting both sides. Now picture a brand new token at 3am. No firm is paid to quote it. The book is empty. Your buy has nothing to meet.

Early DeFi lived in that empty room. Thousands of tokens, and no crowd of makers awake for any of them. The fix was strange and beautiful: replace the queues with a pot and a rule, so that a counterparty is simply always there.

02 · A pot with one rule

Here is the pot. It holds two tokens at once, like a balance scale with a pan for each: some ETH in one pan, some USDC in the other. Anyone can put tokens into one pan and take tokens out of the other. That is a trade.

One rule governs every trade: multiply what sits in the two pans, and that product must never fall. Take ETH out, and you must put enough USDC in to keep the product whole. The rule is the entire machine. Names can wait.

03 · Somebody names a number

In checkpoint one, prices came from queues of humans naming them. This pot has no queues. Yet when you swap against it, you get a precise price, instantly, at 3am. Before we open the machine further, bet on where that number comes from.

A pool holds equal value of two tokens. Who sets the swap price?
04 · Every pool is a point on a curve

Draw every mix of the two pans that keeps the product whole, and you get this curve. The pool is always exactly one point on it. A trade does one thing only: it slides the point along the curve. Nothing else can move it.

Now the names. A pot that always quotes both sides is doing a market maker's job with no human inside: an automated market maker, an AMM. The rule, two amounts whose product holds, is the constant product formula. Uniswap runs on exactly this.

05 · The curve fights back

Buy a little ETH and the point slides a little: the pan lightens slightly, the price barely moves. Buy a lot and the point travels into the bend, where every extra ETH costs more USDC than the one before. The curve steepens against you.

This is price impact, and it is geometry, not punishment. In checkpoint one a big order ate through a thin queue; here it climbs a steepening curve. Same lesson, new machine: size moves price, and this machine never pretended otherwise.

06 · The tilt is the price

So where exactly does the number come from? Divide the pans. Thirty thousand USDC over ten ETH reads three thousand per ETH. Nobody typed that in. The tilt of the scale is the price, and every trade that retilts the pans rewrites it.

Notice what is missing: no price feed, no announcement, no human judgment. The pool does not know what ETH is worth. It only knows what it holds. Hold that thought, because it is about to become a problem.

07 · Who keeps a robot honest

Your big buy just tilted the scale: this pool now prices ETH above what Binance says. The pool cannot notice. But a trader watching both screens can, and the gap is free money: buy where it is cheap, sell where it is dear.

Function first: traders paid by the gap itself to push the pool back in line. The name: arbitrageurs. Nobody hires them, nobody thanks them, and they are the only reason a blind machine quotes sane prices. Tap the three stops on the curve.

0 of 3 stops visited
08 · The pool reads no news

So far you moved the pool and the world corrected it. Now flip it: the world moves while the pool stands still. First, notice who funded that last correction: the arbitrageur's profit came out of the pot itself. Whoever filled that pot quietly pays, every time the world moves.

That quiet cost gets a name in the next lesson. For now, the flipped case. ETH doubles on Binance within an hour. This pool holds ETH, and nobody trades against it. What is it quoting?

Scenario
ETH doubles on Binance in an hour. What happens to a Uniswap ETH pool that nobody trades against?
09 · Why the pot won

Now you can see why this machine won the ground it won. It is always on. It needs no listings desk: anyone can fill a pot for any pair of tokens, and a market exists by dinner. And because it is a contract, other machines can plug straight into it.

That last property made permissionless markets real, and this whole act is a tour of the machines that plugged in. But before we crown it, find the edge of the lens.

Limit test
A friend says: so AMMs made order books obsolete, right? Where does this lesson's lens stop?
10 · You know the machine

The half second, mapped again: your swap met a pot, slid a point along a curve, retilted a scale, and left a price that traders paid by the gap will keep honest. If you did our Web3 course, this is the machinery under the Uniswap swap you met there.

One thread is left hanging. Somebody filled that pot, and they are paid from every swap. Next: the business of being the house, and the cost nobody mentions at the door.

your balance2,400
BANK_DBowner: the bank
you2,400
what the app is actually showing you
BANK_DBowner: the bank
you2,400their pen
you hold a claim. they hold the pen.
your digital life
BANK · you2,400the bank ✍
INSTAGRAM · you2.1M followersMeta ✍
STEAM · you134 gamesValve ✍
AIRLINE · you58,200 milesthe airline ✍
four tables. zero pens that are yours.
BANK_DBowner: the bank
you2,400
DENIED
try both pens
PLATFORM_DBowner: the platform
her · 8 years2,000,000 followers
one automated decision away
BANK_DB · you · 2,400intentcompetencecontinuity
your row stands on all three
FTX_DBowner: FTX
you5 BTC
the backing vault●●●●●
the row stayed. the backing did not.
CARD_DBowner: your bank ✍
TV you never bought−1,100
fraud reversal+1,100
someone holds the pen, so someone can fix it
?_DBowner: nobody
youstill yours?
?
can a table exist that nobody owns?
?
?_DBowner: ̶n̶o̶b̶o̶d̶y̶
you100
no owner, no pen, no trust?
keeper 1
you100
keeper 2
you100
keeper 3
you100
keeper 4
you100
keeper 5
you100
no THE copy, only copies.
keeper 2
you100
keeper 3
you100
keeper 4
you100
keeper 5
you100
your copy
you100
five copies. one of them is yours.
one attacker
one attacker, ten thousand faces.
real machinesburned wattsnext page, sealed
writing costs watts. faking voters buys nothing.
cost paid OUTSIDE: hardware and power
proof of work, burn energy to vote.
page 1you · 100page 2you · 100page 3you · 100page 4you · 100
rewrite one line, break every lock after it.
office lunchtrusted keeperconsensusfive keepers, real cost
the price buys trustlessness. the office already has trust.
?
ownerless ledger
you?
a key, not a login?
nobody owns the table. so who owns your row?
ammpoolarbitrage

Three new nodes on your map

amm · pool · arbitrage · +10 Lynx