-
Notifications
You must be signed in to change notification settings - Fork 10
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
Upfront interest #170
Upfront interest #170
Conversation
@@ -4265,9 +4063,9 @@ contract("BorrowerOperations", async (accounts) => { | |||
); | |||
|
|||
const expectedTCR = whaleColl | |||
.add(liquidatedColl) | |||
.mul(liqPrice) | |||
.div(whaleTotalDebt.add(liquidatedDebt)); |
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.
Yikes, someone's been using the wrong formatter 😬
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.
Oh, that’s me, sorry (I guess it was my editor). I’ll fix it and merge it into main, hopefully these changes, and maybe some conflicts too, go away.
This will not be merged as it won't work with batch delegation; we will do an upfront fee instead. |
Introduces "upfront interest", which is a non-interest-bearing debt added on top of the Trove's interest-bearing (recorded) debt any time BOLD is borrowed, equal to
UPFRONT_INTEREST_PERIOD
's (7 days) worth of interest on the borrowed amount. Over time, as interest accrues, it is cancelled out by upfront interest, until no upfront interest remains. Thus, a Trove's apparent (entire) debt starts out being higher than its recorded debt, and stays constant until all the upfront interest is used up, which normally takesUPFRONT_INTEREST_PERIOD
.Unused upfront interest is forgone (either partially or fully) whenever one of the following happens:
An interest rate adjustment forgoes all unused upfront interest. In case of a debt-reduction, the amount is split proportionally between the (would-be) recorded debt and unused upfront interest. For example: if half of the Trove's entire debt (including unused upfront interest) is repaid, half of the unused upfront interest is forgone. The rest of the repayment reduces the Trove's new recorded (interest-bearing) debt.
Forgone upfront interest is sent to the interest router along with newly minted aggregate interest. (Technically, the payment for the upfront interest is first burnt together with the rest of the Trove's debt-reduction, but is later re-minted along with the newly minted interest).