@strkfarm/sdk 2.0.0-dev.34 → 2.0.0-dev.36

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.
Files changed (51) hide show
  1. package/dist/cli.js +2 -2
  2. package/dist/cli.mjs +2 -2
  3. package/dist/index.browser.global.js +16173 -24081
  4. package/dist/index.browser.mjs +8572 -16661
  5. package/dist/index.d.ts +600 -2666
  6. package/dist/index.js +8660 -16784
  7. package/dist/index.mjs +8585 -16674
  8. package/package.json +3 -3
  9. package/src/data/redeem-request-nft.abi.json +752 -0
  10. package/src/data/universal-vault.abi.json +8 -7
  11. package/src/dataTypes/bignumber.browser.ts +5 -1
  12. package/src/dataTypes/bignumber.node.ts +5 -0
  13. package/src/global.ts +21 -1
  14. package/src/interfaces/common.tsx +39 -4
  15. package/src/modules/avnu.ts +19 -10
  16. package/src/modules/index.ts +1 -1
  17. package/src/strategies/base-strategy.ts +92 -8
  18. package/src/strategies/constants.ts +8 -3
  19. package/src/strategies/ekubo-cl-vault.tsx +150 -16
  20. package/src/strategies/factory.ts +21 -1
  21. package/src/strategies/index.ts +2 -6
  22. package/src/strategies/registry.ts +28 -5
  23. package/src/strategies/sensei.ts +29 -13
  24. package/src/strategies/svk-strategy.ts +29 -4
  25. package/src/strategies/token-boosted-xstrk-carry-strategy.tsx +1057 -0
  26. package/src/strategies/universal-adapters/adapter-utils.ts +2 -0
  27. package/src/strategies/universal-adapters/avnu-adapter.ts +19 -10
  28. package/src/strategies/universal-adapters/index.ts +1 -2
  29. package/src/strategies/universal-adapters/svk-troves-adapter.ts +160 -13
  30. package/src/strategies/universal-adapters/vesu-modify-position-adapter.ts +91 -42
  31. package/src/strategies/universal-adapters/vesu-multiply-adapter.ts +75 -52
  32. package/src/strategies/universal-adapters/vesu-position-common.ts +38 -31
  33. package/src/strategies/universal-lst-muliplier-strategy.tsx +222 -269
  34. package/src/strategies/universal-strategy.tsx +166 -105
  35. package/src/strategies/vesu-rebalance.tsx +3 -6
  36. package/src/strategies/yoloVault.ts +1084 -0
  37. package/src/utils/health-factor-math.ts +29 -0
  38. package/src/modules/ExtendedWrapperSDk/index.ts +0 -62
  39. package/src/modules/ExtendedWrapperSDk/types.ts +0 -334
  40. package/src/modules/ExtendedWrapperSDk/wrapper.ts +0 -611
  41. package/src/strategies/universal-adapters/extended-adapter.ts +0 -835
  42. package/src/strategies/universal-adapters/usdc<>usdce-adapter.ts +0 -200
  43. package/src/strategies/vesu-extended-strategy/services/executionService.ts +0 -2233
  44. package/src/strategies/vesu-extended-strategy/services/extended-vesu-state-manager.ts +0 -4254
  45. package/src/strategies/vesu-extended-strategy/services/ltv-imbalance-rebalance-math.ts +0 -783
  46. package/src/strategies/vesu-extended-strategy/services/operationService.ts +0 -56
  47. package/src/strategies/vesu-extended-strategy/types/transaction-metadata.ts +0 -88
  48. package/src/strategies/vesu-extended-strategy/utils/config.runtime.ts +0 -78
  49. package/src/strategies/vesu-extended-strategy/utils/constants.ts +0 -48
  50. package/src/strategies/vesu-extended-strategy/utils/helper.ts +0 -528
  51. package/src/strategies/vesu-extended-strategy/vesu-extended-strategy.tsx +0 -1014
