# EchoDEX AMM

To further explain how the EchoDEX Liquidity protocol works, consider a simple example of a liquidity pool containing two tokens, A and B

Let x be the initial supply of token A in the liquidity pool, and y be the initial supply of token B in the pool, such that x = y.

When a trader wants to buy token A using token B, they swap δB amount of token B for δA amount of token A, where δA/δB = x/y. The new supply of token A, x', and token B, y', in the liquidity pool is given by:

The total value of the pool, represented by the constant product, is given by:

As the trader buys more token A, the supply of token A in the pool decreases and the supply of token B increases, such that:

The price of token A in terms of token B is given by:

As the pool's supply of token A decreases, the price of token A in terms of token B increases, reflecting an increase in demand for token A.

The EchoDEX Liquidity protocol ensures that liquidity providers (LPs) are incentivized to provide liquidity to the platform by earning fees based on the percentage of the liquidity pool they provide, which is determined by the number of assets they deposit.

The EchoDEX Liquidity protocol provides a decentralized alternative to centralized exchanges, enabling trustless trading of assets. The AMM model and the constant product market-making formula provide a mathematical basis for the price-setting mechanism in a liquidity pool, ensuring that the platform can adjust asset prices automatically based on supply and demand. EchoDEX's unique features and governance structure make it a popular choice among traders and liquidity providers in the decentralized finance (DeFi) ecosystem.

Last updated