diff --git a/components/WithdrawModal.tsx b/components/WithdrawModal.tsx index 42edded5..d93b68df 100644 --- a/components/WithdrawModal.tsx +++ b/components/WithdrawModal.tsx @@ -77,7 +77,9 @@ const WithdrawModal = ({ isOpen, onClose }) => { selectedMangoGroup, prices ) - const assetsVal = assetsValBeforeTokenBal - getMaxForSelectedAccount() + const assetsVal = + assetsValBeforeTokenBal - getMaxForSelectedAccount() * prices[tokenIndex] + const currentLiabs = selectedMarginAccount.getLiabsVal( selectedMangoGroup, prices diff --git a/utils/mango.tsx b/utils/mango.tsx index 6d928648..1b8914a7 100644 --- a/utils/mango.tsx +++ b/utils/mango.tsx @@ -411,7 +411,7 @@ export async function borrowAndWithdraw( const nativeWithdrawQuantity = new BN( Math.floor( withdrawQuantity * Math.pow(10, mangoGroup.mintDecimals[tokenIndex]) - ) * 0.98 + ) ) const withdrawInstruction = makeWithdrawInstruction(