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

[Feature-request]: Add support for common AMM or liquidity pool #4

Open
montyly opened this issue Feb 23, 2023 · 3 comments
Open

[Feature-request]: Add support for common AMM or liquidity pool #4

montyly opened this issue Feb 23, 2023 · 3 comments

Comments

@montyly
Copy link
Member

montyly commented Feb 23, 2023

Describe the desired feature or improvement

Uniswap v2 might be a good first one

@aviggiano
Copy link
Contributor

aviggiano commented Jun 29, 2023

I'm compiling Uniswap v2 properties, so maybe it will help when adding this feature to the repo:

Property Description
P-01 Adding liquidity increases K
P-02 Adding liquidity increases the total supply of LP tokens
P-03 Adding liquidity increases reserves of both tokens
P-04 Adding liquidity increases the user's LP balance
P-05 Adding liquidity decreases the user's token balances
P-06 Adding liquidity for the first time should mint LP tokens equals to the square root of the product of the token amounts minus a minimum liquidity constant
P-07 Adding liquidity should not change anything if it fails
P-08 Adding liquidity should not fail if the provided amounts are withing the valid range of uint112, would mint positive liquidity and are above the minimum initial liquidity check when minting for the first time
P-09 Removing liquidity decreases K
P-10 Removing liquidity decreases the total supply of LP tokens
P-11 Removing liquidity decreases reserves of both tokens
P-12 Removing liquidity decreases the user's LP balance
P-13 Removing liquidity increases the user's token balances
P-14 Removing liquidity should not change anything if it fails
P-15 Removing liquidity should not fail if the returned amounts to the user are greater than zero
P-16 Swapping does not decrease K
P-17 Swapping increases the sender's tokenOut balance
P-18 Swapping decreases the sender's tokenIn balance
P-19 Swapping does not decrease the feeTo LP balance
P-20 Swapping should not fail if there's enough liquidity, if the output would be positive and if the input would not overflow the valid range of uint112

I'll update the list as I add more properties.

@montyly
Copy link
Member Author

montyly commented Jun 29, 2023

@aviggiano
Copy link
Contributor

@montyly thanks, that's great
I'll check these out

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

2 participants