diff --git a/components/swap/JupiterRouteInfo.tsx b/components/swap/JupiterRouteInfo.tsx index a63484ec..e862a010 100644 --- a/components/swap/JupiterRouteInfo.tsx +++ b/components/swap/JupiterRouteInfo.tsx @@ -20,6 +20,7 @@ import { PencilIcon, ArrowsRightLeftIcon, CheckCircleIcon, + ArrowRightIcon, } from '@heroicons/react/20/solid' import { useTranslation } from 'next-i18next' import Image from 'next/image' @@ -243,36 +244,46 @@ const JupiterRouteInfo = ({ /> -

- {`${formatFixedDecimals( +

+ {`${formatFixedDecimals( amountIn.toNumber() )}`}{' '} - {`${inputTokenInfo!.symbol} for`}{' '} - {`${formatFixedDecimals( + {inputTokenInfo!.symbol} + + {`${formatFixedDecimals( amountOut.toNumber() )}`}{' '} {`${outputTokenInfo.symbol}`}

-

{t('swap:rate')}

-

+

{swapRate ? ( <> - 1 {inputTokenInfo!.name} ≈{' '} + 1{' '} + + {inputTokenInfo!.name} ≈{' '} + {formatFixedDecimals(amountOut.div(amountIn).toNumber())}{' '} - {outputTokenInfo?.symbol} + + {outputTokenInfo?.symbol} + ) : ( <> - 1 {outputTokenInfo?.symbol} ≈{' '} + 1{' '} + + {outputTokenInfo?.symbol} ≈{' '} + {formatFixedDecimals(amountIn.div(amountOut).toNumber())}{' '} - {inputTokenInfo!.name} + + {inputTokenInfo!.symbol} + )}

@@ -285,14 +296,14 @@ const JupiterRouteInfo = ({ {coingeckoPrices?.outputCoingeckoPrice && coingeckoPrices?.inputCoingeckoPrice ? (
{Decimal.abs(coinGeckoPriceDifference).toFixed(1)}%{' '} - {`${ + {`${ coinGeckoPriceDifference.lte(0) ? 'cheaper' : 'more expensive' @@ -307,13 +318,15 @@ const JupiterRouteInfo = ({ {t('swap:minimum-received')}

{outputTokenInfo?.decimals ? ( -

+

{formatDecimal( JSBI.toNumber(selectedRoute?.otherAmountThreshold) / 10 ** outputTokenInfo.decimals || 1, outputTokenInfo.decimals )}{' '} - {outputTokenInfo?.symbol} + + {outputTokenInfo?.symbol} +

) : null}
@@ -321,27 +334,32 @@ const JupiterRouteInfo = ({ <>

{t('borrow-amount')}

-

- ~ {formatFixedDecimals(borrowAmount)} {inputTokenInfo?.symbol} +

+ ~ {formatFixedDecimals(borrowAmount)}{' '} + + {inputTokenInfo?.symbol} +

Borrow Fee

-

+

~{' '} {formatFixedDecimals( amountIn .mul(inputBank!.loanOriginationFeeRate.toFixed()) .toNumber() )}{' '} - {inputBank!.name} + + {inputBank!.name} +

) : null}

Est. {t('swap:slippage')}

-

+

{selectedRoute?.priceImpactPct * 100 < 0.1 ? '< 0.1%' : `${(selectedRoute?.priceImpactPct * 100).toFixed(2)}%`} @@ -377,7 +395,7 @@ const JupiterRouteInfo = ({

{t('fee')}

-

+

≈ ${feeValue?.toFixed(2)}

@@ -395,12 +413,15 @@ const JupiterRouteInfo = ({ })}

{feeToken?.decimals && ( -

+

{( JSBI.toNumber(info.lpFee?.amount) / Math.pow(10, feeToken.decimals) ).toFixed(6)}{' '} - {feeToken?.symbol} ({info.lpFee?.pct * 100}%) + + {feeToken?.symbol} + {' '} + ({info.lpFee?.pct * 100}%)

)}
diff --git a/components/swap/SwapForm.tsx b/components/swap/SwapForm.tsx index a073d6eb..e7e5aaa8 100644 --- a/components/swap/SwapForm.tsx +++ b/components/swap/SwapForm.tsx @@ -203,7 +203,7 @@ const SwapForm = () => { >
{ /> { /> setShowSettings(false)} />
-

{t('swap')}

+

{t('swap')}