@strkfarm/sdk 1.1.22 → 1.1.24

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.
@@ -15289,6 +15289,17 @@ var erc4626_abi_default = [
15289
15289
  }
15290
15290
  ];
15291
15291
 
15292
+ // src/strategies/ekubo-cl-vault.tsx
15293
+ import { gql } from "@apollo/client";
15294
+
15295
+ // src/modules/apollo-client.ts
15296
+ import { ApolloClient, InMemoryCache } from "@apollo/client";
15297
+ var apolloClient = new ApolloClient({
15298
+ uri: "https://api.troves.fi/",
15299
+ cache: new InMemoryCache()
15300
+ });
15301
+ var apollo_client_default = apolloClient;
15302
+
15292
15303
  // src/strategies/ekubo-cl-vault.tsx
15293
15304
  import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
15294
15305
  var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
@@ -15446,11 +15457,75 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15446
15457
  handleFeesCall() {
15447
15458
  return [this.contract.populate("handle_fees", [])];
15448
15459
  }
15449
- /**
15450
- * Calculates assets before and now in a given token of TVL per share to observe growth
15451
- * @returns {Promise<number>} The weighted average APY across all pools
15452
- */
15453
- async netAPY(blockIdentifier = "latest", sinceBlocks = 6e5) {
15460
+ async getFeeHistory(timePeriod = "24h") {
15461
+ const { data } = await apollo_client_default.query({
15462
+ query: gql`
15463
+ query ContractFeeEarnings(
15464
+ $timeframe: String!
15465
+ $contract: String!
15466
+ ) {
15467
+ contractFeeEarnings(timeframe: $timeframe, contract: $contract) {
15468
+ contract
15469
+ dailyEarnings {
15470
+ date
15471
+ tokenAddress
15472
+ amount
15473
+ }
15474
+ totalCollections
15475
+ }
15476
+ }
15477
+ `,
15478
+ variables: {
15479
+ timeframe: timePeriod,
15480
+ contract: this.address.address
15481
+ },
15482
+ fetchPolicy: "no-cache"
15483
+ });
15484
+ const poolKey = await this.getPoolKey();
15485
+ const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
15486
+ const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
15487
+ const price0 = await this.pricer.getPrice(token0Info.symbol);
15488
+ const price1 = await this.pricer.getPrice(token1Info.symbol);
15489
+ let totalToken0Amount = Web3Number.fromWei(0, token0Info.decimals);
15490
+ let totalToken1Amount = Web3Number.fromWei(0, token1Info.decimals);
15491
+ let totalToken0Usd = 0;
15492
+ let totalToken1Usd = 0;
15493
+ const parsedFeeInfo = [];
15494
+ const feeInfo = data.contractFeeEarnings.dailyEarnings;
15495
+ for (const d of feeInfo) {
15496
+ const tokenInfo = await Global.getTokenInfoFromAddr(ContractAddr.from(d.tokenAddress));
15497
+ const amount = Web3Number.fromWei(d.amount, tokenInfo.decimals);
15498
+ if (tokenInfo.address.eq(poolKey.token0)) {
15499
+ totalToken0Amount = totalToken0Amount.plus(amount);
15500
+ totalToken0Usd = totalToken0Usd + amount.multipliedBy(price0.price).toNumber();
15501
+ } else {
15502
+ totalToken1Amount = totalToken1Amount.plus(amount);
15503
+ totalToken1Usd = totalToken1Usd + amount.multipliedBy(price1.price).toNumber();
15504
+ }
15505
+ parsedFeeInfo.push({
15506
+ date: d.date,
15507
+ tokenInfo,
15508
+ amount: Web3Number.fromWei(d.amount, tokenInfo.decimals)
15509
+ });
15510
+ }
15511
+ return {
15512
+ summary: {
15513
+ usdValue: totalToken0Usd + totalToken1Usd,
15514
+ token0: {
15515
+ tokenInfo: token0Info,
15516
+ amount: totalToken0Amount,
15517
+ usdValue: totalToken0Usd
15518
+ },
15519
+ token1: {
15520
+ tokenInfo: token1Info,
15521
+ amount: totalToken1Amount,
15522
+ usdValue: totalToken1Usd
15523
+ }
15524
+ },
15525
+ history: parsedFeeInfo
15526
+ };
15527
+ }
15528
+ async netSharesBasedTrueAPY(blockIdentifier = "latest", sinceBlocks = 6e5) {
15454
15529
  const tvlNow = await this._getTVL(blockIdentifier);
15455
15530
  const supplyNow = await this.totalSupply(blockIdentifier);
15456
15531
  const priceNow = await this.getCurrentPrice(blockIdentifier);
@@ -15488,6 +15563,23 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15488
15563
  ) / 1e4;
15489
15564
  return apyForGivenBlocks * (365 * 24 * 3600) / timeDiffSeconds;
15490
15565
  }
