-
Notifications
You must be signed in to change notification settings - Fork 184
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
24aedc1
to
ebf5068
Compare
@@ -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) |
There was a problem hiding this comment.
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
?
@@ -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)} `} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
).
src/hooks/usePriceImpact.ts
Outdated
toString: () => toHumanReadablePercent(percent), | ||
} | ||
: undefined | ||
}, [trade]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing deps (usdc values)
🎉 This PR is included in version 2.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
https://uniswaplabs.atlassian.net/browse/DE-117
Shows PI even when unable to fetch a stablecoin price impact value.