Skip to main content

LP Tokens Explained

When you deposit assets into a Liquidity Pool on Alpaca DEX, you do not just "give" your money to the contract. In exchange, you receive LP Tokens (Liquidity Provider Tokens).

Think of these tokens as a digital receipt. They represent your proportional claim on the pool's total reserves, including any Liquidity Fees that have accumulated since you deposited.


How LP Tokens Are Calculated

Alpaca DEX uses the standard Constant Product Formula to maintain the balance of assets in a pool.

x×y=kx \times y = k
  • x = Amount of Token A
  • y = Amount of Token B
  • k = Constant Value

When you deposit liquidity, the liquidity engine mints new LP tokens for you. The number of tokens you receive is calculated to exactly match the percentage share of the pool you just added.

The Share Formula

If you are adding to an existing pool, your LP Token amount (SmintedS_{minted}) is calculated based on the current Total Supply of LP tokens (StotalS_{total}):

Sminted=AmountdepositedAmountreserve×StotalS_{minted} = \frac{Amount_{deposited}}{Amount_{reserve}} \times S_{total}

In simple terms: If the pool currently holds 1,000 KTA and you deposit 100 KTA (plus the equivalent in the paired token), you are adding 10% to the pool size. Therefore, you will mint 10% of the existing LP Token supply.


Why Hold LP Tokens?

Holding LP tokens is the only way to earn passive income from the exchange's trading volume.

As explained in our Liquidity Fees guide, every trade adds a small fee back into the pool reserves.

  • Your LP Token quantity stays the same.
  • The value of the underlying assets grows.

When you eventually redeem (burn) your LP tokens, you are entitled to a larger amount of crypto than you deposited, representing your earned interest.


Initial Liquidity Lock

To ensure safety and fair market stability, Alpaca DEX enforces a lock on the very first LP tokens created for a new pool.

  • Who this affects: The Token Creator (or the first person to initialize the pool).
  • The Rule: The LP tokens generated from the initial deposit are locked.

Why do we do this? This prevents "Rug Pulls" where a creator launches a token, waits for people to buy, and then immediately withdraws all the liquidity, crashing the price to zero. By locking the initial LP tokens, we guarantee that liquidity remains available for traders during the critical launch phase.