@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(100, quoteResponse.slippageBps, Math.round((0, numberUtils_1.toBps)(parseFloat(quoteResponse.priceImpactPct))) + 1) *
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: 0.25 + ((attemptNum ?? 0) * 0.2),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Typescript SDK for the Solauto program on the Solana blockchain",
@@ -73,7 +73,7 @@ export async function getJupSwapTransaction(
73
73
 
74
74
  const finalPriceSlippageBps = Math.round(
75
75
  Math.max(
76
- 100,
76
+ 50,
77
77
  quoteResponse.slippageBps,
78
78
  Math.round(toBps(parseFloat(quoteResponse.priceImpactPct))) + 1
79
79
  ) *
@@ -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: 0.25 + ((attemptNum ?? 0) * 0.2),
345
+ slippageBpsIncFactor: (attemptNum ?? 0) * 0.2,
346
346
  amount: rebalancingToZero
347
347
  ? client.solautoPositionState!.debt.amountUsed.baseUnit +
348
348
  BigInt(