> For the complete documentation index, see [llms.txt](https://docs.neopin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.neopin.io/earn-with-neopin/swap/automated-market-maker.md).

# Automated Market Maker

* An AMM (Automated Market Maker) is a type of decentralized exchange protocol that sets the price of an asset based on a mathematical formula. Unlike spot exchanges that use the order book and order matching system, decentralized exchanges use a pricing algorithm to calculate the price of an asset.
* NEOPIN Swap uses the X \* Y = K formula. X and Y are token quantities in a liquidity pool, while K is a constant that refers to the total liquidity in the pool. The value of K remains a constant unless tokens are supplied to or withdrawn from the pool.&#x20;
* An AMM works similarly to an order book of a spot exchange. However, a transaction counterpart is not necessary. Users can predict token liquidity and price through the smart contract and AMM, which “makes” the market.

![Click to enlarge](/files/PRU55K1a6EsOq331Zefl)
