# PMM Details

It is self-evident that the price of an asset should change depending on the asset supply. When developing the PMM algorithm, the DODO Team observed two major properties of crypto markets. These properties are:

- 1.Most of the liquidity is concentrated around the mid-market price, i.e. the price changes non-linearly with respect to the inventory.
- 2.There is liquidity even if the price deviates far from the mid-market price, but it is very limited.

The DODO Team therefore introduced a nonlinear equation for the price curve to make the depth distribution more consistent with the market, and more flexible as well.

The equation for the price P is as follows:

$P = i(1-k + k(\frac{B_0}{B})^2)$

where

- $i$is the initial "guide price"
- $k$is the "slippage factor"
- $B$denotes the current token supply
- ${B_0}$denotes the equilibrium supply (which can be interpreted as the exposure you are willing to hold)
- $\frac{B_0}{B}$is used to indicate how much the current token supply has shifted compared to the equilibrium state.

Note that "equilibrium" does not mean that both tokens in a pool are worth the same. What constitutes an "equilibrium" is subjective, and anyone can set what they think is the equilibrium. Under this formula:

- When$k=1$, this curve is exactly the same bonding curve as AMM.
- When$0<k<1$, this curve concentrates liquidity more around the$i$price than an AMM.
- When$k=0$, this curve becomes a straight line, and the price remains fixed.

In token pairs, the two tokens have different names based on how they are used. They are known as base or quote tokens, abbreviated as

$B$

and $Q$

(respectively). Base tokens are those tokens whose price is expressed in terms of the other (quote) token. For example, in the ETH-USDC trading pair, the price of 1 ETH (the base token) is expressed as an amount of USDC tokens (the quote token).Despite their conceptual differences, base and quote tokens have equal status in this system, i.e. they are symmetric. So, in case there is an undersupply of quote tokens, we can replace the multiplication in the price curve equation with division, as follows:

$P=i/(1-k+(\frac{Q_0}{Q})^2k)$

Therefore, the PMM price curve corresponds to the formula :

$P=iR$

Which is determined by the following rule:

If

$B<B_0$

, then$R=1-k+(\frac{B_0}{B})^2k$

If

$Q<Q_0$

, then$R=1/(1-k+(\frac{Q_0}{Q})^2k)$

Otherwise,

$R=1$

.Last modified 1mo ago