@haven-fi/solauto-sdk 1.0.427 → 1.0.429
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,7 +60,7 @@ async function getJupSwapTransaction(signer, swapDetails, attemptNum) {
|
|
60
60
|
(0, generalUtils_1.consoleLog)("Increased price impact bps:", finalPriceImpactBps);
|
61
61
|
if (swapDetails.addPadding) {
|
62
62
|
(0, generalUtils_1.consoleLog)("Raw inAmount:", quoteResponse.inAmount);
|
63
|
-
const inc = Math.max((0, numberUtils_1.fromBps)(finalPriceImpactBps), (0, numberUtils_1.fromBps)(
|
63
|
+
const inc = Math.max((0, numberUtils_1.fromBps)(finalPriceImpactBps), (0, numberUtils_1.fromBps)(finalPriceSlippageBps) / 4);
|
64
64
|
(0, generalUtils_1.consoleLog)("Inc:", inc);
|
65
65
|
quoteResponse.inAmount = Math.round(parseInt(quoteResponse.inAmount) + parseInt(quoteResponse.inAmount) * inc).toString();
|
66
66
|
(0, generalUtils_1.consoleLog)("Increased inAmount:", quoteResponse.inAmount);
|
@@ -166,7 +166,7 @@ function getJupSwapRebalanceDetails(client, values, targetLiqUtilizationRateBps,
|
|
166
166
|
: (0, numberUtils_1.toBaseUnit)(usdToSwap / (0, priceUtils_1.safeGetPrice)(output.mint), output.decimals);
|
167
167
|
const exactOut = targetLiqUtilizationRateBps === 0 || values.repayingCloseToMaxLtv;
|
168
168
|
const exactIn = !exactOut;
|
169
|
-
const addPadding = targetLiqUtilizationRateBps === 0;
|
169
|
+
const addPadding = targetLiqUtilizationRateBps === 0 || exactOut;
|
170
170
|
return {
|
171
171
|
inputMint: (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(input.mint),
|
172
172
|
outputMint: (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(output.mint),
|
package/package.json
CHANGED
@@ -119,7 +119,7 @@ export async function getJupSwapTransaction(
|
|
119
119
|
consoleLog("Raw inAmount:", quoteResponse.inAmount);
|
120
120
|
const inc = Math.max(
|
121
121
|
fromBps(finalPriceImpactBps),
|
122
|
-
fromBps(
|
122
|
+
fromBps(finalPriceSlippageBps) / 4
|
123
123
|
);
|
124
124
|
consoleLog("Inc:", inc);
|
125
125
|
quoteResponse.inAmount = Math.round(
|
@@ -357,7 +357,7 @@ export function getJupSwapRebalanceDetails(
|
|
357
357
|
targetLiqUtilizationRateBps === 0 || values.repayingCloseToMaxLtv;
|
358
358
|
const exactIn = !exactOut;
|
359
359
|
|
360
|
-
const addPadding = targetLiqUtilizationRateBps === 0;
|
360
|
+
const addPadding = targetLiqUtilizationRateBps === 0 || exactOut;
|
361
361
|
|
362
362
|
return {
|
363
363
|
inputMint: toWeb3JsPublicKey(input.mint),
|