# 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](https://3207921449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqGie2GKzhU3olmN7yiWW%2Fuploads%2FoCwwbq9nfZxtlu6eYszT%2FAMM.png?alt=media\&token=dcae9199-a485-4352-af91-c25402046f0c)
