Comment on page

⚒

# AMM

AMM or Automated Market Maker is a key component of DerpDEX. Traditional exchanges rely on the Order book model where buyers are matched with sellers who are asking for the same price. DerpDEX uses algorithms to ensure both buyer and seller benefits from the protocol, and liquidity providers also earn some fees. The algorithms ensure that there is always sufficient liquidity for trading and maintain the ratio of assets in the pool.

DerpDEX uses an AMM model based on

**Constant Product Formula**. The constant product formula implies that the product of the quantities of the two assets (X and Y) should always be equal to the constant value (K) within the liquidity pool. This relationship allows the price of the assets to adjust automatically based on the supply and demand within the pool.`X * Y = K`

, where X and Y are asset values and K is a constant value that will remain constant.- 1.If the liquidity of X increases, the value of X will decrease but the value of Y will increase.
- 2.Similarly, if the liquidity of X decreases, the value of X will increase and the value of Y will decrease.

When a trade occurs, the constant product formula ensures that the product of the new quantities after the trade is equal to the initial constant value. This adjustment in quantities helps maintain the balance in the pool and determines the new price ratio between the assets, ensuring that trades are executed fairly based on the available reserves.

But not only this, DerpDEX uses much more advanced techniques like Concentrated Liquidity Market Maker to allow Liquidity providers to earn maximum profit on their asset allocation and liquidity is always available in the pool range where it is mostly traded.

When Liquidity Providers provide liquidity to a standard AMM pool, liquidity is distributed evenly along the price curve. Although this allows for handling all price ranges between 0 and ∞, it makes the capital quite inefficient. This is because most assets usually trade within certain price ranges. This is especially visible in pools with stable assets that trade within a very narrow range.

Last modified 4mo ago