kortanaswap
Kortana

Liquidity

How LP tokens are minted and burned, and what impermanent loss actually means.

Depositing into a pool mints LP tokens representing your share of it. The first deposit into an empty pool mints the geometric mean of the two amounts, less a permanent lock of 1,000 units sent to the zero address and never recoverable by anyone.

That lock exists to prevent an attack. Without it, the first depositor could mint a single unit of LP, donate a large balance directly to the pool to inflate the value of that unit, and cause every subsequent deposit to round down to zero — taking their money and giving nothing back.

Subsequent deposits mint in proportion to the smaller of the two side ratios, so an unbalanced deposit is credited only for its limiting side. The router computes the optimal pair against live reserves before transferring, so you are never debited the surplus in the first place.

Providing liquidity is not a deposit. If the relative price of the two assets moves, withdrawing can return less total value than you put in, even after earning fees. This is impermanent loss, and it is a property of the constant product formula rather than a fault in it.