@strkfarm/sdk 1.1.51 → 1.1.52

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.
@@ -94955,6 +94955,7 @@ spurious results.`);
94955
94955
  * @param params
94956
94956
  */
94957
94957
  async getVesuMultiplyCall(params) {
94958
+ const maxEkuboPriceImpact = params.maxEkuboPriceImpact || 0.01;
94958
94959
  const vesuAdapter1 = this.getVesuSameTokenAdapter();
94959
94960
  const legLTV = await vesuAdapter1.getLTVConfig(this.config);
94960
94961
  logger2.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
@@ -94990,7 +94991,8 @@ spurious results.`);
94990
94991
  marginAmount,
94991
94992
  debtAmount,
94992
94993
  lstDexPriceInUnderlying: dexPrice,
94993
- isIncrease: debtAmount.greaterThan(0)
94994
+ isIncrease: debtAmount.greaterThan(0),
94995
+ maxEkuboPriceImpact
94994
94996
  });
94995
94997
  }
94996
94998
  getLSTUnderlyingTokenInfo() {
@@ -95167,7 +95169,7 @@ spurious results.`);
95167
95169
  // negative for exact amount out
95168
95170
  );
95169
95171
  logger2.verbose(`${this.getTag()}::getModifyLeverCall leverSwapQuote: ${JSON.stringify(leverSwapQuote)}`);
95170
- assert3(leverSwapQuote.price_impact < 0.01, "getIncreaseLeverCall: Price impact is too high [Debt swap]");
95172
+ assert3(leverSwapQuote.price_impact <= params.maxEkuboPriceImpact, "getIncreaseLeverCall: Price impact is too high [Debt swap]");
95171
95173
  const leverSwap = ekuboQuoter.getVesuMultiplyQuote(leverSwapQuote, fromToken, toToken);
95172
95174
  logger2.verbose(`${this.getTag()}::getModifyLeverCall leverSwap: ${JSON.stringify(leverSwap)}`);
95173
95175
  let minLSTReceived = params.debtAmount.dividedBy(lstDexPriceInUnderlying).multipliedBy(1 - MAX_SLIPPAGE);
@@ -31048,6 +31048,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
31048
31048
  * @param params
31049
31049
  */
31050
31050
  async getVesuMultiplyCall(params) {
31051
+ const maxEkuboPriceImpact = params.maxEkuboPriceImpact || 0.01;
31051
31052
  const vesuAdapter1 = this.getVesuSameTokenAdapter();
31052
31053
  const legLTV = await vesuAdapter1.getLTVConfig(this.config);
31053
31054
  logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
@@ -31083,7 +31084,8 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
31083
31084
  marginAmount,
31084
31085
  debtAmount,
31085
31086
  lstDexPriceInUnderlying: dexPrice,
31086
- isIncrease: debtAmount.greaterThan(0)
31087
+ isIncrease: debtAmount.greaterThan(0),
31088
+ maxEkuboPriceImpact
31087
31089
  });
31088
31090
  }
31089
31091
  getLSTUnderlyingTokenInfo() {
@@ -31260,7 +31262,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
31260
31262
  // negative for exact amount out
31261
31263
  );
31262
31264
  logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwapQuote: ${JSON.stringify(leverSwapQuote)}`);
31263
- assert(leverSwapQuote.price_impact < 0.01, "getIncreaseLeverCall: Price impact is too high [Debt swap]");
31265
+ assert(leverSwapQuote.price_impact <= params.maxEkuboPriceImpact, "getIncreaseLeverCall: Price impact is too high [Debt swap]");
31264
31266
  const leverSwap = ekuboQuoter.getVesuMultiplyQuote(leverSwapQuote, fromToken, toToken);
31265
31267
  logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwap: ${JSON.stringify(leverSwap)}`);
31266
31268
  let minLSTReceived = params.debtAmount.dividedBy(lstDexPriceInUnderlying).multipliedBy(1 - MAX_SLIPPAGE);
package/dist/index.d.ts CHANGED
@@ -1459,6 +1459,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
1459
1459
  getVesuMultiplyCall(params: {
1460
1460
  isDeposit: boolean;
1461
1461
  leg1DepositAmount: Web3Number;
1462
+ maxEkuboPriceImpact?: number;
1462
1463
  }): Promise<Call[]>;
1463
1464
  getLSTUnderlyingTokenInfo(): TokenInfo;
1464
1465
  getMaxBorrowableAmount(params?: {
@@ -1508,6 +1509,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
1508
1509
  debtAmount: Web3Number;
1509
1510
  lstDexPriceInUnderlying: number;
1510
1511
  isIncrease: boolean;
1512
+ maxEkuboPriceImpact: number;
1511
1513
  }): Promise<Call[]>;
1512
1514
  }
1513
1515
  declare const HyperLSTStrategies: IStrategyMetadata<HyperLSTStrategySettings>[];
package/dist/index.js CHANGED
@@ -31048,6 +31048,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
31048
31048
  * @param params
31049
31049
  */
31050
31050
  async getVesuMultiplyCall(params) {
31051
+ const maxEkuboPriceImpact = params.maxEkuboPriceImpact || 0.01;
31051
31052
  const vesuAdapter1 = this.getVesuSameTokenAdapter();
31052
31053
  const legLTV = await vesuAdapter1.getLTVConfig(this.config);
31053
31054
  logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
@@ -31083,7 +31084,8 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
31083
31084
  marginAmount,
31084
31085
  debtAmount,
31085
31086
  lstDexPriceInUnderlying: dexPrice,
31086
- isIncrease: debtAmount.greaterThan(0)
31087
+ isIncrease: debtAmount.greaterThan(0),
31088
+ maxEkuboPriceImpact
31087
31089
  });
31088
31090
  }
31089
31091
  getLSTUnderlyingTokenInfo() {
@@ -31260,7 +31262,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
31260
31262
  // negative for exact amount out
31261
31263
  );
31262
31264
  logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwapQuote: ${JSON.stringify(leverSwapQuote)}`);
