Zap for crypto meta stable factory pools #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inadd_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 inremove_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