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

feat: always show price impact % #157

Merged
merged 6 commits into from
Aug 24, 2022
Merged

Conversation

JFrankfurt
Copy link
Contributor

@JFrankfurt JFrankfurt commented Aug 22, 2022

https://uniswaplabs.atlassian.net/browse/DE-117

Shows PI even when unable to fetch a stablecoin price impact value.

image

image

@vercel
Copy link

vercel bot commented Aug 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
widgets ✅ Ready (Inspect) Visit Preview Aug 23, 2022 at 10:32PM (UTC)

@vercel vercel bot temporarily deployed to Preview August 22, 2022 19:46 Inactive
@vercel vercel bot temporarily deployed to Preview August 22, 2022 19:53 Inactive
@JFrankfurt JFrankfurt marked this pull request as ready for review August 22, 2022 20:07
src/utils/prices.ts Outdated Show resolved Hide resolved
@@ -51,7 +51,7 @@ export function computeRoutes(
// `Route` constructor may throw if inputs/outputs are temporarily out of sync
// (RTK-Query always returns the latest data which may not be the right inputs/outputs)
// This is not fatal and will fix itself in future render cycles
console.error(e)
console.error('computeRoutes error', e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is not fatal, should we log something to console? Or should we only be logging with console.debug?

src/hooks/swap/useSwapInfo.tsx Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview August 23, 2022 20:20 Inactive
@vercel vercel bot temporarily deployed to Preview August 23, 2022 21:14 Inactive
@@ -85,7 +85,7 @@ export default function Output({ disabled, focused, children }: PropsWithChildre
<ThemedText.Body2 color="secondary" userSelect>
<Row>
<USDC gap={0.5} isLoading={isRouteLoading}>
{outputUSDC ? `$${formatCurrencyAmount(outputUSDC, 6, 'en', 2)}` : '-'}{' '}
{outputUSDC && `$${formatCurrencyAmount(outputUSDC, 6, 'en', 2)} `}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The space at the end of the string literal is intentional, right? I think it's necessary, just double-checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep! intentional

@@ -63,24 +64,25 @@ function useComputeSwapInfo(routerUrl?: string): SwapInfo {
useMemo(() => [currencyIn, currencyOut], [currencyIn, currencyOut])
)

// Compute slippage and impact off of the trade so that it refreshes with the trade.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retain the comments on L66-67 (or move them to useSlippage).

toString: () => toHumanReadablePercent(percent),
}
: undefined
}, [trade])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing deps (usdc values)

@JFrankfurt JFrankfurt requested a review from zzmp August 23, 2022 22:31
@vercel vercel bot temporarily deployed to Preview August 23, 2022 22:32 Inactive
@JFrankfurt JFrankfurt merged commit 89a36e6 into main Aug 24, 2022
@github-actions
Copy link

🎉 This PR is included in version 2.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants