Chore: Factor vaultRpc out of v2 Average APY calculation
Opened this issue · 0 comments
murderteeth commented
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.