@@ -3,7 +3,7 @@ import { AUMTypes, getContractDetails, UNIVERSAL_MANAGE_IDS, UniversalManageCall
3
3
  import { PricerBase } from "@/modules/pricerBase";
4
4
  import { ContractAddr, Web3Number } from "@/dataTypes";
5
5
  import { Global } from "@/global";
6
- import { ApproveCallParams, APYType, AvnuSwapCallParams, BaseAdapterConfig, CommonAdapter, ManageCall, PositionInfo, TokenTransferAdapter, VesuMultiplyAdapter, VesuPools, VesuSupplyOnlyAdapter } from "./universal-adapters";
6
+ import { ApproveCallParams, APYType, AvnuSwapCallParams, BaseAdapterConfig, CommonAdapter, ManageCall, PositionInfo, TokenTransferAdapter, VesuModifyPositionAdapter, VesuMultiplyAdapter, VesuPools, VesuSupplyOnlyAdapter } from "./universal-adapters";
7
7
  import { AVNU_EXCHANGE } from "./universal-adapters/adapter-utils";
8
8
  import { DepegRiskLevel, LiquidationRiskLevel, SmartContractRiskLevel, TechnicalRiskLevel } from "@/interfaces/risks";
9
9
  import { AvnuWrapper, EkuboQuoter, ERC20, LSTAPRService, PricerFromApi, PricerLST } from "@/modules";
@@ -14,16 +14,40 @@ import { Call, Contract, uint256 } from "starknet";
14
14
  import ERC4626Abi from "@/data/erc4626.abi.json";
15
15
  import { AdapterOptimizer } from "./universal-adapters/adapter-optimizer";
16
16
  import { LSTPriceType } from "./types";
17
- import { MINIMUM_WBTC_DIFFERENCE_FOR_AVNU_SWAP } from "./vesu-extended-strategy/utils/constants";
18
- import { VesuExtendedStrategySettings } from "./vesu-extended-strategy/vesu-extended-strategy";
19
17
 
20
18
  export interface HyperLSTStrategySettings extends UniversalStrategySettings {
21
- borrowable_assets: TokenInfo[];
19
+ borrowable_assets: { tokenInfo: TokenInfo, poolId: ContractAddr }[];
22
20
  underlyingToken: TokenInfo;
23
21
  quoteAmountToFetchPrice: Web3Number;
24
22
  targetHealthFactor: number;
25
23
  minHealthFactor: number;
26
24
  aumOracle: ContractAddr;
25
+ adapterIds?: {
26
+ /** VesuMultiplyAdapter for underlying-matched debt (first matching borrowable pool) */
27
+ primaryMultiply: string;
28
+ multiply: Record<string, string>;
29
+ modify: Record<string, string>;
30
+ };
31
+ }
32
+
33
+ function getHyperLSTAdapterKey(debtSymbol: string, poolId: ContractAddr): string {
34
+ return `${debtSymbol.toLowerCase()}_${poolId.shortString()}`;
35
+ }
36
+
37
+ function getHyperLSTMultiplyAdapterId(
38
+ lstSymbol: string,
39
+ debtSymbol: string,
40
+ poolId: ContractAddr,
41
+ ): string {
42
+ return `vesu_multiply_${lstSymbol.toLowerCase()}_${getHyperLSTAdapterKey(debtSymbol, poolId)}`;
43
+ }
44
+
45
+ function getHyperLSTModifyAdapterId(
46
+ lstSymbol: string,
47
+ debtSymbol: string,
48
+ poolId: ContractAddr,
49
+ ): string {
50
+ return `vesu_modify_${lstSymbol.toLowerCase()}_${getHyperLSTAdapterKey(debtSymbol, poolId)}`;
27
51
  }
28
52
 
29
53
  export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings> extends SVKStrategy<S> {
@@ -34,12 +58,10 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
34
58
  super(config, pricer, metadata);
35
59
  const STRKToken = Global.getDefaultTokens().find(token => token.symbol === 'STRK')!;
36
60
  const underlyingToken = this.getLSTUnderlyingTokenInfo();
37
- if (underlyingToken.address.eq(STRKToken.address)) {
38
- this.quoteAmountToFetchPrice = new Web3Number(100, 18);
39
- } else {
40
- // else this BTC
41
- this.quoteAmountToFetchPrice = new Web3Number(0.01, this.asset().decimals);
61
+ if (metadata.additionalInfo.quoteAmountToFetchPrice.isZero()) {
62
+ throw new Error(`${this.getTag()}::quoteAmountToFetchPrice is zero`);
42
63
  }
64
+ this.quoteAmountToFetchPrice = metadata.additionalInfo.quoteAmountToFetchPrice;
43
65
 
44
66
  this.metadata.additionalInfo.adapters.forEach(adapter => {
45
67
  adapter.adapter.config.networkConfig = this.config;
@@ -55,13 +77,36 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
55
77
  return `${UniversalLstMultiplierStrategy.name}:${this.metadata.name}`;
56
78
  }
57
79
 
58
- // Vesu adapter with LST and base token match
59
- getVesuSameTokenAdapter() {
60
- const vesuMultipleAdapters = this.getVesuAdapters();
61
- console.log(vesuMultipleAdapters.map(adapter => adapter.config.debt.symbol));
62
- const baseAdapter = vesuMultipleAdapters.find((adapter) => {
63
- return adapter.config.debt.address.eq(this.metadata.additionalInfo.underlyingToken.address);
64
- })
80
+ private getAdapterById<T>(id: string): T {
81
+ const entry = this.metadata.additionalInfo.adapters.find((a) => a.id === id);
82
+ if (!entry) {
83
+ throw new Error(`${this.getTag()}::getAdapterById: adapter not found for id "${id}"`);
84
+ }
85
+ return entry.adapter as T;
86
+ }
87
+
88
+ getVesuMultiplyAdapterByKey(key: string): VesuMultiplyAdapter {
89
+ const id = this.metadata.additionalInfo.adapterIds?.multiply[key];
90
+ if (!id) {
91
+ throw new Error(`${this.getTag()}::getVesuMultiplyAdapterByKey: unknown key "${key}"`);
92
+ }
93
+ return this.getAdapterById<VesuMultiplyAdapter>(id);
94
+ }
95
+
96
+ // Vesu multiply adapter whose debt matches the LST underlying (e.g. STRK for xSTRK)
97
+ getVesuSameTokenAdapter(): VesuMultiplyAdapter {
98
+ const primaryId = this.metadata.additionalInfo.adapterIds?.primaryMultiply;
99
+ if (primaryId) {
100
+ const adapter = this.getAdapterById<VesuMultiplyAdapter>(primaryId);
101
+ adapter.config.networkConfig = this.config;
102
+ adapter.config.pricer = this.pricer;
103
+ adapter._vesuAdapter.networkConfig = this.config;
104
+ adapter._vesuAdapter.pricer = this.pricer;
105
+ return adapter;
106
+ }
107
+ const baseAdapter = this.getVesuMultiplyAdapters().find((adapter) =>
108
+ adapter.config.debt.address.eq(this.metadata.additionalInfo.underlyingToken.address),
109
+ );
65
110
  if (!baseAdapter) {
66
111
  throw new Error(`${this.getTag()}::getVesuSameTokenAdapter: base adapter not found`);
67
112
  }
@@ -72,7 +117,7 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
72
117
 
73
118
  // only one leg is used
74
119
  // todo support lending assets of underlying as well (like if xSTRK looping is not viable, simply supply STRK)
75
- getVesuAdapters() {
120
+ getVesuMultiplyAdapters() {
76
121
  const vesuMultipleAdapters = this.metadata.additionalInfo.adapters
77
122
  .filter(adapter => adapter.adapter.name === VesuMultiplyAdapter.name)
78
123
  .map(adapter => adapter.adapter) as VesuMultiplyAdapter[]
@@ -90,26 +135,6 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
90
135
  return Web3Number.fromWei("0", lstToken.decimals);
91
136
  }
92
137
 
93
- async getLSTDexPrice() {
94
- const ekuboQuoter = new EkuboQuoter(this.config, this.pricer);
95
- const lstTokenInfo = this.asset();
96
- const lstUnderlyingTokenInfo = this.getLSTUnderlyingTokenInfo();
97
- const quote = await ekuboQuoter.getQuoteExactInput(
98
- lstTokenInfo.address.address,
99
- lstUnderlyingTokenInfo.address.address,
100
- this.quoteAmountToFetchPrice,
101
- );
102
-
103
- const outputAmount = Web3Number.fromWei(
104
- quote.total_calculated,
105
- lstUnderlyingTokenInfo.decimals,
106
- );
107
- const price =
108
- outputAmount.toNumber() / this.quoteAmountToFetchPrice.toNumber();
109
- logger.verbose(`${this.getTag()}:: LST Dex Price: ${price}`);
110
- return price;
111
- }
112
-
113
138
  async getLSTAvnuRate() {
114
139
  const vesuAdapter1 = this.getVesuSameTokenAdapter();
115
140
  const lstTokenInfo = vesuAdapter1._vesuAdapter.config.collateral;
@@ -471,7 +496,7 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
471
496
  logger.verbose(`${this.getTag()}::getFundManagementCall params: ${JSON.stringify(params)}`);
472
497
  // const legLTV = await vesuAdapter1.getLTVConfig(this.config);
473
498
  // logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
474
- const allAdapters = this.metadata.additionalInfo.adapters.map(adapter => adapter.adapter);
499
+ const multiplyAdapters = this.getVesuMultiplyAdapters();
475
500
  if (!params.isDeposit) {
476
501
  // try using unused balance to unwind.
477
502
  // no need to unwind.
@@ -479,26 +504,12 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
479
504
  logger.verbose(`${this.getTag()}::getVesuMultiplyCall unusedBalance: ${unusedBalance.amount.toString()}, required: ${params.leg1DepositAmount.toString()}`);
480
505
  if (unusedBalance.amount.gte(params.leg1DepositAmount)) {
481
506
  return null;
482
- } else {
483
- const adapters = await AdapterOptimizer.getAdapterToUse(allAdapters, false, params.leg1DepositAmount);
484
- if (adapters.length > 0) {
485
- const proofsInfo = adapters.map(adapter => adapter.getProofs(false, this.getMerkleTree()));
486
- const calls: Call[] = [];
487
- for (const info of proofsInfo) {
488
- const manageCalls = await info.callConstructor({ amount: params.leg1DepositAmount });
489
- const call = this.getManageCall(this.getProofGroupsForManageCalls(manageCalls), manageCalls);
490
- calls.push(call);
491
- }
492
- return calls;
493
- } else {
494
- throw new Error(`${this.getTag()}::getVesuMultiplyCall: no adapters to use for unused balance: ${unusedBalance.amount.toString()}`);
495
- }
496
507
  }
497
508
  }
498
509
 
499
- const adapters = await AdapterOptimizer.getAdapterToUse(allAdapters, true, params.leg1DepositAmount);
510
+ const adapters = await AdapterOptimizer.getAdapterToUse(multiplyAdapters, params.isDeposit, params.leg1DepositAmount);
500
511
  if (adapters.length > 0) {
501
- const proofsInfo = adapters.map(adapter => adapter.getProofs(true, this.getMerkleTree()));
512
+ const proofsInfo = adapters.map(adapter => adapter.getProofs(params.isDeposit, this.getMerkleTree()));
502
513
  const calls: Call[] = [];
503
514
  for (const info of proofsInfo) {
504
515
  const manageCalls = await info.callConstructor({ amount: params.leg1DepositAmount });
@@ -509,73 +520,15 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
509
520
  } else {
510
521
  throw new Error(`${this.getTag()}::getVesuMultiplyCall: no adapters to use for deposit: ${params.leg1DepositAmount.toString()}`);
511
522
  }
512
-
513
- // const existingPositions = await vesuAdapter1.getPositions(this.config);
514
- // const collateralisation = await vesuAdapter1.getCollateralization(this.config);
515
- // const existingCollateralInfo = existingPositions[0];
516
- // const existingDebtInfo = existingPositions[1];
517
- // logger.debug(`${this.getTag()}::getVesuMultiplyCall existingCollateralInfo: ${JSON.stringify(existingCollateralInfo)},
518
- // existingDebtInfo: ${JSON.stringify(existingDebtInfo)}, collateralisation: ${JSON.stringify(collateralisation)}`);
519
-
520
- // // - Prices as seen by Vesu contracts, ideal for HF math
521
- // // Price 1 is ok as fallback bcz that would relatively price the
522
- // // collateral and debt as equal.
523
- // const collateralPrice = collateralisation[0].usdValue > 0 ? collateralisation[0].usdValue / existingCollateralInfo.amount.toNumber() : 1;
524
- // const debtPrice = collateralisation[1].usdValue > 0 ? collateralisation[1].usdValue / existingDebtInfo.amount.toNumber() : 1;
525
- // logger.debug(`${this.getTag()}::getVesuMultiplyCall collateralPrice: ${collateralPrice}, debtPrice: ${debtPrice}`);
526
-
527
- // // - Prices as seen by actual swap price
528
- // const dexPrice = await this.getLSTDexPrice();
529
-
530
- // // compute optimal amount of collateral and debt post addition/removal
531
- // // target hf = collateral * collateralPrice * ltv / debt * debtPrice
532
- // // assuming X to be the usd amount of debt borrowed or repaied (negative).
533
- // // target hf = (((collateral + legDepositAmount) * collateralPrice + X)) * ltv / (debt * debtPrice + X)
534
- // // => X * target hf = (((collateral + legDepositAmount) * collateralPrice + X)) * ltv - (debt * debtPrice * target hf)
535
- // // => X * (target hf - ltv)= ((collateral + legDepositAmount) * collateralPrice * ltv) - (debt * debtPrice * target hf)
536
- // // => X = (((collateral + legDepositAmount) * collateralPrice * ltv) - (debt * debtPrice * target hf)) / (target hf - ltv)
537
- // const addedCollateral = params.leg1DepositAmount
538
- // .multipliedBy(params.isDeposit ? 1 : -1)
539
- // logger.verbose(`${this.getTag()}::getVesuMultiplyCall addedCollateral: ${addedCollateral}`);
540
- // const numeratorPart1 = (existingCollateralInfo.amount.plus((addedCollateral))).multipliedBy(collateralPrice).multipliedBy(legLTV);
541
- // logger.verbose(`${this.getTag()}::getVesuMultiplyCall numeratorPart1: ${numeratorPart1}`);
542
- // const numeratorPart2 = existingDebtInfo.amount.multipliedBy(debtPrice).multipliedBy(this.metadata.additionalInfo.targetHealthFactor);
543
- // logger.verbose(`${this.getTag()}::getVesuMultiplyCall numeratorPart2: ${numeratorPart2}`);
544
- // const denominatorPart = this.metadata.additionalInfo.targetHealthFactor - (legLTV / dexPrice);
545
- // logger.verbose(`${this.getTag()}::getVesuMultiplyCall denominatorPart: ${denominatorPart}`);
546
- // const x_debt_usd = numeratorPart1.minus(numeratorPart2).dividedBy(denominatorPart);
547
- // logger.verbose(`${this.getTag()}::getVesuMultiplyCall x_debt_usd: ${x_debt_usd}`);
548
- // logger.debug(`${this.getTag()}::getVesuMultiplyCall numeratorPart1: ${numeratorPart1}, numeratorPart2: ${numeratorPart2}, denominatorPart: ${denominatorPart}`);
549
-
550
- // // both in underlying
551
- // const debtAmount = x_debt_usd.dividedBy(debtPrice);
552
- // const marginAmount = addedCollateral;
553
- // logger.verbose(`${this.getTag()}::getVesuMultiplyCall debtAmount: ${debtAmount}, marginAmount: ${marginAmount}`);
554
-
555
- // // Cases of lever increase (within the scopr of this function)
556
- // // 1. debtAmount > 0 and marginAmount > 0
557
- // // 2. debtAmount > 0 and marginAmount < 0
558
-
559
- // // Cases of lever decrease
560
- // // 3. debtAmount < 0 and marginAmount > 0
561
- // // 4. debtAmount < 0 and marginAmount < 0
562
- // return this.getModifyLeverCall({
563
- // marginAmount,
564
- // debtAmount,
565
- // lstDexPriceInUnderlying: dexPrice,
566
- // isIncrease: debtAmount.greaterThan(0)
567
- // });
568
523
  }
569
524
 
570
-
571
525
  getLSTUnderlyingTokenInfo() {
572
526
  return this.metadata.additionalInfo.underlyingToken;
573
527
  }
574
528
 
575
529
  async getLSTAPR(_address: ContractAddr): Promise<number> {
576
530
  try {
577
- const vesuAdapter1 = this.getVesuSameTokenAdapter();
578
- const apr = await LSTAPRService.getLSTAPR(vesuAdapter1._vesuAdapter.config.debt.address);
531
+ const apr = await LSTAPRService.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
579
532
  if (!apr) {
580
533
  throw new Error('Failed to get LST APR');
581
534
  }
@@ -598,6 +551,7 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
598
551
  logger.verbose(
599
552
  `${this.getTag()}::netAPY: unused balance is > max servicable from loan, lstAPY: ${lstAPY}`,
600
553
  );
554
+ // TODO, need to add the unused balance APY
601
555
  const output = await super.netAPY();
602
556
  output.splits.push({ apy: lstAPY, id: "lst_apy" });
603
557
  return output;
@@ -615,12 +569,9 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
615
569
  params: { isAPYComputation: boolean } = { isAPYComputation: false },
616
570
  ) {
617
571
  let numerator = 0;
618
- for (let adapter of this.getVesuAdapters()) {
572
+ for (let adapter of this.getVesuMultiplyAdapters()) {
619
573
  const maxDepositInfo = await adapter.maxDeposit();
620
- const ltv = await adapter._vesuAdapter.getLTVConfig(this.config);
621
- numerator +=
622
- (this.metadata.additionalInfo.targetHealthFactor *
623
- maxDepositInfo.amount.toNumber()) / ltv;
574
+ numerator += maxDepositInfo.amount.toNumber();
624
575
  }
625
576
  return numerator;
626
577
  }
@@ -639,45 +590,46 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
639
590
  const underlying = this.asset();
640
591
  assert(underlying.symbol.startsWith('x'), 'Underlying is not an LST of Endur');
641
592
 
593
+ // dynamic computation of aum based on price type
642
594
  const priceType = unrealizedAUM ? LSTPriceType.ENDUR_PRICE : LSTPriceType.AVNU_PRICE;
643
595
 
596
+ // get dex rate
644
597
  let tokenUnderlyingPrice: number;
598
+ const avnuRate = await this.getLSTAvnuRate();
599
+ if (avnuRate === 0) {
600
+ throw new Error(`${this.getTag()}::getAUM: tokenUnderlyingPrice (Avnu) is 0`);
601
+ }
602
+
603
+ // get token underlying price
645
604
  if (priceType === LSTPriceType.ENDUR_PRICE) {
646
605
  tokenUnderlyingPrice = await this.getLSTExchangeRate();
647
606
  if (tokenUnderlyingPrice === 0) {
648
607
  throw new Error(`${this.getTag()}::getAUM: tokenUnderlyingPrice (Endur) is 0`);
649
608
  }
650
- const avnuRate = await this.getLSTAvnuRate();
651
- if (avnuRate === 0) {
652
- throw new Error(`${this.getTag()}::getAUM: tokenUnderlyingPrice (Avnu) is 0`);
653
- }
654
- const diff = Math.abs(tokenUnderlyingPrice - avnuRate) / tokenUnderlyingPrice;
655
- if (diff > 0.02) {
656
- throw new Error(
657
- `${this.getTag()}::getAUM: Endur and Avnu prices differ by more than 2% (Endur: ${tokenUnderlyingPrice}, Avnu: ${avnuRate})`,
658
- );
659
- }
660
- logger.verbose(`${this.getTag()} tokenUnderlyingPrice (Endur): ${tokenUnderlyingPrice}, avnuRate: ${avnuRate}, diff: ${diff}`);
661
609
  } else {
662
- tokenUnderlyingPrice = await this.getLSTAvnuRate();
663
- if (tokenUnderlyingPrice === 0) {
664
- throw new Error(`${this.getTag()}::getAUM: tokenUnderlyingPrice (Avnu) is 0`);
665
- }
666
- logger.verbose(`${this.getTag()} tokenUnderlyingPrice (Avnu): ${tokenUnderlyingPrice}`);
610
+ tokenUnderlyingPrice = avnuRate;
667
611
  }
668
612
 
669
- const allPositions: PositionInfo[] = [];
670
- for (let adapter of this.metadata.additionalInfo.adapters) {
671
- const positions = await adapter.adapter.getPositions();
672
- allPositions.push(...positions);
613
+ // check if endur and avnu prices differ by more than 2%
614
+ const diff = Math.abs(tokenUnderlyingPrice - avnuRate) / tokenUnderlyingPrice;
615
+ if (diff > 0.02) {
616
+ throw new Error(
617
+ `${this.getTag()}::getAUM: Endur and Avnu prices differ by more than 2% (Endur: ${tokenUnderlyingPrice}, Avnu: ${avnuRate})`,
618
+ );
673
619
  }
674
620
 
621
+ // get all positions
622
+ const allPositions = await this.getVaultPositions();
623
+
624
+ // compute net aum
675
625
  let netAUM = new Web3Number(0, underlying.decimals);
676
626
  for (let position of allPositions) {
677
- if (position.tokenInfo.address.eq(underlying.address)) {
627
+ if (position.token.address.eq(underlying.address)) {
678
628
  netAUM = netAUM.plus(position.amount);
679
- } else {
629
+ } else if (position.token.address.eq(this.getLSTUnderlyingTokenInfo().address)) {
680
630
  netAUM = netAUM.plus(position.amount.dividedBy(tokenUnderlyingPrice));
631
+ } else {
632
+ throw new Error(`${this.getTag()}::getAUM: unknown token: ${position.token.symbol}`);
681
633
  }
682
634
  }
683
635
 
@@ -690,7 +642,7 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
690
642
  tokenInfo: underlying,
691
643
  amount: netAUM,
692
644
  usdValue: netAUM.toNumber() * assetPrice.price,
693
- apy: {apy: netAUM.toNumber() * assetPrice.price, type: APYType.BASE},
645
+ apy: {apy: 0, type: APYType.BASE}, // VT: Dont remember why this field exists here. FOr now, set it to 0.
694
646
  remarks: AUMTypes.FINALISED,
695
647
  protocol: Protocols.NONE
696
648
  };
@@ -730,26 +682,6 @@ export class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
730
682
  };
731
683
  }
732
684
 
733
- /**
734
- *
735
- * @param params marginAmount is in LST, debtAmount is in underlying
736
- */
737
- // async getModifyLeverCall(params: {
738
- // marginAmount: Web3Number, // >0 during deposit
739
- // debtAmount: Web3Number,
740
- // lstDexPriceInUnderlying: number,
741
- // isIncrease: boolean
742
- // }): Promise<Call[]> {
743
- // logger.verbose(`${this.getTag()}::getModifyLeverCall marginAmount: ${params.marginAmount}, debtAmount: ${params.debtAmount}, lstDexPriceInUnderlying: ${params.lstDexPriceInUnderlying}, isIncrease: ${params.isIncrease}`);
744
-
745
- // const vesuAdapter = this.getVesuSameTokenAdapter();
746
- // const manage0Info = vesuAdapter.
747
- // const manageCall0 = manage0Info.callConstructor({
748
- // amount: newDepositAmount
749
- // });
750
- // const manageCalls = await vesu
751
- // return [this.getManageCall(proofsIDs, manageCalls)];
752
- // }
753
685
  }
754
686
 
755
687
  export default function VaultDescription(
@@ -802,74 +734,82 @@ function getDescription(tokenSymbol: string, underlyingSymbol: string) {
802
734
  return VaultDescription(tokenSymbol, underlyingSymbol);
803
735
  }
804
736
 
805
-
806
- enum LST_MULTIPLIER_MANAGE_IDS {
807
- MULTIPLE_APPROVE = 'multiple_approve',
808
- MULTIPLY_VESU = 'multiply_vesu',
809
- SWITCH_DELEGATION_ON = 'switch_delegation_on',
810
- SWITCH_DELEGATION_OFF = 'switch_delegation_off',
811
- AVNU_MULTIPLY_APPROVE_DEPOSIT = 'avnu_mul_approve_dep',
812
- AVNU_MULTIPLY_SWAP_DEPOSIT = 'avnu_mul_swap_dep',
813
- AVNU_MULTIPLY_APPROVE_WITHDRAW = 'avnu_mul_approve_withdr',
814
- AVNU_MULTIPLY_SWAP_WITHDRAW = 'avnu_mul_swap_withdr',
815
- }
816
-
817
- function getAvnuManageIDs(baseID: LST_MULTIPLIER_MANAGE_IDS, debtTokenSymbol: string) {
818
- return `${baseID}_${debtTokenSymbol.toLowerCase()}`;
819
- }
820
-
821
- function getVesuLegId(baseID: string, debtTokenSymbol: string) {
822
- return `${baseID}_${debtTokenSymbol.toLowerCase()}`;
823
- }
824
-
825
737
  function getLooperSettings(
826
738
  lstSymbol: string,
827
739
  underlyingSymbol: string,
828
740
  vaultSettings: HyperLSTStrategySettings,
829
- pool1: ContractAddr,
830
741
  ) {
831
742
  vaultSettings.leafAdapters = [];
743
+ vaultSettings.adapters = [];
832
744
 
833
745
  const lstToken = Global.getDefaultTokens().find(token => token.symbol === lstSymbol)!;
834
746
  const underlyingToken = Global.getDefaultTokens().find(token => token.symbol === underlyingSymbol)!;
835
747
 
836
748
  const baseAdapterConfig: BaseAdapterConfig = {
837
749
  baseToken: lstToken,
838
- supportedPositions: [{asset: lstToken, isDebt: false}],
750
+ supportedPositions: [{asset: lstToken, isDebt: false}, {asset: underlyingToken, isDebt: true}],
839
751
  networkConfig: getMainnetConfig(),
840
752
  pricer: new PricerFromApi(getMainnetConfig(), Global.getDefaultTokens()),
841
753
  vaultAllocator: vaultSettings.vaultAllocator,
842
754
  vaultAddress: vaultSettings.vaultAddress
843
755
  }
844
- const vesuAdapterLST = new VesuSupplyOnlyAdapter({
845
- // xWBTC vToken on re7 xBTC pool
846
- vTokenContract: ContractAddr.from('0x062a162d0827db6f43ebb850cbef3c99fc7969e3070b83a2236c9f3713c89fd8'),
847
- ...baseAdapterConfig,
848
- })
849
756
 
850
- const vesuMultiplyAdapters = borrowableAssets.map(position => new VesuMultiplyAdapter({
851
- poolId: pool1,
852
- collateral: lstToken,
853
- debt: Global.getDefaultTokens().find(token => token.symbol === position)!,
854
- marginToken: lstToken,
855
- targetHealthFactor: vaultSettings.targetHealthFactor,
856
- minHealthFactor: vaultSettings.minHealthFactor,
857
- quoteAmountToFetchPrice: vaultSettings.quoteAmountToFetchPrice,
858
- ...baseAdapterConfig,
859
- supportedPositions: [{asset: lstToken, isDebt: false}, {asset: Global.getDefaultTokens().find(token => token.symbol === position)!, isDebt: true}],
860
- minimumVesuMovementAmount: 0
861
- }));
862
-
863
- // Tracks LST balance in the vault allocator; fromAddress=vaultAllocator, toAddress=vaultAddress
864
- const lstTransferAdapter = new TokenTransferAdapter({
865
- ...baseAdapterConfig,
866
- fromAddress: vaultSettings.vaultAllocator,
867
- toAddress: vaultSettings.vaultAddress,
757
+ const adapterIds: NonNullable<HyperLSTStrategySettings["adapterIds"]> = {
758
+ primaryMultiply: "",
759
+ multiply: {},
760
+ modify: {},
761
+ };
762
+
763
+ const vesuMultiplyAdapters = vaultSettings.borrowable_assets.map((position) => {
764
+ const key = getHyperLSTAdapterKey(position.tokenInfo.symbol, position.poolId);
765
+ const id = getHyperLSTMultiplyAdapterId(lstSymbol, position.tokenInfo.symbol, position.poolId);
766
+ adapterIds.multiply[key] = id;
767
+ return {
768
+ id,
769
+ adapter: new VesuMultiplyAdapter({
770
+ poolId: position.poolId,
771
+ collateral: lstToken,
772
+ debt: position.tokenInfo,
773
+ marginToken: lstToken,
774
+ targetHealthFactor: vaultSettings.targetHealthFactor,
775
+ minHealthFactor: vaultSettings.minHealthFactor,
776
+ quoteAmountToFetchPrice: vaultSettings.quoteAmountToFetchPrice,
777
+ ...baseAdapterConfig,
778
+ minimumVesuMovementAmount: 0,
779
+ }),
780
+ };
868
781
  });
869
782
 
870
- vaultSettings.adapters.push({id: `${vesuAdapterLST.name}_${lstToken.symbol}_${underlyingToken.symbol}`, adapter: vesuAdapterLST});
871
- vesuMultiplyAdapters.map(adapter => vaultSettings.adapters.push({id: `${adapter.name}_${lstToken.symbol}_${underlyingToken.symbol}`, adapter: adapter}));
872
- vaultSettings.adapters.push({id: `${lstTransferAdapter.name}_${lstToken.symbol}`, adapter: lstTransferAdapter});
783
+ const vesuModifyPositionAdapters = vaultSettings.borrowable_assets.map((position) => {
784
+ const key = getHyperLSTAdapterKey(position.tokenInfo.symbol, position.poolId);
785
+ const id = getHyperLSTModifyAdapterId(lstSymbol, position.tokenInfo.symbol, position.poolId);
786
+ adapterIds.modify[key] = id;
787
+ return {
788
+ id,
789
+ adapter: new VesuModifyPositionAdapter({
790
+ poolId: position.poolId,
791
+ collateral: lstToken,
792
+ debt: position.tokenInfo,
793
+ targetLtv: 0.8,
794
+ maxLtv: 0.9,
795
+ ...baseAdapterConfig,
796
+ }),
797
+ };
798
+ });
799
+
800
+ if (!adapterIds.primaryMultiply && vesuMultiplyAdapters.length > 0) {
801
+ adapterIds.primaryMultiply = vesuMultiplyAdapters[0].id;
802
+ } else {
803
+ throw new Error(`${lstSymbol}::getLooperSettings: primaryMultiply adapter not found`);
804
+ }
805
+ vaultSettings.adapterIds = adapterIds;
806
+
807
+ for (const entry of vesuMultiplyAdapters) {
808
+ vaultSettings.adapters.push(entry);
809
+ }
810
+ for (const entry of vesuModifyPositionAdapters) {
811
+ vaultSettings.adapters.push(entry);
812
+ }
873
813
 
874
814
  const commonAdapter = new CommonAdapter({
875
815
  id: UNIVERSAL_MANAGE_IDS.FLASH_LOAN,
@@ -879,25 +819,21 @@ function getLooperSettings(
879
819
  asset: lstToken.address
880
820
  })
881
821
 
882
- // push vesu adapter to leaf adapters
883
- vaultSettings.leafAdapters.push(() => vesuAdapterLST.getDepositLeaf());
884
- vaultSettings.leafAdapters.push(() => vesuAdapterLST.getWithdrawLeaf());
885
-
886
- // push vesu multiply adapter to leaf adapters
887
- vesuMultiplyAdapters.map(adapter => vaultSettings.leafAdapters.push(() => adapter.getDepositLeaf()));
888
- vesuMultiplyAdapters.map(adapter => vaultSettings.leafAdapters.push(() => adapter.getWithdrawLeaf()));
822
+ for (const entry of vesuMultiplyAdapters) {
823
+ const adapter = entry.adapter;
824
+ vaultSettings.leafAdapters.push(() => adapter.getDepositLeaf());
825
+ vaultSettings.leafAdapters.push(() => adapter.getWithdrawLeaf());
826
+ }
827
+ for (const entry of vesuModifyPositionAdapters) {
828
+ const adapter = entry.adapter;
829
+ vaultSettings.leafAdapters.push(() => adapter.getDepositLeaf());
830
+ vaultSettings.leafAdapters.push(() => adapter.getWithdrawLeaf());
831
+ }
889
832
 
890
833
  // to bridge liquidity back to vault (used by bring_liquidity)
891
834
  vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, vaultSettings.vaultAddress, UNIVERSAL_MANAGE_IDS.APPROVE_BRING_LIQUIDITY).bind(commonAdapter));
892
835
  vaultSettings.leafAdapters.push(commonAdapter.getBringLiquidityAdapter(UNIVERSAL_MANAGE_IDS.BRING_LIQUIDITY).bind(commonAdapter));
893
836
 
894
- // claim rewards
895
- // vaultSettings.leafAdapters.push(vesuAdapterLST.getDefispringRewardsAdapter(UNIVERSAL_MANAGE_IDS.DEFISPRING_REWARDS).bind(vesuAdapterLST));
896
-
897
- // // avnu swap for claims rewards
898
- // const STRKToken = Global.getDefaultTokens().find(token => token.symbol === 'STRK')!;
899
- // vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(STRKToken.address, AVNU_EXCHANGE, UNIVERSAL_MANAGE_IDS.APPROVE_SWAP_TOKEN1).bind(commonAdapter));
900
- // vabaseAdapterConfigultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(STRKToken.address, lstToken.address, UNIVERSAL_MANAGE_IDS.AVNU_SWAP_REWARDS, false).bind(commonAdapter));
901
837
  return vaultSettings;
902
838
  }
903
839
 
@@ -966,10 +902,6 @@ export const _riskFactor: RiskFactor[] = [
966
902
  {type: RiskType.DEPEG_RISK, value: DepegRiskLevel.GENERALLY_STABLE, weight: 25, reason: "Generally stable pegged assets" },
967
903
  ];
968
904
 
969
- const borrowableAssets = [
970
- 'WBTC', 'tBTC', 'LBTC', 'solvBTC'
971
- ]
972
-
973
905
  const hyperxSTRK: HyperLSTStrategySettings = {
974
906
  vaultAddress: ContractAddr.from('0x46c7a54c82b1fe374353859f554a40b8bd31d3e30f742901579e7b57b1b5960'),
975
907
  manager: ContractAddr.from('0x5d499cd333757f461a0bedaca3dfc4d77320c773037e0aa299f22a6dbfdc03a'),
@@ -980,9 +912,15 @@ const hyperxSTRK: HyperLSTStrategySettings = {
980
912
  adapters: [],
981
913
  targetHealthFactor: 1.1,
982
914
  minHealthFactor: 1.05,
983
- borrowable_assets: Global.getDefaultTokens().filter(token => token.symbol === 'STRK'),
915
+ borrowable_assets: [{
916
+ tokenInfo: Global.getDefaultTokens().find(token => token.symbol === 'STRK')!,
917
+ poolId: VesuPools.Re7STRK,
918
+ }, {
919
+ tokenInfo: Global.getDefaultTokens().find(token => token.symbol === 'STRK')!,
920
+ poolId: VesuPools.Prime,
921
+ }],
984
922
  underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'STRK')!,
985
- quoteAmountToFetchPrice: new Web3Number('100', Global.getDefaultTokens().find(token => token.symbol === 'STRK')!.decimals),
923
+ quoteAmountToFetchPrice: new Web3Number('1000', Global.getDefaultTokens().find(token => token.symbol === 'STRK')!.decimals),
986
924
  }
987
925
 
988
926
  const hyperxWBTC: HyperLSTStrategySettings = {
@@ -995,7 +933,10 @@ const hyperxWBTC: HyperLSTStrategySettings = {
995
933
  adapters: [],
996
934
  targetHealthFactor: 1.1,
997
935
  minHealthFactor: 1.05,
998
- borrowable_assets: Global.getDefaultTokens().filter(token => token.symbol === 'WBTC'),
936
+ borrowable_assets: [{
937
+ tokenInfo: Global.getDefaultTokens().find(token => token.symbol === 'WBTC')!,
938
+ poolId: VesuPools.Re7xBTC,
939
+ }],
999
940
  underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'WBTC')!,
1000
941
  quoteAmountToFetchPrice: new Web3Number('0.001', Global.getDefaultTokens().find(token => token.symbol === 'WBTC')!.decimals),
1001
942
  redemptionRouter: ContractAddr.from('0x6ea649f402898f69baf775c1afdd08522c071c640b9c4460192070ec2b96417'),
@@ -1011,7 +952,13 @@ const hyperxtBTC: HyperLSTStrategySettings = {
1011
952
  adapters: [],
1012
953
  targetHealthFactor: 1.1,
1013
954
  minHealthFactor: 1.05,
1014
- borrowable_assets: Global.getDefaultTokens().filter(token => token.symbol === 'tBTC' || token.symbol === 'WBTC'),
955
+ borrowable_assets: [{
956
+ tokenInfo: Global.getDefaultTokens().find(token => token.symbol === 'tBTC')!,
957
+ poolId: VesuPools.Re7xBTC,
958
+ }, {
959
+ tokenInfo: Global.getDefaultTokens().find(token => token.symbol === 'WBTC')!,
960
+ poolId: VesuPools.Re7xBTC,
961
+ }],
1015
962
  underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'tBTC')!,
1016
963
  quoteAmountToFetchPrice: new Web3Number('0.001', Global.getDefaultTokens().find(token => token.symbol === 'tBTC')!.decimals),
1017
964
  redemptionRouter: ContractAddr.from('0x3de9c409d1e357e25778fb7a3e2e2393666956846a5c2caa607296fa8e76b5d'),
@@ -1027,7 +974,10 @@ const hyperxsBTC: HyperLSTStrategySettings = {
1027
974
  adapters: [],
1028
975
  targetHealthFactor: 1.1,
1029
976
  minHealthFactor: 1.05,
1030
- borrowable_assets: Global.getDefaultTokens().filter(token => token.symbol === 'solvBTC'),
977
+ borrowable_assets: [{
978
+ tokenInfo: Global.getDefaultTokens().find(token => token.symbol === 'solvBTC')!,
979
+ poolId: VesuPools.Re7xBTC,
980
+ }],
1031
981
  underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'solvBTC')!,
1032
982
  quoteAmountToFetchPrice: new Web3Number('0.001', Global.getDefaultTokens().find(token => token.symbol === 'solvBTC')!.decimals),
1033
983
  }
@@ -1042,44 +992,47 @@ const hyperxLBTC: HyperLSTStrategySettings = {
1042
992
  adapters: [],
1043
993
  targetHealthFactor: 1.1,
1044
994
  minHealthFactor: 1.05,
1045
- borrowable_assets: Global.getDefaultTokens().filter(token => token.symbol === 'LBTC'),
995
+ borrowable_assets: [{
996
+ tokenInfo: Global.getDefaultTokens().find(token => token.symbol === 'LBTC')!,
997
+ poolId: VesuPools.Re7xBTC,
998
+ }],
1046
999
  underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'LBTC')!,
1047
1000
  quoteAmountToFetchPrice: new Web3Number('0.001', Global.getDefaultTokens().find(token => token.symbol === 'LBTC')!.decimals),
1048
1001
  }
1049
1002
 
1050
- const hypermRe7BTC: HyperLSTStrategySettings = {
1051
- vaultAddress: ContractAddr.from('0x6c89b75d09de82477edb86b2c2918cfc1a5dc0177cfbdea46278386b6499645'),
1052
- manager: ContractAddr.from('0x7bc2d0535e13352d3ab78ea047616a3162068294297304943d2302122a150a1'),
1053
- vaultAllocator: ContractAddr.from('0x760f9cebca9d2ee624f4224591da6da8b3ea5fd2410590735709551bd4e7570'),
1054
- redeemRequestNFT: ContractAddr.from('0x5e045ae0160f7650f8a4dd7c826f25630a89fe62434db4441e7e0075608180f'),
1055
- aumOracle: ContractAddr.from('0x3958df341b838813c24efb9183c23bddd1c57d44b1b86c0dd57f67887b89fba'),
1056
- leafAdapters: [],
1057
- adapters: [],
1058
- targetHealthFactor: 1.1,
1059
- minHealthFactor: 1.05,
1060
- borrowable_assets: borrowableAssets.map(asset => Global.getDefaultTokens().find(token => token.symbol === asset)!),
1061
- underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'WBTC')!,
1062
- quoteAmountToFetchPrice: new Web3Number('0.001', Global.getDefaultTokens().find(token => token.symbol === 'mRe7BTC')!.decimals),
1063
- }
1003
+ // const hypermRe7BTC: HyperLSTStrategySettings = {
1004
+ // vaultAddress: ContractAddr.from('0x6c89b75d09de82477edb86b2c2918cfc1a5dc0177cfbdea46278386b6499645'),
1005
+ // manager: ContractAddr.from('0x7bc2d0535e13352d3ab78ea047616a3162068294297304943d2302122a150a1'),
1006
+ // vaultAllocator: ContractAddr.from('0x760f9cebca9d2ee624f4224591da6da8b3ea5fd2410590735709551bd4e7570'),
1007
+ // redeemRequestNFT: ContractAddr.from('0x5e045ae0160f7650f8a4dd7c826f25630a89fe62434db4441e7e0075608180f'),
1008
+ // aumOracle: ContractAddr.from('0x3958df341b838813c24efb9183c23bddd1c57d44b1b86c0dd57f67887b89fba'),
1009
+ // leafAdapters: [],
1010
+ // adapters: [],
1011
+ // targetHealthFactor: 1.1,
1012
+ // minHealthFactor: 1.05,
1013
+ // borrowable_assets: .map(asset => Global.getDefaultTokens().find(token => token.symbol === asset)!),
1014
+ // underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'WBTC')!,
1015
+ // quoteAmountToFetchPrice: new Web3Number('0.001', Global.getDefaultTokens().find(token => token.symbol === 'mRe7BTC')!.decimals),
1016
+ // }
1064
1017
  // Contract deployed: Vault, addr: 0x42797ab4eb1f72787442e91a73d63a39e3a141c1106470a946ecc328db6896c
1065
1018
  // Contract deployed: RedeemRequest, addr: 0x4bbb25c2568af07967342833f7db1aece1be1be2330798dab4ee585aa6c2c72
1066
1019
  // Contract deployed: VaultAllocator, addr: 0x456c4c6afca90512aeb5c735d84405fea6e51ab06d1851ac8cdb0a235e14f15
1067
1020
  // Contract deployed: Manager, addr: 0x435b45d40fbb406cf69ac84bb471e7b7a4ea2295d0893c05dd2db565295e77f
1068
1021
 
1069
- const hypermRe7YIELD: HyperLSTStrategySettings = {
1070
- vaultAddress: ContractAddr.from('0x42797ab4eb1f72787442e91a73d63a39e3a141c1106470a946ecc328db6896c'),
1071
- manager: ContractAddr.from('0x435b45d40fbb406cf69ac84bb471e7b7a4ea2295d0893c05dd2db565295e77f'),
1072
- vaultAllocator: ContractAddr.from('0x456c4c6afca90512aeb5c735d84405fea6e51ab06d1851ac8cdb0a235e14f15'),
1073
- redeemRequestNFT: ContractAddr.from('0x4bbb25c2568af07967342833f7db1aece1be1be2330798dab4ee585aa6c2c72'),
1074
- aumOracle: ContractAddr.from('0x3e1f2825158cafccc9b42a8165d17ceb6b8e966474d9c63587d338746888382'),
1075
- leafAdapters: [],
1076
- adapters: [],
1077
- targetHealthFactor: 1.1,
1078
- minHealthFactor: 1.05,
1079
- borrowable_assets: [Global.getDefaultTokens().find(token => token.symbol === 'USDC')!],
1080
- underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'USDC')!,
1081
- quoteAmountToFetchPrice: new Web3Number('0.001', Global.getDefaultTokens().find(token => token.symbol === 'mRe7BTC')!.decimals),
1082
- }
1022
+ // const hypermRe7YIELD: HyperLSTStrategySettings = {
1023
+ // vaultAddress: ContractAddr.from('0x42797ab4eb1f72787442e91a73d63a39e3a141c1106470a946ecc328db6896c'),
1024
+ // manager: ContractAddr.from('0x435b45d40fbb406cf69ac84bb471e7b7a4ea2295d0893c05dd2db565295e77f'),
1025
+ // vaultAllocator: ContractAddr.from('0x456c4c6afca90512aeb5c735d84405fea6e51ab06d1851ac8cdb0a235e14f15'),
1026
+ // redeemRequestNFT: ContractAddr.from('0x4bbb25c2568af07967342833f7db1aece1be1be2330798dab4ee585aa6c2c72'),
1027
+ // aumOracle: ContractAddr.from('0x3e1f2825158cafccc9b42a8165d17ceb6b8e966474d9c63587d338746888382'),
1028
+ // leafAdapters: [],
1029
+ // adapters: [],
1030
+ // targetHealthFactor: 1.1,
1031
+ // minHealthFactor: 1.05,
1032
+ // borrowable_assets: [Global.getDefaultTokens().find(token => token.symbol === 'USDC')!],
1033
+ // underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'USDC')!,
1034
+ // quoteAmountToFetchPrice: new Web3Number('0.001', Global.getDefaultTokens().find(token => token.symbol === 'mRe7BTC')!.decimals),
1035
+ // }
1083
1036
 
1084
1037
  export function getInvestmentSteps(lstSymbol: string, underlyingSymbol: string) {
1085
1038
  return [
@@ -1199,7 +1152,7 @@ function getStrategySettings(
1199
1152
  description: `Creates leveraged looping position on ${lstSymbol} by borrowing ${underlyingSymbol} to increase yield`,
1200
1153
  },
1201
1154
  depositTokens: [Global.getDefaultTokens().find(token => token.symbol === lstSymbol)!],
1202
- additionalInfo: getLooperSettings(lstSymbol, underlyingSymbol, settings, lstSymbol === 'xSTRK' ? VesuPools.Re7xSTRK : VesuPools.Re7xBTC),
1155
+ additionalInfo: getLooperSettings(lstSymbol, underlyingSymbol, settings),
1203
1156
  risk: {
1204
1157
  riskFactor: _riskFactor,
1205
1158
  netRisk:
@@ -1219,7 +1172,7 @@ function getStrategySettings(
1219
1172
  investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
1220
1173
  isPreview: isPreview,
1221
1174
  apyMethodology: 'Current annualized APY in terms of base asset of the LST. There is no additional fee taken by Troves on LST APY. We charge a 10% performance fee on the additional gain which is already accounted in the APY shown.',
1222
- realizedAPYMethodology: 'The realizedAPY is based on past 14 days performance by the vault',
1175
+ realizedApyMethodology: 'The realizedAPY is based on past 14 days performance by the vault',
1223
1176
  tags: lstSymbol.includes('BTC')
1224
1177
  ? [StrategyTag.BTC, StrategyTag.LEVERED]
1225
1178
  : [StrategyTag.LEVERED],
@@ -1255,10 +1208,10 @@ function getStrategySettings(
1255
1208
  export const HyperLSTStrategies: IStrategyMetadata<HyperLSTStrategySettings>[] =
1256
1209
  [
1257
1210
  getStrategySettings('xSTRK', 'STRK', hyperxSTRK, false, true),
1258
- getStrategySettings('xWBTC', 'WBTC', hyperxWBTC, false, false),
1259
- getStrategySettings('xtBTC', 'tBTC', hyperxtBTC, false, false),
1260
- getStrategySettings('xsBTC', 'solvBTC', hyperxsBTC, false, false),
1261
- getStrategySettings('xLBTC', 'LBTC', hyperxLBTC, false, false),
1262
- getStrategySettings('mRe7BTC', 'mRe7BTC', hypermRe7BTC, false, false),
1263
- getStrategySettings('mRe7YIELD', 'mRe7YIELD', hypermRe7YIELD, false, false),
1211
+ getStrategySettings('xWBTC', 'WBTC', hyperxWBTC, false, true),
1212
+ getStrategySettings('xtBTC', 'tBTC', hyperxtBTC, false, true),
1213
+ getStrategySettings('xsBTC', 'solvBTC', hyperxsBTC, false, true),
1214
+ getStrategySettings('xLBTC', 'LBTC', hyperxLBTC, false, true),
1215
+ // getStrategySettings('mRe7BTC', 'mRe7BTC', hypermRe7BTC, false, false),
1216
+ // getStrategySettings('mRe7YIELD', 'mRe7YIELD', hypermRe7YIELD, false, false),
1264
1217
  ]