Math Behind PMM
Token Type
base and quote are two concepts that will be mentioned frequently. Two easy ways to distinguish between them are:
In a trading pair, the
baseis always the token before the hyphen, andquoteis after itIn transactions, the price refers to how many
quotetokens are needed in exchange for onebasetoken
For example, in the ETH-USDC trading pair, ETH is the base token and USDC is the quote token.
Pool Parameters
The funding pool of PMM is described by four parameters:
: base token regression target - total number of base tokens deposited by liquidity providers
: quote token regression target - total number of quote tokens deposited by liquidity providers
: base token balance - number of base tokens currently in the pool
: quote token balance - number of quote tokens currently in the pool
PMM Formula
The PMM price curve is plotted by the following pricing formula:
Where is defined to be the piecewise function below:
AMM & Stable Swap Use Cases
PMM supports transition to AMM and stable coin trading as well.
Traditional AMM
PMM is a generalization of AMM, when:
k = 1
deposit and withdraw in proportion to the current pool ratio
Stable swap
PMM can also be used as stable swap, when:
i = 1
k = 0.0001
Last updated