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

Chore: Factor vaultRpc out of v2 Average APY calculation #127

Open
murderteeth opened this issue Jan 17, 2023 · 0 comments
Open

Chore: Factor vaultRpc out of v2 Average APY calculation #127

murderteeth opened this issue Jan 17, 2023 · 0 comments
Labels

Comments

@murderteeth
Copy link
Collaborator

murderteeth commented Jan 17, 2023

The current apy code has vaultRpc passed into the compute function, then calls pricePerShare at different historic points, for example:
https://github.com/yearn/dashboard_ui/blob/208a9fdf9bb3a48406dbec58646a8a7991069e10/src/apy/v2/averaged.ts#L19

Better would be to make those pps calls ahead of computation, passing in an array of historic pps instead of vaultRpc. This way the pps history is available for other methods of computing APY and makes the compute function more testable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant