max token withdraw shouldnt use maxborrow if its a trustless token
This commit is contained in:
parent
4aa669552c
commit
564c4bdee8
|
@ -21,6 +21,8 @@ export const getMaxWithdrawForBank = (
|
|||
)
|
||||
const maxWithdraw = allowBorrow
|
||||
? Decimal.min(vaultBalance, maxBorrow)
|
||||
: bank.initAssetWeight.toNumber() === 0
|
||||
? Decimal.min(accountBalance, vaultBalance)
|
||||
: Decimal.min(accountBalance, vaultBalance, maxBorrow)
|
||||
return Decimal.max(0, maxWithdraw)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue