The Auto Market Maker (AMM) is the core of pool models and liquidity pools, instead of using the Oracle price, AMMs determine the prices by the algorithm.
Users can provide liquidity to RunesDeX by depositing an equivalent value of BTC and Runes tokens into a pool.
The addLiquidity function
allows users to add liquidity to a RunesDeX pool, contributing both BTC and Runes tokens.
As a user, you deposit an equivalent value of BTC and Runes tokens into the liquidity pool. This helps maintain the balance in the pool, ensuring that trades can occur smoothly.
When you add liquidity, you will receive pool tokens representing your position. These tokens automatically earn fees proportional to your share of the pool, and can be redeemed at any time. By adding liquidity you'll earn 0.25% of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.
The removeLiquidity function
allows users to withdraw their liquidity from the pool by redeeming their LP tokens for the underlying BTC and Runes tokens.
Calculate Withdrawal Amounts:
The amount of BTC and Runes tokens you receive is based on your share of the pool. The pool calculates your proportionate share and returns the corresponding amounts of BTC and Runes tokens to you.
Receive BTC and Runes Tokens:
The calculated amounts of BTC and Runes tokens are transferred from the pool back to your wallet, completing the withdrawal process.
Removing pool tokens converts your position back into underlying tokens at the current rate, proportional to your share of the pool. Accrued fees are included in the amounts you receive.