Repository navigation
Conversation
[Medium impact] The PR appears safe to merge; the failed-refresh workspace issue is fixed. SummaryThe PR converts LP money from quote units to USD when a price is available and keeps the quote’s own label otherwise.
No new actionable issues were found. The previously numbered finding is fixed. Reviews (7) · Last reviewed commit: "fix(web): keep the last good pool when a..." · Reviewed by Greptile |
…d as dollars The /dex position strip and the portfolio's liquidity rows prefixed every LP money figure with "$", but total_value_quote, fees_earned_quote and net_pnl_quote are denominated in the pair's *quote* — SOL on an X-SOL range. That mislabelled rather than merely rounded the figure: a 0.163 SOL range worth about $20 read as "$0.16". Both /dex surfaces already fetch the pool row, so they hold the quote token's USD price (quote_token_price_usd). When it is known the figure is converted and shown in USD; when it is not, the number is left in quote units under the quote's own symbol rather than a dollar it is not. The portfolio table goes through the page's existing display-currency seam (formatValue / formatPnlValue) so it follows the same rule as every other money cell there.
For a quote with no rate path (SOL, ETH, …) the fallback labelled the still-quote-denominated figure `$`, so a 0.163 SOL range read `$0.16` — a dollar it is not. The fallback now keeps the quote's own ticker, suffixed where the /dex surfaces already put it, while a quote the dashboard has a symbol for (or a USD-pegged stablecoin) keeps its prefix.
The pool query sliced to the first 30 addresses on GeckoTerminal's request cap, so a portfolio of more than 30 ranges left the rest without a pool row — and, now that the /dex cards and the portfolio price in USD, in quote units. The cap is per request, not per portfolio: the backend already splits on the same bound, so the hook chunks each network's addresses into 30-address requests instead of truncating.
lgrawet
force-pushed
the
fix/lp-money-units-usd
branch
from
November 2, 2026 20:47
d0ac88b to
24a0065
Compare
Two regressions Greptile caught on the USD conversion: - The portfolio's fee column ran through `formatValue`, whose `$` branch rounds to two decimals, so a 0.00136 USDC fee read `$0.00` while the /dex cards still showed the digits. Fees now convert through `formatCurrencyPrecise`: `formatCurrency` at and above a cent, and the amount's own significant digits below it. - `quoteUsd` read `quote_token_price_usd` off a pool query with no refresh timer, so a /dex page left open kept multiplying by the price from when it was opened. The query now refetches on the positions' own beat (`LP_REFRESH_MS`) instead of only on focus.
The range bar multiplies by `quote_token_price_usd` from the `dex-pool-by-address` query, which had a `staleTime` but no timer — so a page left open kept pricing against the quote at the moment it loaded. Poll it on the same beat as the bins query beside it.
The page refreshes on a timer, so a rate limit or a network blip can land after the pool is already on screen. Guarding on `poolError || !pool` then replaced the chart and trade controls with the error page; only a page with nothing to show should fall back to it.
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.
Read an LP position's money in USD, not quote units labelled as dollars
The /dex position strip and the portfolio's liquidity rows prefixed every LP money figure with "$", but total_value_quote, fees_earned_quote and net_pnl_quote are denominated in the pair's quote — SOL on an X-SOL range. That mislabelled rather than merely rounded the figure: a 0.163 SOL range worth about $20 read as "$0.16".
Both /dex surfaces already fetch the pool row, so they hold the quote token's USD price (quote_token_price_usd). When it is known the figure is converted and shown in USD; when it is not, the number is left in quote units under the quote's own symbol rather than a dollar it is not. The portfolio table goes through the page's existing display-currency seam (formatValue / formatPnlValue) so it follows the same rule as every other money cell there.