31263
- assert(leverSwapQuote.price_impact < 0.01, "getIncreaseLeverCall: Price impact is too high [Debt swap]");
31265
+ assert(leverSwapQuote.price_impact <= params.maxEkuboPriceImpact, "getIncreaseLeverCall: Price impact is too high [Debt swap]");
31264
31266
  const leverSwap = ekuboQuoter.getVesuMultiplyQuote(leverSwapQuote, fromToken, toToken);
31265
31267
  logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwap: ${JSON.stringify(leverSwap)}`);
31266
31268
  let minLSTReceived = params.debtAmount.dividedBy(lstDexPriceInUnderlying).multipliedBy(1 - MAX_SLIPPAGE);
package/dist/index.mjs CHANGED
@@ -30946,6 +30946,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
30946
30946
  * @param params
30947
30947
  */
30948
30948
  async getVesuMultiplyCall(params) {
30949
+ const maxEkuboPriceImpact = params.maxEkuboPriceImpact || 0.01;
30949
30950
  const vesuAdapter1 = this.getVesuSameTokenAdapter();
30950
30951
  const legLTV = await vesuAdapter1.getLTVConfig(this.config);
30951
30952
  logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
@@ -30981,7 +30982,8 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
30981
30982
  marginAmount,
30982
30983
  debtAmount,
30983
30984
  lstDexPriceInUnderlying: dexPrice,
30984
- isIncrease: debtAmount.greaterThan(0)
30985
+ isIncrease: debtAmount.greaterThan(0),
30986
+ maxEkuboPriceImpact
30985
30987
  });
30986
30988
  }
30987
30989
  getLSTUnderlyingTokenInfo() {
@@ -31158,7 +31160,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
31158
31160
  // negative for exact amount out
31159
31161
  );
31160
31162
  logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwapQuote: ${JSON.stringify(leverSwapQuote)}`);
31161
- assert(leverSwapQuote.price_impact < 0.01, "getIncreaseLeverCall: Price impact is too high [Debt swap]");
31163
+ assert(leverSwapQuote.price_impact <= params.maxEkuboPriceImpact, "getIncreaseLeverCall: Price impact is too high [Debt swap]");
31162
31164
  const leverSwap = ekuboQuoter.getVesuMultiplyQuote(leverSwapQuote, fromToken, toToken);
31163
31165
  logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwap: ${JSON.stringify(leverSwap)}`);
31164
31166
  let minLSTReceived = params.debtAmount.dividedBy(lstDexPriceInUnderlying).multipliedBy(1 - MAX_SLIPPAGE);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strkfarm/sdk",
3
- "version": "1.1.51",
3
+ "version": "1.1.52",
4
4
  "description": "STRKFarm TS SDK (Meant for our internal use, but feel free to use it)",
5
5
  "typings": "dist/index.d.ts",
6
6
  "types": "dist/index.d.ts",
@@ -427,8 +427,10 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
427
427
  */
428
428
  async getVesuMultiplyCall(params: {
429
429
  isDeposit: boolean,
430
- leg1DepositAmount: Web3Number
430
+ leg1DepositAmount: Web3Number,
431
+ maxEkuboPriceImpact?: number
431
432
  }) {
433
+ const maxEkuboPriceImpact = params.maxEkuboPriceImpact || 0.01;
432
434
  const vesuAdapter1 = this.getVesuSameTokenAdapter();
433
435
  const legLTV = await vesuAdapter1.getLTVConfig(this.config);
434
436
  logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
@@ -498,7 +500,8 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
498
500
  marginAmount,
499
501
  debtAmount,
500
502
  lstDexPriceInUnderlying: dexPrice,
501
- isIncrease: debtAmount.greaterThan(0)
503
+ isIncrease: debtAmount.greaterThan(0),
504
+ maxEkuboPriceImpact
502
505
  });
503
506
  }
504
507
 
@@ -665,7 +668,8 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
665
668
  marginAmount: Web3Number, // >0 during deposit
666
669
  debtAmount: Web3Number,
667
670
  lstDexPriceInUnderlying: number,
668
- isIncrease: boolean
671
+ isIncrease: boolean,
672
+ maxEkuboPriceImpact: number
669
673
  }): Promise<Call[]> {
670
674
  logger.verbose(`${this.getTag()}::getModifyLeverCall marginAmount: ${params.marginAmount}, debtAmount: ${params.debtAmount}, lstDexPriceInUnderlying: ${params.lstDexPriceInUnderlying}, isIncrease: ${params.isIncrease}`);
671
675
  assert(!params.marginAmount.isZero() || !params.debtAmount.isZero(), 'Deposit/debt must be non-0');
@@ -714,7 +718,7 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
714
718
  );
715
719
  logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwapQuote: ${JSON.stringify(leverSwapQuote)}`);
716
720
  // Ekubo's price impact can randomly show high numbers sometimes.
717
- assert(leverSwapQuote.price_impact < 0.01, 'getIncreaseLeverCall: Price impact is too high [Debt swap]');
721
+ assert(leverSwapQuote.price_impact <= params.maxEkuboPriceImpact, 'getIncreaseLeverCall: Price impact is too high [Debt swap]');
718
722
  const leverSwap = ekuboQuoter.getVesuMultiplyQuote(leverSwapQuote, fromToken, toToken);
719
723
  logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwap: ${JSON.stringify(leverSwap)}`);
720
724