Lesson 0414 min
ARBITRAGE · PRICE GAP · IL

When Outside Prices Move, Who Arbitrages?

Move the outside reference, let an arbitrageur pull the pool quote back, and inspect LP inventory risk.

ObjectivesAfter this lesson, you should be able to:
  • Explain how arbitrage uses a pool/outside price gap
  • Observe arbitrage changing reserves rather than creating free value
  • Use a hold baseline to understand impermanent loss at exit
COURSE POSITIONStep 4 of 4
  1. PREVIOUSWhere Do LP Fees Come From?
  2. CURRENTWhen Outside Prices Move, Who Arbitrages?

    Move the outside reference, let an arbitrageur pull the pool quote back, and inspect LP inventory risk.

  3. NEXTFree sandbox
BEFORE YOU READ

Think about these questions first.

Choose an answer before opening the explanation. You can add anything unexpected to your review list.

Q01Who actually pays an AMM arbitrageur’s profit?
SHORT ANSWER

The protocol does not mint a reward. When pool and external prices diverge, arbitrage trades move inventory; the gap is distributed through trader execution, LP rebalancing, and arbitrage profit.

Compared with your prediction:

An AMM only knows its own reserve ratio. When outside prices disagree, arbitrageurs trade against the pool and pay the costs of moving its quote back toward the market. The LP’s inventory change happens along that path.

Create a price gap

Move the external price to 150 credits per TOKEN. If the pool is still near 120, TOKEN is cheap inside the pool. The arbitrageur buys TOKEN with credits until the pool price approaches the external reference.

SIMULATION ACTIVE0.30% fee
POOL 001 · CONSTANT PRODUCT

Credits / TOKEN

The pool does not wait for another order. Its reserve ratio produces the next quote.

Spot price120.00credits / TOKEN
Credits reserve120,000X
TOKEN reserve1,000Y
Fees collected0in pool
k growth0.00%vs. initial pool
Reserves in motionx · y = 120,000,000
Credits
120,000
TOKEN
1,000

Swap fees stay in the pool and slowly grow k; adding or removing liquidity also changes the reserve scale.

EXTERNAL PRICE · ARBITRAGE

Pull the pool price back to the market

Move the external price, then run the arbitrageur. It pays fees and uses its own assets to rebalance the pool.

Pool price120.00
External price120.00
Price gap0.00%
Arbitrageur credits100,000
Coach

Start with the two reserves, then drag the swap size. Small trades stay near the spot price; large trades travel farther along the curve.

Pool events1 EVENTS
  1. 01

    Pool created: 120,000 credits + 1,000 TOKEN,initial price 120 credits / TOKEN。

ACTION HISTORYExperiment timeline
1 state snapshots

Use the slider to return to an earlier step. Continuing from there replaces the later history with a new sequence.

Initial state
View experiment records →

Arbitrage does not create value from nothing. The trader pays fees and price impact; the opportunity comes from the gap, while the pool receives a new reserve mix plus fees.

Why impermanent loss belongs beside the exit

The lab values your current LP inventory against what the original deposit would be worth if held in a wallet. The difference appears as prices move and becomes realized when you withdraw. Fees can offset or exceed it, but “impermanent” does not mean “risk-free.”

Expand: how this step works
if poolPrice < externalPrice:
  arbitrageur swaps X for Y
else:
  arbitrageur swaps Y for X

fees stay in reserves
LP position = reserves × (LP shares / total shares)

Real protocols need an external reference, minimum-output protection, MEV-aware execution, and limits against extreme reserves. This lab keeps the price gap, fee, and inventory change in one event log.

KNOWLEDGE CHECK

When TOKEN is cheaper in the pool than outside, what does an arbitrageur usually do?

Follow risk through the system

A mature AMM must answer where the outside price comes from, who pays for rebalancing, how LPs understand inventory, how traders cap worst-case output, and who can pause or upgrade the system. Remembering x · y = k is remembering the curve; tracing the assets and incentives is understanding the market.

LESSON RECAPComplete the exercise and knowledge check first