Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous claim about equality of PMM curve to AMM curve when K=1 #83

Open
azaidelson opened this issue Aug 29, 2022 · 1 comment
Open

Comments

@azaidelson
Copy link

azaidelson commented Aug 29, 2022

In the PMM explanation here[https://dodoex.github.io/docs/docs/pmm] there is a statement that if k=1, the PMM curve actually becomes the same as AMM curve. This seems wrong.

It would be correct if the exponent of (B0/B) equaled one. It is not correct if the exponent is 2 as in your final formula.

Proof:
The AMM formula looks like this (with zero fees): dy = dx*Y / (X+dx). Here, X and Y are amounts of liquidity present in the pool for assets X and Y, dx is the amount of asset x sold, and dy is the amount received.

If we translate this to Dodo nomenclature with k=1, P = dx/dy, and P also equals X/Y * (Y/(Y-dy)).
Indeed, dx/dy equals the actual price (P), X/Y is the initial price i, and Y/(Y-dy) is essentially B0/B.

After algebraic simplification, we bring the expression dx/dy=X/Y*(Y/(Y-dy)) to the exact AMM formula: dy = dx*Y/(X+dx)
Of course, if the exponent of Y/(Y-dy) was 2, we would not get to this result.

@azaidelson
Copy link
Author

@owen05 @sa1i @DODORicky will appreciate feedback on the above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant