LHYPE TVL update using endpoint NAV (valueInBase sum) #16807
Merged
+22
−25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
package-lock.jsonfile as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CIUpdate reason:
From the beginning, the TVL data for LHYPE has been incorrectly calculated. It pulled tokenAddress values from the Nucleus endpoint and then called balanceOf(vault) for each token via sumTokens2. I went through each tokenAddress using this method and observed several issues with this approach:
So to sum up, I know you ideally prefer fetching data from blockchain, but this approach miscalculated the LHYPE TVL from the start. I guess just fetching the LHYPE totalSupply() from its contract and multiplying it by the LHYPE price wouldn't be sufficient because then we would lose the TVL token breakdown, or am I mistaken there?