From f3bb03064a4b4835cd544cb0e5c46054579b82dd Mon Sep 17 00:00:00 2001 From: hz002 Date: Wed, 31 Dec 2025 14:36:38 +0800 Subject: [PATCH] fix: low decimal format --- .../RepayWithCollateralActionsViaParaswap.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/transactions/Swap/actions/RepayWithCollateral/RepayWithCollateralActionsViaParaswap.tsx b/src/components/transactions/Swap/actions/RepayWithCollateral/RepayWithCollateralActionsViaParaswap.tsx index d8b6625dec..33f9a20ad9 100644 --- a/src/components/transactions/Swap/actions/RepayWithCollateral/RepayWithCollateralActionsViaParaswap.tsx +++ b/src/components/transactions/Swap/actions/RepayWithCollateral/RepayWithCollateralActionsViaParaswap.tsx @@ -1,6 +1,7 @@ import { normalize, normalizeBN, valueToBigNumber } from '@aave/math-utils'; import { OrderStatus } from '@cowprotocol/cow-sdk'; import { Trans } from '@lingui/macro'; +import { BigNumber as BigNumberJS } from 'bignumber.js'; import { BigNumber, PopulatedTransaction } from 'ethers'; import { Dispatch } from 'react'; import { calculateSignedAmount } from 'src/hooks/paraswap/common'; @@ -127,6 +128,7 @@ export const RepayWithCollateralActionsViaParaswap = ({ // Account slippage to make sure we have enough collateral to repay with repayWithAmount = valueToBigNumber(state.outputAmount || '0') .multipliedBy(1 + Number(state.slippage) / 100) + .decimalPlaces(state.destinationToken.decimals, BigNumberJS.ROUND_CEIL) .toFixed(state.destinationToken.decimals); } else { // If buy order i want use exactly the collateral to repay with amount