Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Various fixes #5

wants to merge 1 commit into from

Conversation

Grandthrax
Copy link

No description provided.

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
Copy link
Author

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?
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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

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