-
Notifications
You must be signed in to change notification settings - Fork 66
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
Should we use a non-view function for the borrow rate? #150
Comments
It is necessary to have a permissionless view function on the IRM to be able to calculate accrued interests on-chain, without having to update the market on Blue. So if the Additional thoughts on this: If it's not a view, it needs to be only accessible by Blue, otherwise anyone can change the storage of the IRM without updating Blue (just like Morpho optimizers on Compound/Aave). I'd like to have @morpho-labs/research's POV on this |
Could you give an example of an IRM that would need to update storage at each |
I believe a canonic example would be a second-order controller IRM, which would require storing the first-order derivative of the rate somewhere (the rate being always stored and accessible on Blue). |
Maybe one that is depending on something external like the votality of the different assets, the available liquidity onchain, etc. This might be the first IRM that we implement obviously but if it's a view then it's clear that it won't be possible. |
Btw this is possible using solidity so I don't really see the blocker of not removing |
If the function as defined in the interface doesn't have the |
Is it a requirement for |
In the PR this issue originates from yes, in order to expose a getter for accrued interests, which requires querying the borrow rate. |
I recently changed my mind and I'm questioning the relevance of such getter 😅 |
why? Seems that everyone was against |
We should allow for non-view IRM, and it's current state of the code so I'm closing. |
This may not be possible to have a view function to get the borrow rate. Maybe we should consider that it won't be a view function at some point
Originally posted by @MerlinEgalite in #138 (comment)
The text was updated successfully, but these errors were encountered: