-
Notifications
You must be signed in to change notification settings - Fork 1
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
Various fixes #5
base: master
Are you sure you want to change the base?
Conversation
SushiChef(chef).deposit(pid, _amount); | ||
|
||
//i dont understand this part. You swap all reward into want in prepare return. Why would you have any to stake here? I can't see any situation where you'd be staking sushi |
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.
i understand now. ignore this comment
@@ -185,7 +189,17 @@ contract StrategySushiswapPair is BaseStrategy { | |||
function exitPosition(uint256 _debtOutstanding) internal override returns (uint256 _profit, uint256 _loss, uint256 _debtPayment) { | |||
(uint256 _staked, ) = SushiChef(chef).userInfo(pid, address(this)); | |||
SushiChef(chef).withdraw(pid, _staked); | |||
//what about the money in xsushi? you just leave it there? |
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.
if you do transfer it remember to adjust 'staking'
uint256 _xsushi = sushi_to_want(get_share_worth()); | ||
|
||
|
||
uint256 _xsushi = sushi_to_want(get_share_worth()); //as you never realise this as profit you will need to change your harvest trigger method. Or else you could get in an endless true loop |
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.
Ah yeah this is annoying
@@ -134,6 +136,7 @@ contract StrategySushiswapPair is BaseStrategy { | |||
*/ | |||
function prepareReturn(uint256 _debtOutstanding) internal override returns (uint256 _profit, uint256 _loss, uint256 _debtPayment) { | |||
if (_debtOutstanding > 0) { | |||
//this will crash is debtOutstaning is more than amount you have |
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.
I do not believe it is technically possible because it is a lossless strategy, but I will see if I can add a nice fix for it anyways
No description provided.