fix vault balance in withdraw modal

This commit is contained in:
tjs 2022-08-27 01:28:52 -04:00
parent d0875ba345
commit cb3cc9b169
1 changed files with 1 additions and 4 deletions

View File

@ -35,10 +35,7 @@ const getMaxWithdrawWithoutBorrow = (
mangoAccount: MangoAccount mangoAccount: MangoAccount
): number => { ): number => {
const accountBalance = mangoAccount?.getTokenBalanceUi(bank) const accountBalance = mangoAccount?.getTokenBalanceUi(bank)
const vaultBalance = floorToDecimal( const vaultBalance = group.getTokenVaultBalanceByMintUi(bank.mint)
bank.uiDeposits() - bank.uiBorrows(),
bank.mintDecimals
)
const maxBorrow = mangoAccount?.getMaxWithdrawWithBorrowForTokenUi( const maxBorrow = mangoAccount?.getMaxWithdrawWithBorrowForTokenUi(
group, group,
bank.mint bank.mint