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

Upfront interest #170

Closed
wants to merge 12 commits into from
Closed

Upfront interest #170

wants to merge 12 commits into from

Conversation

danielattilasimon
Copy link
Collaborator

@danielattilasimon danielattilasimon commented May 15, 2024

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 takes UPFRONT_INTEREST_PERIOD.

Unused upfront interest is forgone (either partially or fully) whenever one of the following happens:

  • A Trove's interest rate is adjusted.
  • A Trove's debt is reduced through either:
    • repayment,
    • redemption,
    • closing (normally or through liquidation).

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).

@danielattilasimon danielattilasimon marked this pull request as ready for review May 15, 2024 09:16
@@ -4265,9 +4063,9 @@ contract("BorrowerOperations", async (accounts) => {
);

const expectedTCR = whaleColl
.add(liquidatedColl)
.mul(liqPrice)
.div(whaleTotalDebt.add(liquidatedDebt));
Copy link
Collaborator Author

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 😬

Copy link
Collaborator

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.

@bingen bingen linked an issue May 15, 2024 that may be closed by this pull request
@danielattilasimon
Copy link
Collaborator Author

This will not be merged as it won't work with batch delegation; we will do an upfront fee instead.

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.

Upfront interest payment on borrowing and interest adjustment
2 participants