feat(ConvexAssetProxy): Add Convex Asset Proxy #248
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.
Convex Asset Proxy contract that implements the Wrapped Position interface. This will allow us to expand our yield source integration beyond just Yearn to also include a direct integration with Convex for supported tokens. Yearn currently takes a 2% AUM fee, along with a 20% performance fee on profits. Integrating directly with Convex will allow us to avoid these fees & enable users to enjoy a higher APY.
This vault accepts Curve LP tokens & deposits them into Convex's system. Reward token emissions (CRV, CVX, and possibly other tokens) can be harvested by an authorized keeper, who earns a bounty that is configurable by the owner of this contract.
Design Details
The Curve/Convex ecosystem is a little messy – the diagram below outlines the flow the vault takes.
Curve has an idiosyncratic design, and the interfaces for contracts are not identical. Thus, a small part of the logic in this vault is specific to the LUSD-3CRV pool. Notably, the
add_liquidityfunction differs slightly for different Curve pools. However, only a few lines would need to be changed to support other Curve LP tokens.A standard interface to all Curve pools could be designed to make this more extensible, and it seems that
ZapSwapCurve.solattempts to do just this. Specifically,_zapCurveLpInand_zapCurveLpOutwould be useful here, but would need to be modified (e.g we would need them to send the LP tokens back to msg.sender). It seemed too messy to make changes toZapSwapCurve.solin this PR, so that will be left for a future PR. Once that happens, we can circle back to Convex Asset Proxy and determine how to generalize the logic to support more Curve tokens easily.Notes
This is un-audited code, and should be rebased to a development branch instead of being merged into main directly.