Skip to content

Commit

Permalink
refactor: update calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
marko85MVP committed Nov 2, 2023
1 parent f0acef9 commit 977a403
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/organism/WithdrawPoolLiquidity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ const WithdrawPoolLiquidity = () => {
nativeTokenInPool
.sub(nativeTokenOut * (withdrawAmountPercentage / 100))
.lessThanOrEqualTo(nativeTokenExistentialDeposit);
const nativeMinimumTokenAmountExceededCheck =
assetInPool.sub(assetOut).lessThanOrEqualTo(assetTokenInfoMinBalance) ||
nativeTokenInPool.sub(nativeTokenOut).lessThanOrEqualTo(nativeTokenExistentialDeposit);

setMinimumTokenAmountExceeded(minimumTokenAmountExceededCheck);

Expand All @@ -265,7 +268,7 @@ const WithdrawPoolLiquidity = () => {
nativeTokenExistentialDeposit,
assetTokenInfoMinBalance
);
setMaxPercentage(minimumTokenAmountExceededCheck ? truncateDecimalNumber(max) : 100);
setMaxPercentage(nativeMinimumTokenAmountExceededCheck ? truncateDecimalNumber(max) : 100);
}
}
};
Expand Down

0 comments on commit 977a403

Please sign in to comment.