Simple Automated Market Maker
Simple version of the Uniswap AMM
Last updated
Was this helpful?
Simple version of the Uniswap AMM
Last updated
Was this helpful?
A group of liquidity providers deposits token and token with reserves and , respectively. The fee for a transaction is and the conserved quantity is . A user wants to trade an amount of token , , for some amount of token , such that k remains conserved.
Each transaction must satisfy the following equation:
After the transaction the reserves and k are updated as follows:
The conservation equation becomes
An example can be seen at
Alice wants to sell an amount for token .
What amount, , does Bob pay to Alice given , , and ?
The ratio of the changes: .
The market price is .
A constant mean market is a generalization of a constant product market. The conserved constant becomes a product over all the reserves for n tokens where is the reserve weight for the ith token.
where is the fee for the jth coin and c is given by