feat: added deferred ramp A to y pool & static yearn like token wrapper #84
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.
Curve + CompliFi Integration Proposal
y pool template has been extended with the following functions:
changed: SwapTemplateY contract - added external function ramp_A_deferred(_future_A: uint256, _future_time: uint256, _initial_time: uint256) that can launch deferred ramping of amplification at _initial_time in addition to ramp_A params, where ramping of amplification starts immediately.
added: yStaticWrapper token contract has been added, which re-denominates derivatives so as to achieve a 1:1 reference price vs collateral. The contract implements ERC20 and yERC20 interfaces. Any token can be wrapped by deposit(_amount: uint256) function and converted back by withdraw(_amount: uint256) function. The re-denomination rate is set during the creation of the wrapper token, and fetched by executing yERC20's getPricePerFullShare() -> uint256. The yStaticWrapper token contract is fully supported yERC20 interface and can be used directly in y pool.
CompliFi's Curve pool creation flow:
Deferred y pools are created for each primary derivative vs collateral and complement derivative vs collateral pair.
Derivative tokens and collateral tokens have to be wrapped to yStaticWrapper tokens. For collateral tokens, the conversion rate is equal to 1. Primary and complement tokens’ rate to be determined based on valuation of specific derivatives.
ramp_A_deferred should be executed shortly after creation of the pool.