🐛vault swap message (#451)
This commit is contained in:
parent
f61dd3e4e7
commit
4538bdabfd
@ -119,9 +119,8 @@ export function getVaultSwapActions(
|
||||
|
||||
if (primaryLeftoverValue.isGreaterThan(0)) {
|
||||
const swapValue = value.isLessThan(primaryLeftoverValue) ? value : primaryLeftoverValue
|
||||
const swapAmount = swapValue
|
||||
.dividedBy(prices.find((coin) => coin.denom === bnCoin.denom)?.amount || 1)
|
||||
.integerValue()
|
||||
const swapAmount = getCoinAmount(bnCoin.denom, swapValue, prices)
|
||||
|
||||
value = value.minus(swapValue)
|
||||
amount = amount.minus(swapAmount)
|
||||
primaryLeftoverValue = primaryLeftoverValue.minus(swapValue)
|
||||
@ -181,4 +180,4 @@ function getSwapAction(denomIn: string, denomOut: string, amount: BigNumber, sli
|
||||
slippage: slippage.toString(),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user