@strkfarm/sdk 1.1.35 → 1.1.37

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.
@@ -53728,7 +53728,6 @@ ${JSON.stringify(data, null, 2)}`;
53728
53728
  }
53729
53729
  throw new Error("no quotes found");
53730
53730
  }
53731
- logger2.verbose(`${_AvnuWrapper.name}: getQuotes => filteredQuotes: ${JSON.stringify(filteredQuotes)}`);
53732
53731
  return filteredQuotes[0];
53733
53732
  }
53734
53733
  async getSwapInfo(quote, taker, integratorFeeBps, integratorFeeRecipient, minAmount, options) {
@@ -94491,12 +94490,17 @@ spurious results.`);
94491
94490
  async netAPY() {
94492
94491
  const unusedBalance = await this.getUnusedBalance();
94493
94492
  const maxNewDeposits = await this.maxNewDeposits();
94493
+ const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
94494
94494
  if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
94495
- return super.netAPY();
94495
+ const output = await super.netAPY();
94496
+ output.splits.push({ apy: lstAPY, id: "lst_apy" });
94497
+ return output;
94496
94498
  } else {
94497
94499
  const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
94498
94500
  const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
94499
- return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
94501
+ const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights);
94502
+ output.splits.push({ apy: lstAPY, id: "lst_apy" });
94503
+ return output;
94500
94504
  }
94501
94505
  }
94502
94506
  async maxNewDeposits() {
@@ -2120,7 +2120,6 @@ var AvnuWrapper = class _AvnuWrapper {
2120
2120
  }
2121
2121
  throw new Error("no quotes found");
2122
2122
  }
2123
- logger.verbose(`${_AvnuWrapper.name}: getQuotes => filteredQuotes: ${JSON.stringify(filteredQuotes)}`);
2124
2123
  return filteredQuotes[0];
2125
2124
  }
2126
2125
  async getSwapInfo(quote, taker, integratorFeeBps, integratorFeeRecipient, minAmount, options) {
@@ -30585,12 +30584,17 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
30585
30584
  async netAPY() {
30586
30585
  const unusedBalance = await this.getUnusedBalance();
30587
30586
  const maxNewDeposits = await this.maxNewDeposits();
30587
+ const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
30588
30588
  if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
30589
- return super.netAPY();
30589
+ const output = await super.netAPY();
30590
+ output.splits.push({ apy: lstAPY, id: "lst_apy" });
30591
+ return output;
30590
30592
  } else {
30591
30593
  const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
30592
30594
  const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
30593
- return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
30595
+ const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights);
30596
+ output.splits.push({ apy: lstAPY, id: "lst_apy" });
30597
+ return output;
30594
30598
  }
30595
30599
  }
30596
30600
  async maxNewDeposits() {
package/dist/index.js CHANGED
@@ -2274,7 +2274,6 @@ var AvnuWrapper = class _AvnuWrapper {
2274
2274
  }
2275
2275
  throw new Error("no quotes found");
2276
2276
  }
2277
- logger.verbose(`${_AvnuWrapper.name}: getQuotes => filteredQuotes: ${JSON.stringify(filteredQuotes)}`);
2278
2277
  return filteredQuotes[0];
2279
2278
  }
2280
2279
  async getSwapInfo(quote, taker, integratorFeeBps, integratorFeeRecipient, minAmount, options) {
@@ -30584,12 +30583,17 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
30584
30583
  async netAPY() {
30585
30584
  const unusedBalance = await this.getUnusedBalance();
30586
30585
  const maxNewDeposits = await this.maxNewDeposits();
30586
+ const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
30587
30587
  if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
30588
- return super.netAPY();
30588
+ const output = await super.netAPY();
30589
+ output.splits.push({ apy: lstAPY, id: "lst_apy" });
30590
+ return output;
30589
30591
  } else {
30590
30592
  const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
30591
30593
  const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
30592
- return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
30594
+ const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights);
30595
+ output.splits.push({ apy: lstAPY, id: "lst_apy" });
30596
+ return output;
30593
30597
  }
30594
30598
  }
30595
30599
  async maxNewDeposits() {
package/dist/index.mjs CHANGED
@@ -2169,7 +2169,6 @@ var AvnuWrapper = class _AvnuWrapper {
2169
2169
  }
2170
2170
  throw new Error("no quotes found");
2171
2171
  }
2172
- logger.verbose(`${_AvnuWrapper.name}: getQuotes => filteredQuotes: ${JSON.stringify(filteredQuotes)}`);
2173
2172
  return filteredQuotes[0];
2174
2173
  }
2175
2174
  async getSwapInfo(quote, taker, integratorFeeBps, integratorFeeRecipient, minAmount, options) {
@@ -30483,12 +30482,17 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
30483
30482
  async netAPY() {
30484
30483
  const unusedBalance = await this.getUnusedBalance();
30485
30484
  const maxNewDeposits = await this.maxNewDeposits();
30485
+ const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
30486
30486
  if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
30487
- return super.netAPY();
30487
+ const output = await super.netAPY();
30488
+ output.splits.push({ apy: lstAPY, id: "lst_apy" });
30489
+ return output;
30488
30490
  } else {
30489
30491
  const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
30490
30492
  const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
30491
- return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
30493
+ const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights);
30494
+ output.splits.push({ apy: lstAPY, id: "lst_apy" });
30495
+ return output;
30492
30496
  }
30493
30497
  }
30494
30498
  async maxNewDeposits() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strkfarm/sdk",
3
- "version": "1.1.35",
3
+ "version": "1.1.37",
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",
@@ -60,7 +60,6 @@ export class AvnuWrapper {
60
60
  throw new Error('no quotes found')
61
61
  }
62
62
 
63
- logger.verbose(`${AvnuWrapper.name}: getQuotes => filteredQuotes: ${JSON.stringify(filteredQuotes)}`);
64
63
  return filteredQuotes[0];
65
64
  }
66
65
 
@@ -460,17 +460,22 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
460
460
  async netAPY(): Promise<{ net: number; splits: { apy: number; id: string; }[]; }> {
461
461
  const unusedBalance = await this.getUnusedBalance();
462
462
  const maxNewDeposits = await this.maxNewDeposits();
463
+ const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
463
464
 
464
465
  // if unused balance is > max servicable from loan, we are limited by the max borrowing we can do
465
466
  // we also allow accepting little higher deposits (1.5x) to have room for future looping when theres more liquidity or debt cap rises
466
467
  if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
467
468
  // we have excess, just use real APY
468
- return super.netAPY();
469
+ const output = await super.netAPY();
470
+ output.splits.push({apy: lstAPY, id: 'lst_apy'});
471
+ return output;
469
472
  } else {
470
473
  // we have little bit room to accept more deposits, we use theoretical max APY
471
474
  const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
472
475
  const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
473
- return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
476
+ const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights);
477
+ output.splits.push({apy: lstAPY, id: 'lst_apy'});
478
+ return output;
474
479
  }
475
480
  }
476
481