totalDepositBalanceInCrypto was being computed incorrectly if there were earningsItems where includedInPoolBalance is true and they are in a different token than the deposit token. Fixed this and added a test, also compute totalDepositBalanceInLocalCurrency using totalDepositBalanceInCrypto rather than doing another filter/reduce.
Test plan
Updated unit tests and added new ones to prevent same bug in the future
Related issues
N/A
Backwards compatibility
Current pools don't have any earningItems where includedInPoolBalance is true so no issue, there will be a bug for older versions for Beefy pools though if we separate out compound interest (will show incorrect value).
Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will:
[X] Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)
Description
totalDepositBalanceInCrypto
was being computed incorrectly if there were earningsItems whereincludedInPoolBalance
is true and they are in a different token than the deposit token. Fixed this and added a test, also computetotalDepositBalanceInLocalCurrency
usingtotalDepositBalanceInCrypto
rather than doing another filter/reduce.Test plan
Updated unit tests and added new ones to prevent same bug in the future
Related issues
Backwards compatibility
Current pools don't have any earningItems where
includedInPoolBalance
is true so no issue, there will be a bug for older versions for Beefy pools though if we separate out compound interest (will show incorrect value).Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will: