remove percent reduction in borrow and withdraw transaction

This commit is contained in:
Tyler Shipe 2021-04-28 23:15:42 -04:00
parent 825d586631
commit 64437f6a85
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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(