@haven-fi/solauto-sdk 1.0.119 → 1.0.120
Sign up to get free protection for your applications and to get access to all the features.
@@ -34,7 +34,9 @@ async function getJupSwapTransaction(signer, swapDetails, attemptNum) {
|
|
34
34
|
slippageBps: 10,
|
35
35
|
maxAccounts: !swapDetails.exactOut ? 60 : undefined,
|
36
36
|
}), 3);
|
37
|
-
const finalPriceSlippageBps = Math.round(Math.max(
|
37
|
+
const finalPriceSlippageBps = Math.round(Math.max(
|
38
|
+
// 50,
|
39
|
+
quoteResponse.slippageBps, Math.round((0, numberUtils_1.toBps)(parseFloat(quoteResponse.priceImpactPct))) + 1) *
|
38
40
|
(1 + (swapDetails.slippageBpsIncFactor ?? 0)));
|
39
41
|
quoteResponse.slippageBps = finalPriceSlippageBps;
|
40
42
|
console.log(quoteResponse);
|
@@ -174,7 +174,7 @@ function getJupSwapRebalanceDetails(client, values, targetLiqUtilizationRateBps,
|
|
174
174
|
inputMint: (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(input.mint),
|
175
175
|
outputMint: (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(output.mint),
|
176
176
|
destinationWallet: client.solautoPosition,
|
177
|
-
slippageBpsIncFactor: 0.25 + (attemptNum ?? 0) * 0.2,
|
177
|
+
// slippageBpsIncFactor: 0.25 + (attemptNum ?? 0) * 0.2,
|
178
178
|
amount: rebalancingToZero
|
179
179
|
? client.solautoPositionState.debt.amountUsed.baseUnit +
|
180
180
|
BigInt(Math.round(Number(client.solautoPositionState.debt.amountUsed.baseUnit) *
|
package/package.json
CHANGED
@@ -355,7 +355,7 @@ export function getJupSwapRebalanceDetails(
|
|
355
355
|
inputMint: toWeb3JsPublicKey(input.mint),
|
356
356
|
outputMint: toWeb3JsPublicKey(output.mint),
|
357
357
|
destinationWallet: client.solautoPosition,
|
358
|
-
slippageBpsIncFactor: 0.25 + (attemptNum ?? 0) * 0.2,
|
358
|
+
// slippageBpsIncFactor: 0.25 + (attemptNum ?? 0) * 0.2,
|
359
359
|
amount: rebalancingToZero
|
360
360
|
? client.solautoPositionState!.debt.amountUsed.baseUnit +
|
361
361
|
BigInt(
|