-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IdleFinance Tranche Strategy #75
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments. I think we need a better implementation for withdrawToVault
. Withdrawing all is not the best solution.
_profitSharingNumerator: 300, | ||
_profitSharingDenominator: 1000, | ||
_sell: true, | ||
_sellFloor: 1e18, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sellFloor is too high with WETH as rewardToken. It will now only liquidate if the total rewards are more than 1ETH. sellFloor could actually be set to 0, as we simulate profitability before running hardWork anyways.
IERC20(underlying()).safeTransfer(vault(), underlyingBalance); | ||
} | ||
|
||
function withdrawToVault(uint256 amount) external restricted { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there no way to do a partial withdrawal? We do not want to withdraw all to vault if it is not necessary. The funds will sit idle in the vault until the next hardwork
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
New strategy for
Idle Finance Tranche
.There are two types of tranches,
Senior(AA)
Tranche andJunior(BB)
Tranche. Currently we only support theSenior
Tranche since theJunior
Tranche doesn't have any extra reward tokens.The token flow of the invest process is:
underlying
token to theIdleCDO
contract which will mint theAA
token.AA
token to the gauge to get theIDLE
and the extra staking reward.The deposit token of
Lido - stETH
tranche isstETH
and the underlying token of the strategy iswstETH
since thestETH
is rebalancing token. So therewrap/unwrap
process oninvest/withdraw
.Test outputs at blockNumber = 15356073: