@haven-fi/solauto-sdk 1.0.55 → 1.0.56
Sign up to get free protection for your applications and to get access to all the features.
@@ -34,7 +34,7 @@ async function getJupSwapTransaction(signer, swapDetails, attemptNum) {
|
|
34
34
|
slippageBps: 10,
|
35
35
|
maxAccounts: 60,
|
36
36
|
}), 3);
|
37
|
-
const finalPriceSlippageBps = Math.round(Math.max(
|
37
|
+
const finalPriceSlippageBps = Math.round(Math.max(50, quoteResponse.slippageBps, Math.round((0, numberUtils_1.toBps)(parseFloat(quoteResponse.priceImpactPct))) + 1) *
|
38
38
|
(1 + (swapDetails.slippageBpsIncFactor ?? 0)));
|
39
39
|
quoteResponse.slippageBps = finalPriceSlippageBps;
|
40
40
|
console.log(quoteResponse);
|
@@ -186,7 +186,7 @@ function getJupSwapRebalanceDetails(client, values, targetLiqUtilizationRateBps,
|
|
186
186
|
inputMint: (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(input.mint),
|
187
187
|
outputMint: (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(output.mint),
|
188
188
|
destinationWallet: client.solautoPosition,
|
189
|
-
slippageBpsIncFactor:
|
189
|
+
slippageBpsIncFactor: (attemptNum ?? 0) * 0.2,
|
190
190
|
amount: rebalancingToZero
|
191
191
|
? client.solautoPositionState.debt.amountUsed.baseUnit +
|
192
192
|
BigInt(Math.round(Number(client.solautoPositionState.debt.amountUsed.baseUnit) *
|
package/package.json
CHANGED
@@ -342,7 +342,7 @@ export function getJupSwapRebalanceDetails(
|
|
342
342
|
inputMint: toWeb3JsPublicKey(input.mint),
|
343
343
|
outputMint: toWeb3JsPublicKey(output.mint),
|
344
344
|
destinationWallet: client.solautoPosition,
|
345
|
-
slippageBpsIncFactor:
|
345
|
+
slippageBpsIncFactor: (attemptNum ?? 0) * 0.2,
|
346
346
|
amount: rebalancingToZero
|
347
347
|
? client.solautoPositionState!.debt.amountUsed.baseUnit +
|
348
348
|
BigInt(
|