remove percent reduction in borrow and withdraw transaction
This commit is contained in:
parent
825d586631
commit
64437f6a85
|
@ -77,7 +77,9 @@ const WithdrawModal = ({ isOpen, onClose }) => {
|
||||||
selectedMangoGroup,
|
selectedMangoGroup,
|
||||||
prices
|
prices
|
||||||
)
|
)
|
||||||
const assetsVal = assetsValBeforeTokenBal - getMaxForSelectedAccount()
|
const assetsVal =
|
||||||
|
assetsValBeforeTokenBal - getMaxForSelectedAccount() * prices[tokenIndex]
|
||||||
|
|
||||||
const currentLiabs = selectedMarginAccount.getLiabsVal(
|
const currentLiabs = selectedMarginAccount.getLiabsVal(
|
||||||
selectedMangoGroup,
|
selectedMangoGroup,
|
||||||
prices
|
prices
|
||||||
|
|
|
@ -411,7 +411,7 @@ export async function borrowAndWithdraw(
|
||||||
const nativeWithdrawQuantity = new BN(
|
const nativeWithdrawQuantity = new BN(
|
||||||
Math.floor(
|
Math.floor(
|
||||||
withdrawQuantity * Math.pow(10, mangoGroup.mintDecimals[tokenIndex])
|
withdrawQuantity * Math.pow(10, mangoGroup.mintDecimals[tokenIndex])
|
||||||
) * 0.98
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
const withdrawInstruction = makeWithdrawInstruction(
|
const withdrawInstruction = makeWithdrawInstruction(
|
||||||
|
|
Loading…
Reference in New Issue