@haven-fi/solauto-sdk 1.0.504 → 1.0.505
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.
@@ -185,13 +185,13 @@ async function getJupSwapRebalanceDetails(client, values, targetLiqUtilizationRa
|
|
185
185
|
let jupQuote = undefined;
|
186
186
|
if (targetLiqUtilizationRateBps === 0) {
|
187
187
|
let priceImpact = 0;
|
188
|
-
inputAmount += BigInt(Math.round(Number(inputAmount) * 0.
|
188
|
+
inputAmount += BigInt(Math.round(Number(inputAmount) * 0.001));
|
189
189
|
do {
|
190
190
|
const res = await (0, priceUtils_1.getPriceImpact)((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(input.mint), inputAmount + BigInt(Math.round(Number(inputAmount) * priceImpact)), (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(output.mint));
|
191
191
|
priceImpact = res.priceImpact;
|
192
192
|
jupQuote = res.quote;
|
193
|
-
inputAmount = BigInt(parseInt(res.quote.inAmount)) + BigInt(Math.round(Number(inputAmount) * 0.
|
194
|
-
} while (parseInt(jupQuote.outAmount) < outputAmount && priceImpact > 0.
|
193
|
+
inputAmount = BigInt(parseInt(res.quote.inAmount)) + BigInt(Math.round(Number(inputAmount) * 0.001));
|
194
|
+
} while (parseInt(jupQuote.outAmount) < outputAmount && priceImpact > 0.001);
|
195
195
|
}
|
196
196
|
const addPadding = exactOut;
|
197
197
|
return {
|
package/package.json
CHANGED
@@ -392,7 +392,7 @@ export async function getJupSwapRebalanceDetails(
|
|
392
392
|
let jupQuote: QuoteResponse | undefined = undefined;
|
393
393
|
if (targetLiqUtilizationRateBps === 0) {
|
394
394
|
let priceImpact: number = 0;
|
395
|
-
inputAmount += BigInt(Math.round(Number(inputAmount) * 0.
|
395
|
+
inputAmount += BigInt(Math.round(Number(inputAmount) * 0.001));
|
396
396
|
|
397
397
|
do {
|
398
398
|
const res = await getPriceImpact(
|
@@ -402,8 +402,8 @@ export async function getJupSwapRebalanceDetails(
|
|
402
402
|
);
|
403
403
|
priceImpact = res.priceImpact;
|
404
404
|
jupQuote = res.quote;
|
405
|
-
inputAmount = BigInt(parseInt(res.quote.inAmount)) + BigInt(Math.round(Number(inputAmount) * 0.
|
406
|
-
} while (parseInt(jupQuote.outAmount) < outputAmount && priceImpact > 0.
|
405
|
+
inputAmount = BigInt(parseInt(res.quote.inAmount)) + BigInt(Math.round(Number(inputAmount) * 0.001));
|
406
|
+
} while (parseInt(jupQuote.outAmount) < outputAmount && priceImpact > 0.001);
|
407
407
|
}
|
408
408
|
|
409
409
|
const addPadding = exactOut;
|