Skip to content

Conversation

@verumlotus
Copy link

@verumlotus verumlotus commented Mar 25, 2022

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.

image

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_liquidity function 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.sol attempts to do just this. Specifically, _zapCurveLpIn and _zapCurveLpOut would 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 to ZapSwapCurve.sol in 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.

@coveralls
Copy link

Coverage Status

Coverage decreased (-47.2%) to 49.48% when pulling 8fe3eb4 on verumlotus:main into 2c22fff on element-fi:main.

@verumlotus verumlotus changed the title [WIP] feat(ConvexAssetProxy): Add Convex Asset Proxy feat(ConvexAssetProxy): Add Convex Asset Proxy Apr 12, 2022
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.

2 participants