15566
+ async feeBasedAPY(timeperiod = "24h") {
15567
+ const feeInfo = await this.getFeeHistory(timeperiod);
15568
+ const tvlNow = await this.getTVL("latest");
15569
+ return feeInfo.summary.usdValue * 365 / tvlNow.usdValue;
15570
+ }
15571
+ /**
15572
+ * Calculates assets before and now in a given token of TVL per share to observe growth
15573
+ * @returns {Promise<number>} The weighted average APY across all pools
15574
+ */
15575
+ async netAPY(blockIdentifier = "latest", sinceBlocks = 6e5, timeperiod = "24h") {
15576
+ const isUSDCQouteToken = this.metadata.additionalInfo.quoteAsset.symbol === "USDC";
15577
+ if (!isUSDCQouteToken) {
15578
+ return this.netSharesBasedTrueAPY(blockIdentifier, sinceBlocks);
15579
+ } else {
15580
+ return this.feeBasedAPY(timeperiod);
15581
+ }
15582
+ }
15491
15583
  async getHarvestRewardShares(fromBlock, toBlock) {
15492
15584
  const len = Number(await this.contract.call("get_total_rewards"));
15493
15585
  let shares = Web3Number.fromWei(0, 18);
@@ -16502,7 +16594,7 @@ var highRisk = {
16502
16594
  netRisk: highVolatilityPoolRiskFactors.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / highVolatilityPoolRiskFactors.reduce((acc, curr) => acc + curr.weight, 0),
16503
16595
  notARisks: getNoRiskTags(highVolatilityPoolRiskFactors)
16504
16596
  };
16505
- var AUDIT_URL2 = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
16597
+ var AUDIT_URL2 = "https://docs.troves.fi/p/security#ekubo-vault";
16506
16598
  var faqs2 = [
16507
16599
  {
16508
16600
  question: "What is the Ekubo CL Vault strategy?",
@@ -16701,7 +16793,7 @@ var ETHUSDCRe7Strategy = {
16701
16793
  Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
16702
16794
  Global.getDefaultTokens().find((t) => t.symbol === "USDC")
16703
16795
  ],
16704
- apyMethodology: "APY based on 7-day historical performance, including fees and rewards.",
16796
+ apyMethodology: "Annualized fee APY, calculated as fees earned in the last 24h divided by TVL",
16705
16797
  additionalInfo: {
16706
16798
  newBounds: "Managed by Re7",
16707
16799
  truePrice: 1,
@@ -16722,6 +16814,10 @@ var ETHUSDCRe7Strategy = {
16722
16814
  /* @__PURE__ */ jsx3("a", { href: "https://www.re7labs.xyz", style: { textDecoration: "underline", marginLeft: "2px" }, target: "_blank", children: "here" }),
16723
16815
  "."
16724
16816
  ] })
16817
+ },
16818
+ {
16819
+ question: "How is the APY calculated?",
16820
+ answer: /* @__PURE__ */ jsx3("div", { children: "It's an annualized fee APY, calculated as fees earned in the last 24h divided by TVL. Factors like impermanent loss are not considered." })
16725
16821
  }
16726
16822
  ],
16727
16823
  risk: highRisk,
@@ -27329,6 +27425,7 @@ var investmentSteps = [
27329
27425
  "Vault manager reports asset under management (AUM) regularly to the vault",
27330
27426
  "Request withdrawal and vault manager processes it in 1-2 hours"
27331
27427
  ];
