# Market Maker Functions

AMMs utilize a formula that decides how assets will be priced in the pool. **Constant function** means that no matter the size of the trade or the asset being traded, the rules for trading remain the same. The most common type is Constant Product Market Maker, but other functions are utilized as well.

| Function         | Example  |
| ---------------- | -------- |
| Constant Product | Uniswap  |
| Constant Sum     | mStable  |
| Constant Mean    | Balancer |
| Hybrid           | Curve    |
| ???              | Osmosis  |

## Constant Product

Many AMMs utilize the Constant Product Market Maker model (x \* y = k). This design requires that the total amount of liquidity (k) within the pool remains constant. Liquidity equals the total value of Asset A multiplied by the value of Asset B.

Prices in the pool are determined by this function (shown by the curve below). The cost of each trade is based on how much it shifts the curve. Each additional unit of Asset B that the trader purchases shifts the curve even further right, meaning each unit of Asset B is more expensive than the previous one.

![](https://646055908-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-McAXMu3_TtEog3FdvXR%2Fsync%2F522f4064e0e1d65f43c9591a32927a21aba6d588.png?generation=1623893011994555\&alt=media)

## Constant Sum

This design simply replaces the multiplication in Constant Product with addition (x + y = z). Liquidity in the pool equals the total value of Asset A plus the total value of Asset B.

![](https://646055908-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-McAXMu3_TtEog3FdvXR%2Fsync%2F8f9d87cce4d4c22df8d5c9d27c4a55a15f598aa5.png?generation=1623893151594394\&alt=media)

## Constant Mean Market Maker

This model allows users to create liquidity pools with more than two tokens and non-standard weights. Constant Mean Market Maker requires that the weighted mean of an asset remains constant. Constant mean market maker utilizes the formula: (x *y* z)³ = k

## Hybrid Constant Function

Some AMMs allow for unique parameters in the pool. A hybrid constant function could involve a combination of constant product and constant sum (Curve Protocol) or an entirely new mathematical expression.

## Osmosis' Design

Most AMMs require every pool to utilize the same function. Osmosis allows liquidity pools to be created with any conceivable design. Osmosis opted to be an “AMM laboratory” where experimentation is encouraged. This creative freedom positions Osmosis to be ground zero for AMM innovation, such as new methods of reducing slippage or impermanent loss.


---

# 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://osmosis.gitbook.io/o/basic-concepts/amm/constant-function.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.
