From cb3cc9b16960a5026d6e64b8331c7640602463ee Mon Sep 17 00:00:00 2001 From: tjs Date: Sat, 27 Aug 2022 01:28:52 -0400 Subject: [PATCH] fix vault balance in withdraw modal --- components/modals/WithdrawModal.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/modals/WithdrawModal.tsx b/components/modals/WithdrawModal.tsx index b4d0f89f..22472ce9 100644 --- a/components/modals/WithdrawModal.tsx +++ b/components/modals/WithdrawModal.tsx @@ -35,10 +35,7 @@ const getMaxWithdrawWithoutBorrow = ( mangoAccount: MangoAccount ): number => { const accountBalance = mangoAccount?.getTokenBalanceUi(bank) - const vaultBalance = floorToDecimal( - bank.uiDeposits() - bank.uiBorrows(), - bank.mintDecimals - ) + const vaultBalance = group.getTokenVaultBalanceByMintUi(bank.mint) const maxBorrow = mangoAccount?.getMaxWithdrawWithBorrowForTokenUi( group, bank.mint