27428
+ var AUDIT_URL3 = "https://docs.troves.fi/p/security#starknet-vault-kit";
27332
27429
  var UniversalStrategies = [
27333
27430
  {
27334
27431
  name: "USDC Evergreen",
@@ -27343,6 +27440,7 @@ var UniversalStrategies = [
27343
27440
  netRisk: _riskFactor3.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor3.reduce((acc, curr) => acc + curr.weight, 0),
27344
27441
  notARisks: getNoRiskTags(_riskFactor3)
27345
27442
  },
27443
+ auditUrl: AUDIT_URL3,
27346
27444
  protocols: [Protocols.VESU],
27347
27445
  maxTVL: Web3Number.fromWei(0, 6),
27348
27446
  contractDetails: getContractDetails(usdcVaultSettings),
@@ -27366,7 +27464,8 @@ var UniversalStrategies = [
27366
27464
  maxTVL: Web3Number.fromWei(0, 8),
27367
27465
  contractDetails: getContractDetails(wbtcVaultSettings),
27368
27466
  faqs: getFAQs(),
27369
- investmentSteps
27467
+ investmentSteps,
27468
+ auditUrl: AUDIT_URL3
27370
27469
  },
27371
27470
  {
27372
27471
  name: "ETH Evergreen",
@@ -27385,7 +27484,8 @@ var UniversalStrategies = [
27385
27484
  maxTVL: Web3Number.fromWei(0, 18),
27386
27485
  contractDetails: getContractDetails(ethVaultSettings),
27387
27486
  faqs: getFAQs(),
27388
- investmentSteps
27487
+ investmentSteps,
27488
+ auditUrl: AUDIT_URL3
27389
27489
  },
27390
27490
  {
27391
27491
  name: "STRK Evergreen",
@@ -27404,7 +27504,8 @@ var UniversalStrategies = [
27404
27504
  maxTVL: Web3Number.fromWei(0, 18),
27405
27505
  contractDetails: getContractDetails(strkVaultSettings),
27406
27506
  faqs: getFAQs(),
27407
- investmentSteps
27507
+ investmentSteps,
27508
+ auditUrl: AUDIT_URL3
27408
27509
  },
27409
27510
  {
27410
27511
  name: "USDT Evergreen",
@@ -27423,7 +27524,8 @@ var UniversalStrategies = [
27423
27524
  maxTVL: Web3Number.fromWei(0, 6),
27424
27525
  contractDetails: getContractDetails(usdtVaultSettings),
27425
27526
  faqs: getFAQs(),
27426
- investmentSteps
27527
+ investmentSteps,
27528
+ auditUrl: AUDIT_URL3
27427
27529
  }
27428
27530
  ];
27429
27531
 
@@ -27633,7 +27735,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27633
27735
  return [this.getManageCall(proofsIDs, manageCalls)];
27634
27736
  }
27635
27737
  };
27636
- function VaultDescription() {
27738
+ function VaultDescription(lstSymbol, underlyingSymbol) {
27637
27739
  const containerStyle = {
27638
27740
  maxWidth: "800px",
27639
27741
  margin: "0 auto",
@@ -27643,8 +27745,27 @@ function VaultDescription() {
27643
27745
  borderRadius: "12px"
27644
27746
  };
27645
27747
  return /* @__PURE__ */ jsxs4("div", { style: containerStyle, children: [
27646
- /* @__PURE__ */ jsx5("h1", { style: { fontSize: "18px", marginBottom: "10px" }, children: "Meta Vault \u2014 Automated Yield Router" }),
27647
- /* @__PURE__ */ jsx5("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: "This Levered Endur LST vault is a tokenized leveraged Vault, auto-compounding strategy that continuously allocates your deposited asset to the best available yield source in the ecosystem. Depositors receive vault shares that represent a proportional claim on the underlying assets and accrued yield. Allocation shifts are handled programmatically based on on-chain signals and risk filters, minimizing idle capital and maximizing net APY." }),
27748
+ /* @__PURE__ */ jsxs4("h1", { style: { fontSize: "18px", marginBottom: "10px" }, children: [
27749
+ "Liquidation risk managed leverged ",
27750
+ lstSymbol,
27751
+ " Vault"
27752
+ ] }),
27753
+ /* @__PURE__ */ jsxs4("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: [
27754
+ "This Levered Endur ",
27755
+ lstSymbol,
27756
+ " vault is a tokenized leveraged Vault, auto-compounding strategy that takes upto 5x leverage on ",
27757
+ lstSymbol,
27758
+ " by borrow ",
27759
+ underlyingSymbol,
27760
+ ". Borrowed amount is swapped to ",
27761
+ lstSymbol,
27762
+ " to create leverage. Depositors receive vault shares that represent a proportional claim on the underlying assets and accrued yield."
27763
+ ] }),
27764
+ /* @__PURE__ */ jsxs4("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: [
27765
+ "This vault uses Vesu for lending and borrowing. The oracle used by this pool is a ",
27766
+ highlightTextWithLinks("conversion rate oracle", [{ highlight: "conversion rate oracle", link: "https://docs.pragma.build/starknet/development#conversion-rate" }]),
27767
+ "which is resilient to liquidity issues and price volatility, hence reducing the risk of liquidation. However, overtime, if left un-monitored, debt can increase enough to trigger a liquidation. But no worries, our continuous monitoring systems look for situations with reduced health factor and balance collateral/debt to bring it back to safe levels. With Troves, you can have a peaceful sleep."
27768
+ ] }),
27648
27769
  /* @__PURE__ */ jsx5("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ jsxs4("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
27649
27770
  /* @__PURE__ */ jsx5("strong", { children: "Withdrawals:" }),
27650
27771
  " Requests can take up to ",
@@ -27653,8 +27774,8 @@ function VaultDescription() {
27653
27774
  ] }) })
27654
27775
  ] });
27655
27776
  }
