DODO Docs
Searchโ€ฆ
Details about PMM
Algorithm Introduction
The PMM algorithm has to answer how prices change according to inventory.
We observe two characteristics from the market.
  1. 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. 2.
    There should be liquidity even if the price deviates far from the mid-market price, but it will be very scarce We therefore introduce a nonlinear term for the price curve to make the depth distribution more consistent with the market and more flexible.
The price curve equation is as follows:
โ€‹
P=i(1โˆ’k+k(B0B)2)P = i(1-k + k(\frac{B_0}{B})^2)
โ€‹
where
ii
is the first parameter "guide price",
kk
is the second parameter "slippage factor",
BB
denotes the current token inventory,
B0{B_0}
denotes the equilibrium inventory (which can be interpreted as the exposure you are willing to hold), and
B0B\frac{B_0}{B}
is used to indicate how much the current token inventory has shifted compared to the equilibrium state.
Note that "equilibrium" does not mean that both tokens are worth the same. What constitutes "equilibrium" is artificial, and everyone can set what they think is "equilibrium". Under this formula.
-When
k=1k=1
, this curve is exactly the same bonding curve as AMM
-When
0<k<10<k<1
, this curve concentrates liquidity more in the
ii
neighborhood than the AMM =---When
k=0k=0
, this curve degenerates to a fixed price We call the valuation tokens in a pair Quote Token and the transaction tokens Base Token, abbreviated as
BB
and
QQ
. Quote Tokens and Transaction Tokens have equal status in this system, i.e., they are symmetric. Therefore,
ii
refers to how many
BB
tokens can be exchanged for
QQ
each token.
So, for the case of a missing inventory of valued tokens, we replace multiplication with division using the symmetric approach.
โ€‹
P=i/(1โˆ’k+(Q0Q)2k)P=i/(1-k+(\frac{Q_0}{Q})^2k)
โ€‹
To put it in order, the price curve of PMM corresponds to the formula :
โ€‹
P=iRP=iR
โ€‹
is determined by the following rule : If
B<B0B<B_0
, then
R=1โˆ’k+(B0B)2kR=1-k+(\frac{B_0}{B})^2k
If
Q<Q0Q<Q_0
, then
R=1/(1โˆ’k+(Q0Q)2k)R=1/(1-k+(\frac{Q_0}{Q})^2k)
Other cases
R=1R=1
โ€‹
Design ideas
The PMM algorithm is not just an empty idea, but has a complete evolution, if you want to know more please refer to this article.
Copy link