Enable _claim_admin_fees
for CurveCryptoPool
#275
Merged
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.
Description
Closes #231.
Enabled
_claim_admin_fees
forCurveCryptoPool
. For maintainability,tricrypto_ng.vy
's implementation and usage patterns are used for both 2-coin and 3-coin Cryptoswap pools. 2-coinCurveCryptoPool
andcryptopool.vy
will diverge primarily by calling_claim_admin_fees
with different timings; any calculations involved are largely the same. I expect that differences relative to the 2-coin vyper contract's behavior will average out to a negligible amount over the course of a sim pipeline.However, if
CurveCryptoPool
needs to simulate gulping, then the above solution will not be viable. One potential solution, as @chanhosuh says, would be to implement the following:"Organize all these [
CurveCryptoPool
] functions by a sort of configuration based on pool version that specifies when [_claim_admin_fees
] or [_tweak_price
] should be called. Then it's enforced by a function that checks what method it is in and what version the pool is."Alternatively, adding statements like
if self.n == 2
orif self.n == 3
to the functions that call_claim_admin_fees
in either one oftricrypto_ng.vy
orcryptopool.vy
(_tweak_price
,add_liquidity
,remove_liquidity
, andremove_liquidity_one_coin
) plus_claim_admin_fees
itself could work. Of course, these solutions are tricky and messy, but there's no going around that.Hygiene checklist
(modules, public functions, classes, and public methods)
and descriptive commit messages following Tim Pope's style
Cute Animal Picture