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

feat(interests): make accrueInterests public #183

Merged
merged 3 commits into from
Aug 13, 2023

Conversation

Rubilmax
Copy link
Collaborator

@Rubilmax Rubilmax commented Jul 26, 2023

MerlinEgalite
MerlinEgalite previously approved these changes Aug 11, 2023
makcandrov
makcandrov previously approved these changes Aug 11, 2023
Jean-Grimal
Jean-Grimal previously approved these changes Aug 11, 2023
pakim249CAL
pakim249CAL previously approved these changes Aug 11, 2023
@Rubilmax
Copy link
Collaborator Author

LGTM!

Copy link
Contributor

@Jean-Grimal Jean-Grimal left a comment

Choose a reason for hiding this comment

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

I don't really get the utility of this function. Who would want to call it ?
I would rather have getters for asset amount that take interest accrued into account (which would only work if the Irm's borrowRate function is view)

@pakim249CAL
Copy link
Contributor

I don't really get the utility of this function. Who would want to call it ? I would rather have getters for asset amount that take interest accrued into account (which would only work if the Irm's borrowRate function is view)

I'm pretty sure that some of the team is dead set on the borrow rate not being a view function. Therefore, this is the only way that we can have an updated total supply/total borrow for a market before executing any functions, which is important for integrators that would really like exact accounting.

@MerlinEgalite
Copy link
Contributor

I don't really get the utility of this function. Who would want to call it ? I would rather have getters for asset amount that take interest accrued into account (which would only work if the Irm's borrowRate function is view)

I'm pretty sure that some of the team is dead set on the borrow rate not being a view function. Therefore, this is the only way that we can have an updated total supply/total borrow for a market before executing any functions, which is important for integrators that would really like exact accounting.

There might be a way to expose a borrowRate function that is view though. In this case, we wouldn’t such function and we could just create the relevant getters for integrators. @MathisGD might do a PoC once he's alive

@pakim249CAL
Copy link
Contributor

For that paradigm to be secure, the view getter and the borrow rate non-view function must be ensured to always return the same result. This idea therefore seems to have the potential to become quite messy in the IRM implementation, and would require careful auditing.

IMO we should either make the borrow rate a view fn, or have an accrueInterest fn in Blue. I don't think we should try to do some weird thing that makes the IRM have two separate fns that could have the possibility to diverge from a mistake in the code.

@MathisGD MathisGD merged commit f380a04 into main Aug 13, 2023
4 checks passed
@MathisGD MathisGD deleted the feat/public-accrue-interests branch August 13, 2023 12:30
@MerlinEgalite MerlinEgalite restored the feat/public-accrue-interests branch October 26, 2023 06:38
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.

Make accrueInterests public ?
7 participants