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

Zap for crypto meta stable factory pools #7

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

romanagureev
Copy link
Contributor

@romanagureev romanagureev commented Jul 28, 2022

ZapStableSwapFactoryOne

This version follows the same interface as others.

How to test it

brownie test tests/zaps/forked/ --deployed_data mainnet --zap_base stable_factory --network mainnet-fork

or mainnet-3 for base pool with 3 coins.

ZapStableSwapFactory

This version works for any level (up to) 1 meta pools.

Notes

Used [meta, base0, ..., base4] for each meta coin, so it is obvious how to exchange any coins and allows to add any combination of tokens like base coins along with their lp token.
Used 2 dimensional array as it makes implementation clearer and I looks like it is harder to make mistakes this way(e.g. writing from 5-th index for the second pool) .
If you give raw ETH with _use_eth=True when there are no with or eth in add_liquidity(...) it will not revert. To handle it, consumed ETH has to be handled on each step, I decided that it is overhead and ETH can be recovered via removing liquidity.
If you do not put _min_amounts for base coins in remove_liquidity(...) it will remove only lp. But if you put them, lp's _min_amount will be ignored.

How to test it

brownie test tests/zaps_factory/forked/ --deployed_data mainnet --network mainnet-fork

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

Successfully merging this pull request may close these issues.

3 participants