Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top Movers should show the tokens with top price growth #234

Open
NicholasCui opened this issue Jun 30, 2022 · 0 comments
Open

Top Movers should show the tokens with top price growth #234

NicholasCui opened this issue Jun 30, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@NicholasCui
Copy link

Bug Description
On https://info.uniswap.org/#/tokens, the Top Movers component show the tokens sorted by the absolute value of priceUSDChange.

The logic of sort:

const topPriceIncrease = useMemo(() => {
return Object.values(allTokens)
.sort(({ data: a }, { data: b }) => {
return a && b ? (Math.abs(a?.priceUSDChange) > Math.abs(b?.priceUSDChange) ? -1 : 1) : -1
})
.slice(0, Math.min(20, Object.values(allTokens).length))
}, [allTokens])

Steps to Reproduce

  1. Go to All Tokens

Expected Behavior
Should sort the tokens by priceUSDChange.

Additional Context
image

@NicholasCui NicholasCui added the bug Something isn't working label Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant