fix token max vault rounding
This commit is contained in:
parent
58f55a22b0
commit
313a47e050
|
@ -48,6 +48,7 @@ export const getTokenInMax = (
|
|||
const maxAmountWithoutMargin = inputTokenBalance.gt(0)
|
||||
? inputTokenBalance
|
||||
: new Decimal(0)
|
||||
|
||||
const maxUiAmountWithBorrow = floorToDecimal(
|
||||
mangoAccount.getMaxSourceUiForTokenSwap(
|
||||
group,
|
||||
|
@ -57,8 +58,10 @@ export const getTokenInMax = (
|
|||
),
|
||||
inputBank.mintDecimals
|
||||
)
|
||||
const inputBankVaultBalance = group.getTokenVaultBalanceByMintUi(
|
||||
inputBank.mint
|
||||
|
||||
const inputBankVaultBalance = floorToDecimal(
|
||||
group.getTokenVaultBalanceByMintUi(inputBank.mint),
|
||||
inputBank.mintDecimals
|
||||
)
|
||||
|
||||
const maxAmount = useMargin
|
||||
|
|
Loading…
Reference in New Issue