Skip to content

Strategy lever PoC#10

Merged
iamsahu merged 69 commits intomasterfrom
feat/strategy-lever
Nov 11, 2022
Merged

Strategy lever PoC#10
iamsahu merged 69 commits intomasterfrom
feat/strategy-lever

Conversation

@iamsahu
Copy link
Copy Markdown

@iamsahu iamsahu commented Oct 6, 2022

No description provided.

@alcueca
Copy link
Copy Markdown

alcueca commented Oct 26, 2022

Instead of a review, this time I chose to do some coding. It's a good sign, because it means that I'm finally comfortable with the code.

In this branch, I fixed most of the imports and a warning, but more importantly I fixed approvals.

We always do an ERC3156 flash loan, meaning that we always have to approve for the flash loan repayment. We get the token address in the onFlashLoan invocation, and we trust the lender, so we can just approve all flash loan repayments like this:
image

In PR11 I made two deeper changes:

  1. Every time that we repay debt in the Yield Protocol, we can send the base assets to the appropriate join, or the fyToken to the appropriate fyToken contract, and then call ladle.pour, ladle.repay, or ladle.close. Removes approvals and makes the code more consistent.
  2. You can't call burnForBase after maturity, so I coded a new redeem option that redeems the fyToken. I kept the close option because it should be useful if pool rates are low, and users can't use repay to unwind.

@alcueca
Copy link
Copy Markdown

alcueca commented Oct 26, 2022

I didn't see exhaustive tests, so I would suggest that we start with those. There were bugs in there that would have wasted time from the frontend team.

@iamsahu iamsahu requested a review from alcueca November 9, 2022 12:07
Copy link
Copy Markdown

@alcueca alcueca left a comment

Choose a reason for hiding this comment

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

We can test a bit further.

@iamsahu iamsahu requested a review from alcueca November 10, 2022 14:51
Copy link
Copy Markdown

@alcueca alcueca left a comment

Choose a reason for hiding this comment

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

Well done. Let's merge and see it live.

@iamsahu iamsahu merged commit 45eb22a into master Nov 11, 2022
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.

3 participants