# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.neopin.io/earn-with-neopin/swap/automated-market-maker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
