File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import { useShallow } from 'zustand/shallow';
2828
2929import { usePreviewRedeem } from './hooks/usePreviewRedeem' ;
3030import { UnStakeActions } from './UnstakeModalActions' ;
31+ import { normalizeBN } from '@aave/math-utils' ;
3132
3233export enum RedeemType {
3334 NORMAL ,
@@ -61,7 +62,12 @@ export const UnStakeModalContent = ({
6162 currentChainId
6263 ) ;
6364
64- const redeemableAmount = stakeData ?. formattedBalances . stakeTokenRedeemableAmount || '0' ;
65+ const redeemableAmountBN = BigNumber . min (
66+ stakeData ?. balances . stakeTokenRedeemableAmount || '0' ,
67+ stakeData ?. cooldownData . cooldownAmount || '0'
68+ ) ;
69+
70+ const redeemableAmount = normalizeBN ( redeemableAmountBN . toString ( ) , stakeData . decimals ) . toString ( ) ;
6571
6672 const isMaxSelected = amount === '-1' ;
6773 const amountToRedeem = isMaxSelected ? redeemableAmount : amount ;
You can’t perform that action at this time.
0 commit comments