Lesson 0315 min
LP · FEES · INVENTORY

Where Do LP Fees Come From?

Become an LP, watch fees stay in the pool, and see how trade direction changes the inventory you own.

ObjectivesAfter this lesson, you should be able to:
  • Explain LP shares as proportional ownership of reserves
  • Put fee income and inventory change on the same ledger
  • Compare an LP position with a hold-only baseline
COURSE POSITIONStep 3 of 4
  1. PREVIOUSWhy Does the Quote Get Worse?
  2. CURRENTWhere Do LP Fees Come From?

    Become an LP, watch fees stay in the pool, and see how trade direction changes the inventory you own.

  3. NEXTWhen Outside Prices Move, Who Arbitrages?
BEFORE YOU READ

Think about these questions first.

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

Q01LPs earn every trade fee. How can they still underperform holding?
SHORT ANSWER

Trades continuously change the LP’s asset mix. Fees add value, but the pool tends to sell the rising asset and buy the falling one; performance must be compared with the counterfactual of simply holding.

Compared with your prediction:

Being an LP is not the same as putting assets in a savings account. You hand both assets to a pool and receive proportional ownership of future inventory; fees can grow that inventory while trade direction changes the mix you withdraw.

What does an LP share represent?

Deposit both assets near the current ratio and the system mints LP shares. A share is not a fixed number of TOKEN; it is a percentage of the pool’s total reserves.

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.

LP INVENTORY CHECK

What does your share represent now?

Deposit the suggested ratio, execute a few trades, and value your pool position against a hold-only baseline.

Credits withdrawable0
TOKEN withdrawable0
Pool position value0
vs. hold baseline0.00%
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 →

Deposit the suggested ratio, then execute a credit-for-TOKEN swap. Your ownership percentage stays the same, but the inventory represented by that percentage changes.

Keep two ledgers for an LP

The lab compares the value of your current LP position (withdrawable reserves valued at the current spot price) with a hold-only baseline (the original deposit held in a wallet). The gap contains fees, curve effects, and inventory rebalancing. It is not a full accounting statement, but it shows why fee income alone is not enough.

Expand: how this step works
sharesFromX = amountX × totalShares / reserveX
sharesFromY = amountY × totalShares / reserveY
shares = min(floor(sharesFromX), floor(sharesFromY))

withdrawX = reserveX × shares / totalShares
withdrawY = reserveY × shares / totalShares

Real contracts also handle locked initial liquidity, donated assets, rounding, and minimum deposits. Every rounding direction can affect long-run fairness and conservation.

KNOWLEDGE CHECK

Why is one LP share not a fixed 12,000 credits plus 100 TOKEN?

LESSON RECAPComplete the exercise and knowledge check first