27656
- function getDescription2(tokenSymbol) {
27657
- return VaultDescription();
27777
+ function getDescription2(tokenSymbol, underlyingSymbol) {
27778
+ return VaultDescription(tokenSymbol, underlyingSymbol);
27658
27779
  }
27659
27780
  function getLooperSettings2(lstSymbol, underlyingSymbol, vaultSettings, pool1) {
27660
27781
  vaultSettings.leafAdapters = [];
@@ -27695,11 +27816,12 @@ function getLooperSettings2(lstSymbol, underlyingSymbol, vaultSettings, pool1) {
27695
27816
  vaultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(STRKToken.address, lstToken.address, "avnu_swap_rewards" /* AVNU_SWAP_REWARDS */).bind(commonAdapter));
27696
27817
  return vaultSettings;
27697
27818
  }
27819
+ var AUDIT_URL4 = "https://docs.troves.fi/p/security#starknet-vault-kit";
27698
27820
  function getFAQs2(lstSymbol, underlyingSymbol) {
27699
27821
  return [
27700
27822
  {
27701
27823
  question: `What is the Hyper ${lstSymbol} Vault?`,
27702
- answer: `The Hyper ${lstSymbol} Vault is a tokenized strategy that automatically loops your ${underlyingSymbol} or ${lstSymbol} to create up to 4x leverage to hence yield in a very low risk manner.`
27824
+ answer: `The Hyper ${lstSymbol} Vault is a tokenized strategy that automatically loops your ${lstSymbol} to create up to 5x leverage to hence yield in a very low risk manner.`
27703
27825
  },
27704
27826
  {
27705
27827
  question: "How does yield allocation work?",
@@ -27743,8 +27865,9 @@ function getFAQs2(lstSymbol, underlyingSymbol) {
27743
27865
  }
27744
27866
  var _riskFactor4 = [
27745
27867
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 2 /* WELL_AUDITED */, weight: 25, reason: "Audited by Zellic" },
27746
- { type: "Liquidation Risk" /* LIQUIDATION_RISK */, value: 1 /* VERY_LOW_PROBABILITY */, weight: 50, reason: "The collateral and debt are highly correlated" },
27747
- { type: "Technical Risk" /* TECHNICAL_RISK */, value: 1 /* STABLE_INFRASTRUCTURE */, weight: 50, reason: "Liquidation can only happen if vault is left un-monitored for weeks, which is highly unlikely. We actively monitor all services on a daily basis." }
27868
+ { type: "Liquidation Risk" /* LIQUIDATION_RISK */, value: 1 /* VERY_LOW_PROBABILITY */, weight: 25, reason: "The collateral and debt are highly correlated" },
27869
+ { type: "Technical Risk" /* TECHNICAL_RISK */, value: 1 /* STABLE_INFRASTRUCTURE */, weight: 25, reason: "Liquidation can only happen if vault is left un-monitored for weeks, which is highly unlikely. We actively monitor all services on a daily basis." },
27870
+ { type: "Depeg Risk" /* DEPEG_RISK */, value: 2 /* GENERALLY_STABLE */, weight: 25, reason: "Generally stable pegged assets" }
27748
27871
  ];
27749
27872
  var hyperxSTRK = {
27750
27873
  vaultAddress: ContractAddr.from("0x46c7a54c82b1fe374353859f554a40b8bd31d3e30f742901579e7b57b1b5960"),
@@ -27807,14 +27930,13 @@ function getInvestmentSteps(lstSymbol, underlyingSymbol) {
27807
27930
  `The vault manager loops the ${underlyingSymbol} to buy ${lstSymbol}`,
27808
27931
  `The vault manager collateralizes the ${lstSymbol} on Vesu`,
27809
27932
  `The vault manager borrows more ${underlyingSymbol} to loop further`,
27810
- `Claim BTCFi STRK rewards weekly to swap to ${lstSymbol} and reinvest`,
27811
27933
  `If required, adjust leverage or re-allocate assets within LST pool on Vesu to optimize yield`
27812
27934
  ];
27813
27935
  }
27814
27936
  function getStrategySettings(lstSymbol, underlyingSymbol, addresses, isPreview = false) {
27815
27937
  return {
27816
27938
  name: `Hyper ${lstSymbol}`,
27817
- description: getDescription2(lstSymbol),
27939
+ description: getDescription2(lstSymbol, underlyingSymbol),
27818
27940
  address: addresses.vaultAddress,
27819
27941
  launchBlock: 0,
27820
27942
  type: "Other",
@@ -27825,6 +27947,7 @@ function getStrategySettings(lstSymbol, underlyingSymbol, addresses, isPreview =
27825
27947
  netRisk: _riskFactor4.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor4.reduce((acc, curr) => acc + curr.weight, 0),
27826
27948
  notARisks: getNoRiskTags(_riskFactor4)
27827
27949
  },
27950
+ auditUrl: AUDIT_URL4,
27828
27951
  protocols: [Protocols.ENDUR, Protocols.VESU],
27829
27952
  maxTVL: Web3Number.fromWei(0, 18),
27830
27953
  contractDetails: getContractDetails(addresses),
package/dist/index.d.ts CHANGED
@@ -642,6 +642,11 @@ interface EkuboBounds {
642
642
  lowerTick: bigint;
643
643
  upperTick: bigint;
644
644
  }
645
+ interface FeeHistory {
646
+ date: string;
647
+ tokenInfo: TokenInfo;
648
+ amount: Web3Number;
649
+ }
645
650
  /**
646
651
  * Settings for the CLVaultStrategy
647
652
  *
@@ -696,11 +701,17 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
696
701
  rebalanceCall(newBounds: EkuboBounds, swapParams: SwapInfo): Call[];
697
702
  handleUnusedCall(swapParams: SwapInfo): Call[];
698
703
  handleFeesCall(): Call[];
704
+ getFeeHistory(timePeriod?: '24h' | '30d' | '3m'): Promise<{
705
+ summary: DualTokenInfo;
706
+ history: FeeHistory[];
707
+ }>;
708
+ netSharesBasedTrueAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
709
+ feeBasedAPY(timeperiod?: '24h' | '30d' | '3m'): Promise<number>;
699
710
  /**
700
711
  * Calculates assets before and now in a given token of TVL per share to observe growth
701
712
  * @returns {Promise<number>} The weighted average APY across all pools
702
713
  */
703
- netAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
714
+ netAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number, timeperiod?: '24h' | '30d' | '3m'): Promise<number>;
704
715
  getHarvestRewardShares(fromBlock: number, toBlock: number): Promise<Web3Number>;
705
716
  balanceOf(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<Web3Number>;
706
717
  getUserTVL(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<DualTokenInfo>;
package/dist/index.js CHANGED
@@ -15385,6 +15385,17 @@ var erc4626_abi_default = [
15385
15385
  }
15386
15386
  ];
15387
15387
 
15388
+ // src/strategies/ekubo-cl-vault.tsx
15389
+ var import_client2 = require("@apollo/client");
15390
+
15391
+ // src/modules/apollo-client.ts
15392
+ var import_client = require("@apollo/client");
15393
+ var apolloClient = new import_client.ApolloClient({
15394
+ uri: "https://api.troves.fi/",
15395
+ cache: new import_client.InMemoryCache()
15396
+ });
15397
+ var apollo_client_default = apolloClient;
15398
+
15388
15399
  // src/strategies/ekubo-cl-vault.tsx
15389
15400
  var import_jsx_runtime3 = require("react/jsx-runtime");
15390
15401
  var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
@@ -15542,11 +15553,75 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15542
15553
  handleFeesCall() {
15543
15554
  return [this.contract.populate("handle_fees", [])];
15544
15555
  }
15545
- /**
15546
- * Calculates assets before and now in a given token of TVL per share to observe growth
15547
- * @returns {Promise<number>} The weighted average APY across all pools
15548
- */
15549
- async netAPY(blockIdentifier = "latest", sinceBlocks = 6e5) {
15556
+ async getFeeHistory(timePeriod = "24h") {
15557
+ const { data } = await apollo_client_default.query({
15558
+ query: import_client2.gql`
15559
+ query ContractFeeEarnings(
15560
+ $timeframe: String!
15561
+ $contract: String!
15562
+ ) {
15563
+ contractFeeEarnings(timeframe: $timeframe, contract: $contract) {
15564
+ contract
15565
+ dailyEarnings {
15566
+ date
15567
+ tokenAddress
15568
+ amount
15569
+ }
15570
+ totalCollections
15571
+ }
15572
+ }
15573
+ `,
15574
+ variables: {
15575
+ timeframe: timePeriod,
15576
+ contract: this.address.address
15577
+ },
15578
+ fetchPolicy: "no-cache"
15579
+ });
15580
+ const poolKey = await this.getPoolKey();
15581
+ const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
15582
+ const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
15583
+ const price0 = await this.pricer.getPrice(token0Info.symbol);
15584
+ const price1 = await this.pricer.getPrice(token1Info.symbol);
15585
+ let totalToken0Amount = Web3Number.fromWei(0, token0Info.decimals);
15586
+ let totalToken1Amount = Web3Number.fromWei(0, token1Info.decimals);
15587
+ let totalToken0Usd = 0;
15588
+ let totalToken1Usd = 0;
15589
+ const parsedFeeInfo = [];
15590
+ const feeInfo = data.contractFeeEarnings.dailyEarnings;
15591
+ for (const d of feeInfo) {
15592
+ const tokenInfo = await Global.getTokenInfoFromAddr(ContractAddr.from(d.tokenAddress));
15593
+ const amount = Web3Number.fromWei(d.amount, tokenInfo.decimals);
15594
+ if (tokenInfo.address.eq(poolKey.token0)) {
15595
+ totalToken0Amount = totalToken0Amount.plus(amount);
15596
+ totalToken0Usd = totalToken0Usd + amount.multipliedBy(price0.price).toNumber();
15597
+ } else {
15598
+ totalToken1Amount = totalToken1Amount.plus(amount);
15599
+ totalToken1Usd = totalToken1Usd + amount.multipliedBy(price1.price).toNumber();
15600
+ }
15601
+ parsedFeeInfo.push({
15602
+ date: d.date,
15603
+ tokenInfo,
15604
+ amount: Web3Number.fromWei(d.amount, tokenInfo.decimals)
15605
+ });
15606
+ }
15607
+ return {
15608
+ summary: {
15609
+ usdValue: totalToken0Usd + totalToken1Usd,
15610
+ token0: {
15611
+ tokenInfo: token0Info,
15612
+ amount: totalToken0Amount,
15613
+ usdValue: totalToken0Usd
15614
+ },
15615
+ token1: {
15616
+ tokenInfo: token1Info,
15617
+ amount: totalToken1Amount,
15618
+ usdValue: totalToken1Usd
15619
+ }
15620
+ },
15621
+ history: parsedFeeInfo
15622
+ };
15623
+ }
15624
+ async netSharesBasedTrueAPY(blockIdentifier = "latest", sinceBlocks = 6e5) {
15550
15625
  const tvlNow = await this._getTVL(blockIdentifier);
15551
15626
  const supplyNow = await this.totalSupply(blockIdentifier);
15552
15627
  const priceNow = await this.getCurrentPrice(blockIdentifier);
@@ -15584,6 +15659,23 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15584
15659
  ) / 1e4;
15585
15660
  return apyForGivenBlocks * (365 * 24 * 3600) / timeDiffSeconds;
15586
15661
  }
15662
+ async feeBasedAPY(timeperiod = "24h") {
15663
+ const feeInfo = await this.getFeeHistory(timeperiod);
15664
+ const tvlNow = await this.getTVL("latest");
15665
+ return feeInfo.summary.usdValue * 365 / tvlNow.usdValue;
15666
+ }
15667
+ /**
15668
+ * Calculates assets before and now in a given token of TVL per share to observe growth
15669
+ * @returns {Promise<number>} The weighted average APY across all pools
15670
+ */
15671
+ async netAPY(blockIdentifier = "latest", sinceBlocks = 6e5, timeperiod = "24h") {
15672
+ const isUSDCQouteToken = this.metadata.additionalInfo.quoteAsset.symbol === "USDC";
15673
+ if (!isUSDCQouteToken) {
15674
+ return this.netSharesBasedTrueAPY(blockIdentifier, sinceBlocks);
15675
+ } else {
15676
+ return this.feeBasedAPY(timeperiod);
15677
+ }
15678
+ }
15587
15679
  async getHarvestRewardShares(fromBlock, toBlock) {
15588
15680
  const len = Number(await this.contract.call("get_total_rewards"));
15589
15681
  let shares = Web3Number.fromWei(0, 18);
@@ -16598,7 +16690,7 @@ var highRisk = {
16598
16690
  netRisk: highVolatilityPoolRiskFactors.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / highVolatilityPoolRiskFactors.reduce((acc, curr) => acc + curr.weight, 0),
16599
16691
  notARisks: getNoRiskTags(highVolatilityPoolRiskFactors)
16600
16692
  };
16601
- var AUDIT_URL2 = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
16693
+ var AUDIT_URL2 = "https://docs.troves.fi/p/security#ekubo-vault";
16602
16694
  var faqs2 = [
16603
16695
  {
16604
16696
  question: "What is the Ekubo CL Vault strategy?",
@@ -16797,7 +16889,7 @@ var ETHUSDCRe7Strategy = {
16797
16889
  Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
16798
16890
  Global.getDefaultTokens().find((t) => t.symbol === "USDC")
16799
16891
  ],
16800
- apyMethodology: "APY based on 7-day historical performance, including fees and rewards.",
16892
+ apyMethodology: "Annualized fee APY, calculated as fees earned in the last 24h divided by TVL",
16801
16893
  additionalInfo: {
16802
16894
  newBounds: "Managed by Re7",
16803
16895
  truePrice: 1,
@@ -16818,6 +16910,10 @@ var ETHUSDCRe7Strategy = {
16818
16910
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: "https://www.re7labs.xyz", style: { textDecoration: "underline", marginLeft: "2px" }, target: "_blank", children: "here" }),
16819
16911
  "."
16820
16912
  ] })
16913
+ },
16914
+ {
16915
+ question: "How is the APY calculated?",
16916
+ answer: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: "It's an annualized fee APY, calculated as fees earned in the last 24h divided by TVL. Factors like impermanent loss are not considered." })
16821
16917
  }
16822
16918
  ],
16823
16919
  risk: highRisk,
@@ -27425,6 +27521,7 @@ var investmentSteps = [
27425
27521
  "Vault manager reports asset under management (AUM) regularly to the vault",
27426
27522
  "Request withdrawal and vault manager processes it in 1-2 hours"
27427
27523
  ];
27524
+ var AUDIT_URL3 = "https://docs.troves.fi/p/security#starknet-vault-kit";
27428
27525
  var UniversalStrategies = [
27429
27526
  {
27430
27527
  name: "USDC Evergreen",
@@ -27439,6 +27536,7 @@ var UniversalStrategies = [
27439
27536
  netRisk: _riskFactor3.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor3.reduce((acc, curr) => acc + curr.weight, 0),
27440
27537
  notARisks: getNoRiskTags(_riskFactor3)
27441
27538
  },
27539
+ auditUrl: AUDIT_URL3,
27442
27540
  protocols: [Protocols.VESU],
27443
27541
  maxTVL: Web3Number.fromWei(0, 6),
27444
27542
  contractDetails: getContractDetails(usdcVaultSettings),
@@ -27462,7 +27560,8 @@ var UniversalStrategies = [
27462
27560
  maxTVL: Web3Number.fromWei(0, 8),
27463
27561
  contractDetails: getContractDetails(wbtcVaultSettings),
27464
27562
  faqs: getFAQs(),
27465
- investmentSteps
27563
+ investmentSteps,
27564
+ auditUrl: AUDIT_URL3
27466
27565
  },
27467
27566
  {
27468
27567
  name: "ETH Evergreen",
@@ -27481,7 +27580,8 @@ var UniversalStrategies = [
27481
27580
  maxTVL: Web3Number.fromWei(0, 18),
27482
27581
  contractDetails: getContractDetails(ethVaultSettings),
27483
27582
  faqs: getFAQs(),
27484
- investmentSteps
27583
+ investmentSteps,
27584
+ auditUrl: AUDIT_URL3
27485
27585
  },
27486
27586
  {
27487
27587
  name: "STRK Evergreen",
@@ -27500,7 +27600,8 @@ var UniversalStrategies = [
27500
27600
  maxTVL: Web3Number.fromWei(0, 18),
27501
27601
  contractDetails: getContractDetails(strkVaultSettings),
27502
27602
  faqs: getFAQs(),
27503
- investmentSteps
27603
+ investmentSteps,
27604
+ auditUrl: AUDIT_URL3
27504
27605
  },
27505
27606
  {
27506
27607
  name: "USDT Evergreen",
@@ -27519,7 +27620,8 @@ var UniversalStrategies = [
27519
27620
  maxTVL: Web3Number.fromWei(0, 6),
27520
27621
  contractDetails: getContractDetails(usdtVaultSettings),
27521
27622
  faqs: getFAQs(),
27522
- investmentSteps
27623
+ investmentSteps,
27624
+ auditUrl: AUDIT_URL3
27523
27625
  }
27524
27626
  ];
27525
27627
 
@@ -27729,7 +27831,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27729
27831
  return [this.getManageCall(proofsIDs, manageCalls)];
27730
27832
  }
27731
27833
  };
27732
- function VaultDescription() {
27834
+ function VaultDescription(lstSymbol, underlyingSymbol) {
27733
27835
  const containerStyle = {
27734
27836
  maxWidth: "800px",
27735
27837
  margin: "0 auto",
@@ -27739,8 +27841,27 @@ function VaultDescription() {
27739
27841
  borderRadius: "12px"
27740
27842
  };
27741
27843
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: containerStyle, children: [
27742
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { style: { fontSize: "18px", marginBottom: "10px" }, children: "Meta Vault \u2014 Automated Yield Router" }),
27743
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: "This Levered Endur LST vault is a tokenized leveraged Vault, auto-compounding strategy that continuously allocates your deposited asset to the best available yield source in the ecosystem. Depositors receive vault shares that represent a proportional claim on the underlying assets and accrued yield. Allocation shifts are handled programmatically based on on-chain signals and risk filters, minimizing idle capital and maximizing net APY." }),
27844
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("h1", { style: { fontSize: "18px", marginBottom: "10px" }, children: [
27845
+ "Liquidation risk managed leverged ",
27846
+ lstSymbol,
27847
+ " Vault"
27848
+ ] }),
27849
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: [
27850
+ "This Levered Endur ",
27851
+ lstSymbol,
27852
+ " vault is a tokenized leveraged Vault, auto-compounding strategy that takes upto 5x leverage on ",
27853
+ lstSymbol,
27854
+ " by borrow ",
27855
+ underlyingSymbol,
27856
+ ". Borrowed amount is swapped to ",
27857
+ lstSymbol,
27858
+ " to create leverage. Depositors receive vault shares that represent a proportional claim on the underlying assets and accrued yield."
27859
+ ] }),
27860
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: [
27861
+ "This vault uses Vesu for lending and borrowing. The oracle used by this pool is a ",
27862
+ highlightTextWithLinks("conversion rate oracle", [{ highlight: "conversion rate oracle", link: "https://docs.pragma.build/starknet/development#conversion-rate" }]),
27863
+ "which is resilient to liquidity issues and price volatility, hence reducing the risk of liquidation. However, overtime, if left un-monitored, debt can increase enough to trigger a liquidation. But no worries, our continuous monitoring systems look for situations with reduced health factor and balance collateral/debt to bring it back to safe levels. With Troves, you can have a peaceful sleep."
27864
+ ] }),
27744
27865
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
27745
27866
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "Withdrawals:" }),
27746
27867
  " Requests can take up to ",
