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

Applying interest rates to a Trove’s debt (borrower ops, batch, SP ops, sending funds to SP) #56

Closed
RickGriff opened this issue Jan 18, 2024 · 1 comment

Comments

@RickGriff
Copy link
Collaborator

RickGriff commented Jan 18, 2024

Applying interest rates to a Trove’s debt

Calculating pending interest

  • Do debt * (1+interest_rate)**t where t is time passed in chosen time units since last update (blocks, minutes, etc), and interest_rate is the per-time-unit rate set by the borrower

Applying the interest

  • Update the recorded debt and record the current block.timestamp as lastUpdateTimestamp
    A Trove debt getter function returns recorded debt, pending interest, and up-to-date interest (i.e. including pending interest)
  • Mint the BOLD, and send it to the destination contract (e.g. the yield router?)

Interest is calculated and applied when:

  • Borrower touches their Trove
  • Permissionless batch function appyInterestToTroves is called with a list of Troves passed as a param
  • SP deposits are touched. The SP functions take a single Trove address (/NFT ID), and calc and apply its interest
@bingen
Copy link
Collaborator

bingen commented Apr 10, 2024

See #85 and #102

@bingen bingen closed this as completed Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants