Skip to content

V5 revised#6

Open
OpenOrg-gg wants to merge 3 commits intomasterfrom
v5-revised
Open

V5 revised#6
OpenOrg-gg wants to merge 3 commits intomasterfrom
v5-revised

Conversation

@OpenOrg-gg
Copy link
Copy Markdown
Owner

No description provided.

//This is because in Yearn Vaults line #1746 enforces a check that the balance must be greater than gain + debtpayment
//We must calculate the growth in staked LOOKS otherwise it isn't ever going to get claimed, and we must withdraw it to pass this revert check.
withdrawProfitOrFloor(finalProfit);
withdrawProfitOrFloor(finalProfit, _debtOutstanding);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it better to call liquidatePosition(finalProfit) ?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but the liquidatePosition(finalProfit) assumes the goal is to liquidate 'X' and that 'X' is already greater than the floor price.

It also means that if profit was 0, we wouldn't be attempting to withdraw debtOutstanding at all?

debtOutstanding = debtOutstanding.mul(10 ** IDecimals(address(want)).decimals()).div(sharePrice);
}
(uint256 shares, , ) = looksRareContract.userInfo(address(this));
uint256 upperlimit = Math.max(debtOutstanding,shares);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be more than what it is staked in the LOOKS contract. If debtOutstanding > shares you are going to do a withdraw on line 144 of looks that you don't have.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this should min(). I need the largest number I have, which ironically is min. Good catch.

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