@@ -27749,8 +27870,8 @@ function VaultDescription() {
27749
27870
  ] }) })
27750
27871
  ] });
27751
27872
  }
27752
- function getDescription2(tokenSymbol) {
27753
- return VaultDescription();
27873
+ function getDescription2(tokenSymbol, underlyingSymbol) {
27874
+ return VaultDescription(tokenSymbol, underlyingSymbol);
27754
27875
  }
27755
27876
  function getLooperSettings2(lstSymbol, underlyingSymbol, vaultSettings, pool1) {
27756
27877
  vaultSettings.leafAdapters = [];
@@ -27791,11 +27912,12 @@ function getLooperSettings2(lstSymbol, underlyingSymbol, vaultSettings, pool1) {
27791
27912
  vaultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(STRKToken.address, lstToken.address, "avnu_swap_rewards" /* AVNU_SWAP_REWARDS */).bind(commonAdapter));
27792
27913
  return vaultSettings;
27793
27914
  }
27915
+ var AUDIT_URL4 = "https://docs.troves.fi/p/security#starknet-vault-kit";
27794
27916
  function getFAQs2(lstSymbol, underlyingSymbol) {
27795
27917
  return [
27796
27918
  {
27797
27919
  question: `What is the Hyper ${lstSymbol} Vault?`,
27798
- answer: `The Hyper ${lstSymbol} Vault is a tokenized strategy that automatically loops your ${underlyingSymbol} or ${lstSymbol} to create up to 4x leverage to hence yield in a very low risk manner.`
27920
+ answer: `The Hyper ${lstSymbol} Vault is a tokenized strategy that automatically loops your ${lstSymbol} to create up to 5x leverage to hence yield in a very low risk manner.`
27799
27921
  },
27800
27922
  {
27801
27923
  question: "How does yield allocation work?",
@@ -27839,8 +27961,9 @@ function getFAQs2(lstSymbol, underlyingSymbol) {
27839
27961
  }
27840
27962
  var _riskFactor4 = [
27841
27963
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 2 /* WELL_AUDITED */, weight: 25, reason: "Audited by Zellic" },
27842
- { type: "Liquidation Risk" /* LIQUIDATION_RISK */, value: 1 /* VERY_LOW_PROBABILITY */, weight: 50, reason: "The collateral and debt are highly correlated" },
27843
- { type: "Technical Risk" /* TECHNICAL_RISK */, value: 1 /* STABLE_INFRASTRUCTURE */, weight: 50, reason: "Liquidation can only happen if vault is left un-monitored for weeks, which is highly unlikely. We actively monitor all services on a daily basis." }
27964
+ { type: "Liquidation Risk" /* LIQUIDATION_RISK */, value: 1 /* VERY_LOW_PROBABILITY */, weight: 25, reason: "The collateral and debt are highly correlated" },
27965
+ { type: "Technical Risk" /* TECHNICAL_RISK */, value: 1 /* STABLE_INFRASTRUCTURE */, weight: 25, reason: "Liquidation can only happen if vault is left un-monitored for weeks, which is highly unlikely. We actively monitor all services on a daily basis." },
27966
+ { type: "Depeg Risk" /* DEPEG_RISK */, value: 2 /* GENERALLY_STABLE */, weight: 25, reason: "Generally stable pegged assets" }
27844
27967
  ];
27845
27968
  var hyperxSTRK = {
27846
27969
  vaultAddress: ContractAddr.from("0x46c7a54c82b1fe374353859f554a40b8bd31d3e30f742901579e7b57b1b5960"),
@@ -27903,14 +28026,13 @@ function getInvestmentSteps(lstSymbol, underlyingSymbol) {
27903
28026
  `The vault manager loops the ${underlyingSymbol} to buy ${lstSymbol}`,
27904
28027
  `The vault manager collateralizes the ${lstSymbol} on Vesu`,
27905
28028
  `The vault manager borrows more ${underlyingSymbol} to loop further`,
27906
- `Claim BTCFi STRK rewards weekly to swap to ${lstSymbol} and reinvest`,
27907
28029
  `If required, adjust leverage or re-allocate assets within LST pool on Vesu to optimize yield`
27908
28030
  ];
27909
28031
  }
27910
28032
  function getStrategySettings(lstSymbol, underlyingSymbol, addresses, isPreview = false) {
27911
28033
  return {
27912
28034
  name: `Hyper ${lstSymbol}`,
27913
- description: getDescription2(lstSymbol),
28035
+ description: getDescription2(lstSymbol, underlyingSymbol),
27914
28036
  address: addresses.vaultAddress,
27915
28037
  launchBlock: 0,
27916
28038
  type: "Other",
@@ -27921,6 +28043,7 @@ function getStrategySettings(lstSymbol, underlyingSymbol, addresses, isPreview =
27921
28043
  netRisk: _riskFactor4.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor4.reduce((acc, curr) => acc + curr.weight, 0),
27922
28044
  notARisks: getNoRiskTags(_riskFactor4)
27923
28045
  },
28046
+ auditUrl: AUDIT_URL4,
27924
28047
  protocols: [Protocols.ENDUR, Protocols.VESU],
27925
28048
  maxTVL: Web3Number.fromWei(0, 18),
27926
28049
  contractDetails: getContractDetails(addresses),
@@ -28033,7 +28156,7 @@ var TelegramNotif = class {
28033
28156
  var import_node_telegram_bot_api2 = __toESM(require("node-telegram-bot-api"));
28034
28157
  var TelegramGroupNotif = class {
28035
28158
  constructor(token, groupId, topicId) {
28036
- this.bot = new import_node_telegram_bot_api2.default(token, { polling: true });
28159
+ this.bot = new import_node_telegram_bot_api2.default(token, { polling: false });
28037
28160
  this.groupId = groupId;
28038
28161
  this.topicId = topicId;
28039
28162
  }