Fix pool performance metrics display#148
Open
autochamchikim-pixel wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
30%+pool performance display with a derived performance value per asset.Root cause
The pool table had one dynamic yield column and one static placeholder:
30%+was rendered for every asset regardless of pool balance or global trader UP/L. That made the displayed pool performance nonsensical and unable to react to the actual pool state shown in the adjacent columns.Reproduction / failing case
Open the Pool page with any non-zero pool balance and a non-zero global UP/L. Before this change, the pool performance column still displayed
30%+for both ETH and USDC, so the value did not change when the pool balance or trader UP/L changed.Changed files / scope
src/components/pool/Pools.svelteonly.Implementation notes
MONTHLY_FEESkeeps the existing fee assumptions: ~95 ETH/month and ~100,000 USDC/month.feeAPYis recomputed for each supported pool asset and falls back to0when data is missing.feeAPY - traderUPL / poolBalance * 100, because positive trader UP/L is owed by the pool and reduces pool-side performance.-rather thanNaN%/Infinity%.Validation
NODE_OPTIONS=--max-old-space-size=2048 npm run build✅build/bundle.dd73831.js.Edge cases covered
Risk / compatibility
Low risk: this is a display-only change inside the Pool table. It preserves the existing monthly fee assumptions and does not modify state, transactions, stores, or contract calls.
Acceptance checklist
NaN%orInfinity%.Closes #6