-
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
Balance getter discussion #3
Comments
If you are using this getter internally, so. I'm against creating external getters only for external usage. |
Last time we talked you liked that idea, no ? The idea would be to avoid having to rewrite the logic in javascript |
I believe we're leaning towards minimalism in Blue, so I'd instead suggest to only expose the contract's accounting variables (shares, totalShares, totalAssets) and expose a getter to know how many interests have to be accrued to storage at next accrual. In fact, even the I am also ok to expose the
|
Is there a problem of exposing the |
accrueInterests is not a view, so this vision is like compound v2: You cannot query the up-to-date balance without making a call. |
I want to emphasize this, because it would be minimalist (and may thus please @MathisGD):
|
At a first sight, I don't see any issue with putting it public (effect really similar to supplying and withdrawing 1 wei of collat).
Interesting idea ! |
So this discussion is now only about whether to expose getters, and which one of them. I'll highlight some comment I made above:
So a getter for the amount of collateral, a getter for the supply shares and a getter for the borrow shares is enough to me. It is also necessary to isolate accounting to logic to appropriate libraries, so integrators only have to copy-paste/import isolated logic. |
Should we close this? |
What is the final decision about getters ? |
The current code expose storage getters and should be enough, provided #129 is resolved or anything similar. I'd argue this issue is thus redundant now Balancer getters seem to be overkill as an integrator is in most usecases better off querying the shares, total supply (resp. borrow), total shares and calculate it themselves ; which also enables them to calculate the balance based on hypothetical market changes |
Ok so we won't expose getters for underlying balances and assume that integrators will compute it themselves via the shares storage getters and the shareMath lib ? |
Yes I think we can provide libraries or code snippets for that |
And we already do, via |
References:
The text was updated successfully, but these errors were encountered: