PMM Algorithm

Proactive Market Making (PMM)

As the trading/transaction data become significantly large, the market needs to react to changes with an efficient mechanism. We see eye to eye with DODO v2 that the most important metric of a decentralized market is liquidity.

We capture the liquidity in our market using a depth chart, as shown in Figure 1. In the figure, on the left side are buy orders (bids) and on the right side are sell orders (offers). The depth of the liquidity pool is along the y-axis, representing the volume that can be bought or sold for the corresponding price.

Let us start with the Automated Market Making algorithm (AMM), which is represented by the two straight lines (slopes) in Fig. 1. A decreasing slope on the left side means that if a user (seller) wants to sell to the bid on the slope, the market price will move down. An increasing slope on the right side means that if a user (buyer) wants to buy from an offer on the slope, the market price will move up. In AMM, to keep the depth of liquidity pool constant, we have a linear relationship defined by

where x and y are amounts of the assets in the liquidity pool and k is the amount of liquidity. The limitation of AMM is that, in reality, most liquidity is concentrated near the mid price - that is, the midpoint of each slope. Moreover, if the price goes over the limit, AMM returns zero for liquidity whereas in reality there is always liquidity presented as such prices. In both cases, AMM model use a small portion of liquidity and leave majority of liquidity unattended.

Therefore, we choose to use PMM, which is essentially a generalization of AMM, to capture our market changes. By replacing a linear relationship to a curve parameterized by k, we solve the challenges posed by AMM and model our market more accurately. Implementation-wise, as shown in Fig. 2, we need to take care of three states: 1. User selling, 2. User buying, and 3. The equilibrium.

In Fig. 3, we illustrate how users interact with the liquidity pool through PMM, based on the Ethereum network.

As a practice that imitates human trader practice – sell at price higher than mid price and buy when price go below medium, PMM model changes its price to trade amount curve according to mid price change. A simple example in Figure 4 shows how PMM react in response to price change. When mid price rise, PMM model adjust its curve to support smooth liquidity supply as well as limit its risk. On the contrary, AMM model failed to keep curve updated and are more vulnerable to price arbitrators.

Last updated