-
Notifications
You must be signed in to change notification settings - Fork 8
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
Extend loan instead of roll + small cleanup #54
Conversation
* async extensions * extend several times with a single call
loan.request.active = false; | ||
// Update loan terms to reflect the extension. | ||
loan.expiry += loan.request.duration * times_; | ||
loan.interestDue = interestFor( |
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.
So, as I understand it:
- Any amount repaid is ignored when the loan is extended
- At any point, the lender can extend the loan arbitrarily
- The borrower does not get a penny's worth of collateral back until they've paid back all the extra interest that the lender unilaterally demanded
I cannot sign off on this fix.
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.
we can probably discuss this better in discord, but:
- You are right, instead of
loan.request.amount
it should have beenloan.principal
. - and 3. The premise was that it should always be favorable for a borrower to get an extension. Since the loans are fixed-term, it doesn't make sense to repay in advance, as you always need to pay the same interest. Following this idea, it makes even less sense to partially repay.
Nevertheless, I think your concern is still valid, as ideally, we want 0 trust assumptions between borrower and lender. We could slightly change the extension logic so that the interest due is not updated (therefore only benefiting the borrower with an extension). With this change, we would only need to slightly update the CH logic.
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.
- my idea of the remediation: fix: extension design to make it fully trustless #63
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.
So now Cooler loans function as an indefinite-period call option on gOhm? Not so allowing of attacks, but seems not great, economically.
I think this needs more thinking through before the final fix review.
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.
well this is exactly what the community voted... extending the loan is the same as repaying and getting another loan, we are just forcing them to prepay the interest in advance.
Changes: