@strkfarm/sdk 1.0.49 → 1.0.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.
@@ -36032,7 +36032,7 @@ var strkfarm_risk_engine = (() => {
36032
36032
  var defaultTokens = [{
36033
36033
  name: "Starknet",
36034
36034
  symbol: "STRK",
36035
- logo: "https://assets.strkfarm.com/integrations/tokens/strk.svg",
36035
+ logo: "https://assets.troves.fi/integrations/tokens/strk.svg",
36036
36036
  address: ContractAddr.from("0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"),
36037
36037
  decimals: 18,
36038
36038
  coingeckId: "starknet",
@@ -36040,7 +36040,7 @@ var strkfarm_risk_engine = (() => {
36040
36040
  }, {
36041
36041
  name: "xSTRK",
36042
36042
  symbol: "xSTRK",
36043
- logo: "https://assets.strkfarm.com/integrations/tokens/xstrk.svg",
36043
+ logo: "https://assets.troves.fi/integrations/tokens/xstrk.svg",
36044
36044
  address: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a"),
36045
36045
  decimals: 18,
36046
36046
  coingeckId: void 0,
@@ -36048,7 +36048,7 @@ var strkfarm_risk_engine = (() => {
36048
36048
  }, {
36049
36049
  name: "ETH",
36050
36050
  symbol: "ETH",
36051
- logo: "https://assets.strkfarm.com/integrations/tokens/eth.svg",
36051
+ logo: "https://assets.troves.fi/integrations/tokens/eth.svg",
36052
36052
  address: ContractAddr.from("0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"),
36053
36053
  decimals: 18,
36054
36054
  coingeckId: void 0,
@@ -36056,7 +36056,7 @@ var strkfarm_risk_engine = (() => {
36056
36056
  }, {
36057
36057
  name: "USDC",
36058
36058
  symbol: "USDC",
36059
- logo: "https://assets.strkfarm.com/integrations/tokens/usdc.svg",
36059
+ logo: "https://assets.troves.fi/integrations/tokens/usdc.svg",
36060
36060
  address: ContractAddr.from("0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"),
36061
36061
  decimals: 6,
36062
36062
  coingeckId: void 0,
@@ -36064,7 +36064,7 @@ var strkfarm_risk_engine = (() => {
36064
36064
  }, {
36065
36065
  name: "USDT",
36066
36066
  symbol: "USDT",
36067
- logo: "https://assets.strkfarm.com/integrations/tokens/usdt.svg",
36067
+ logo: "https://assets.troves.fi/integrations/tokens/usdt.svg",
36068
36068
  address: ContractAddr.from("0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8"),
36069
36069
  decimals: 6,
36070
36070
  coingeckId: void 0,
@@ -36072,7 +36072,7 @@ var strkfarm_risk_engine = (() => {
36072
36072
  }, {
36073
36073
  name: "WBTC",
36074
36074
  symbol: "WBTC",
36075
- logo: "https://assets.strkfarm.com/integrations/tokens/wbtc.svg",
36075
+ logo: "https://assets.troves.fi/integrations/tokens/wbtc.svg",
36076
36076
  address: ContractAddr.from("0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac"),
36077
36077
  decimals: 8,
36078
36078
  coingeckId: void 0,
@@ -36096,7 +36096,7 @@ var strkfarm_risk_engine = (() => {
36096
36096
  }
36097
36097
  static async getTokens() {
36098
36098
  if (tokens.length) return tokens;
36099
- const data = await axios_default.get("https://assets.strkfarm.com/integrations/tokens.json");
36099
+ const data = await axios_default.get("https://assets.troves.fi/integrations/tokens.json");
36100
36100
  const tokensData = data.data.content;
36101
36101
  tokensData.forEach((token) => {
36102
36102
  if (!token.tags.includes("AVNU") || !token.tags.includes("Verified")) {
@@ -36624,7 +36624,7 @@ var strkfarm_risk_engine = (() => {
36624
36624
  }
36625
36625
  async getPriceFromMyAPI(tokenSymbol) {
36626
36626
  logger.verbose(`getPrice from redis: ${tokenSymbol}`);
36627
- const endpoint = "https://app.strkfarm.com";
36627
+ const endpoint = "https://app.troves.fi";
36628
36628
  const url = `${endpoint}/api/price/${tokenSymbol}`;
36629
36629
  const priceInfoRes = await fetch(url);
36630
36630
  const priceInfo = await priceInfoRes.json();
@@ -46033,7 +46033,7 @@ var strkfarm_risk_engine = (() => {
46033
46033
  { type: "Counterparty Risk" /* COUNTERPARTY_RISK */, value: 1, weight: 50, reason: "Reasonable max LTV ratios and Curated by well-known risk managers like Re7" },
46034
46034
  { type: "Oracle Risk" /* ORACLE_RISK */, value: 0.5, weight: 25, reason: "Uses Pragma price feeds, Most reputable price feed on Starknet" }
46035
46035
  ];
46036
- var AUDIT_URL = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
46036
+ var AUDIT_URL = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
46037
46037
  var faqs = [
46038
46038
  {
46039
46039
  question: "What is the Vesu Rebalancing Strategy?",
@@ -46071,7 +46071,7 @@ var strkfarm_risk_engine = (() => {
46071
46071
  question: "Is the strategy audited?",
46072
46072
  answer: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
46073
46073
  "Yes, the strategy has been audited. You can review the audit report in our docs ",
46074
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href: "https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
46074
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href: "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
46075
46075
  "."
46076
46076
  ] })
46077
46077
  }
@@ -46207,7 +46207,7 @@ var strkfarm_risk_engine = (() => {
46207
46207
  },
46208
46208
  ...COMMON_CONTRACTS
46209
46209
  ];
46210
- s.docs = "https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults";
46210
+ s.docs = "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults";
46211
46211
  s.description = highlightTextWithLinks(
46212
46212
  _description.replace("{{TOKEN}}", s.depositTokens[0].symbol),
46213
46213
  [{
@@ -51731,7 +51731,7 @@ var strkfarm_risk_engine = (() => {
51731
51731
  }
51732
51732
  };
51733
51733
  }
51734
- async getSwapInfoToHandleUnused(considerRebalance = true, newBounds = null) {
51734
+ async getSwapInfoToHandleUnused(considerRebalance = true, newBounds = null, maxIterations = 20) {
51735
51735
  const poolKey = await this.getPoolKey();
51736
51736
  const unusedBalances = await this.unusedBalances(poolKey);
51737
51737
  const { amount: token0Bal1, usdValue: token0PriceUsd } = unusedBalances.token0;
@@ -51768,10 +51768,11 @@ var strkfarm_risk_engine = (() => {
51768
51768
  poolKey,
51769
51769
  token0Bal,
51770
51770
  token1Bal,
51771
- ekuboBounds
51771
+ ekuboBounds,
51772
+ maxIterations
51772
51773
  );
51773
51774
  }
51774
- async getSwapInfoGivenAmounts(poolKey, token0Bal, token1Bal, bounds) {
51775
+ async getSwapInfoGivenAmounts(poolKey, token0Bal, token1Bal, bounds, maxIterations = 20) {
51775
51776
  logger.verbose(
51776
51777
  `${_EkuboCLVault.name}: getSwapInfoGivenAmounts::pre => token0Bal: ${token0Bal.toString()}, token1Bal: ${token1Bal.toString()}`
51777
51778
  );
@@ -51784,7 +51785,7 @@ var strkfarm_risk_engine = (() => {
51784
51785
  `${_EkuboCLVault.name}: getSwapInfoToHandleUnused => expectedAmounts2: ${expectedAmounts.amount0.toString()}, ${expectedAmounts.amount1.toString()}`
51785
51786
  );
51786
51787
  let retry = 0;
51787
- const maxRetry = 10;
51788
+ const maxRetry = maxIterations;
51788
51789
  function assertValidAmounts(expectedAmounts2, token0Bal2, token1Bal2) {
51789
51790
  if (expectedAmounts2.amount0.lessThan(token0Bal2) && expectedAmounts2.amount1.lessThan(token1Bal2)) {
51790
51791
  throw new Error("Both tokens are decreased, something is wrong");
@@ -51894,8 +51895,7 @@ var strkfarm_risk_engine = (() => {
51894
51895
  * @returns Array of contract calls needed for rebalancing
51895
51896
  * @throws Error if max retries reached without successful rebalance
51896
51897
  */
51897
- async rebalanceIter(swapInfo, acc, estimateCall, isSellTokenToken0 = true, retry = 0, lowerLimit = 0n, upperLimit = 0n) {
51898
- const MAX_RETRIES = 40;
51898
+ async rebalanceIter(swapInfo, acc, estimateCall, isSellTokenToken0 = true, retry = 0, lowerLimit = 0n, upperLimit = 0n, MAX_RETRIES = 40) {
51899
51899
  logger.verbose(
51900
51900
  `Rebalancing ${this.metadata.name}: retry=${retry}, lowerLimit=${lowerLimit}, upperLimit=${upperLimit}, isSellTokenToken0=${isSellTokenToken0}`
51901
51901
  );
@@ -52048,7 +52048,7 @@ var strkfarm_risk_engine = (() => {
52048
52048
  amount1
52049
52049
  };
52050
52050
  }
52051
- async harvest(acc) {
52051
+ async harvest(acc, maxIterations = 20) {
52052
52052
  const ekuboHarvests = new EkuboHarvests(this.config);
52053
52053
  const unClaimedRewards = await ekuboHarvests.getUnHarvestedRewards(
52054
52054
  this.address
@@ -52077,7 +52077,8 @@ var strkfarm_risk_engine = (() => {
52077
52077
  poolKey,
52078
52078
  token0Amt,
52079
52079
  token1Amt,
52080
- bounds
52080
+ bounds,
52081
+ maxIterations
52081
52082
  );
52082
52083
  swapInfo.token_to_address = token0Info.address.address;
52083
52084
  logger.verbose(
@@ -52201,7 +52202,7 @@ var strkfarm_risk_engine = (() => {
52201
52202
  var _riskFactorStable = [
52202
52203
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 }
52203
52204
  ];
52204
- var AUDIT_URL2 = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
52205
+ var AUDIT_URL2 = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
52205
52206
  var faqs2 = [
52206
52207
  {
52207
52208
  question: "What is the Ekubo CL Vault strategy?",
@@ -52223,7 +52224,7 @@ var strkfarm_risk_engine = (() => {
52223
52224
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
52224
52225
  "a",
52225
52226
  {
52226
- href: "https://docs.strkfarm.com/p/ekubo-cl-vaults#technical-details",
52227
+ href: "https://docs.troves.fi/p/ekubo-cl-vaults#technical-details",
52227
52228
  style: { textDecoration: "underline", marginLeft: "5px" },
52228
52229
  children: "Here"
52229
52230
  }
@@ -52347,7 +52348,7 @@ var strkfarm_risk_engine = (() => {
52347
52348
  },
52348
52349
  ...COMMON_CONTRACTS
52349
52350
  ];
52350
- s.docs = "https://docs.strkfarm.com/p/ekubo-cl-vaults";
52351
+ s.docs = "https://docs.troves.fi/p/ekubo-cl-vaults";
52351
52352
  s.description = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
52352
52353
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: highlightTextWithLinks(
52353
52354
  _description2.replace("{{POOL_NAME}}", s.name.split(" ")[1]),
@@ -115,7 +115,7 @@ var FatalError = class extends Error {
115
115
  var defaultTokens = [{
116
116
  name: "Starknet",
117
117
  symbol: "STRK",
118
- logo: "https://assets.strkfarm.com/integrations/tokens/strk.svg",
118
+ logo: "https://assets.troves.fi/integrations/tokens/strk.svg",
119
119
  address: ContractAddr.from("0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"),
120
120
  decimals: 18,
121
121
  coingeckId: "starknet",
@@ -123,7 +123,7 @@ var defaultTokens = [{
123
123
  }, {
124
124
  name: "xSTRK",
125
125
  symbol: "xSTRK",
126
- logo: "https://assets.strkfarm.com/integrations/tokens/xstrk.svg",
126
+ logo: "https://assets.troves.fi/integrations/tokens/xstrk.svg",
127
127
  address: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a"),
128
128
  decimals: 18,
129
129
  coingeckId: void 0,
@@ -131,7 +131,7 @@ var defaultTokens = [{
131
131
  }, {
132
132
  name: "ETH",
133
133
  symbol: "ETH",
134
- logo: "https://assets.strkfarm.com/integrations/tokens/eth.svg",
134
+ logo: "https://assets.troves.fi/integrations/tokens/eth.svg",
135
135
  address: ContractAddr.from("0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"),
136
136
  decimals: 18,
137
137
  coingeckId: void 0,
@@ -139,7 +139,7 @@ var defaultTokens = [{
139
139
  }, {
140
140
  name: "USDC",
141
141
  symbol: "USDC",
142
- logo: "https://assets.strkfarm.com/integrations/tokens/usdc.svg",
142
+ logo: "https://assets.troves.fi/integrations/tokens/usdc.svg",
143
143
  address: ContractAddr.from("0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"),
144
144
  decimals: 6,
145
145
  coingeckId: void 0,
@@ -147,7 +147,7 @@ var defaultTokens = [{
147
147
  }, {
148
148
  name: "USDT",
149
149
  symbol: "USDT",
150
- logo: "https://assets.strkfarm.com/integrations/tokens/usdt.svg",
150
+ logo: "https://assets.troves.fi/integrations/tokens/usdt.svg",
151
151
  address: ContractAddr.from("0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8"),
152
152
  decimals: 6,
153
153
  coingeckId: void 0,
@@ -155,7 +155,7 @@ var defaultTokens = [{
155
155
  }, {
156
156
  name: "WBTC",
157
157
  symbol: "WBTC",
158
- logo: "https://assets.strkfarm.com/integrations/tokens/wbtc.svg",
158
+ logo: "https://assets.troves.fi/integrations/tokens/wbtc.svg",
159
159
  address: ContractAddr.from("0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac"),
160
160
  decimals: 8,
161
161
  coingeckId: void 0,
@@ -179,7 +179,7 @@ var Global = class _Global {
179
179
  }
180
180
  static async getTokens() {
181
181
  if (tokens.length) return tokens;
182
- const data = await axios.get("https://assets.strkfarm.com/integrations/tokens.json");
182
+ const data = await axios.get("https://assets.troves.fi/integrations/tokens.json");
183
183
  const tokensData = data.data.content;
184
184
  tokensData.forEach((token) => {
185
185
  if (!token.tags.includes("AVNU") || !token.tags.includes("Verified")) {
@@ -714,7 +714,7 @@ var PricerFromApi = class extends PricerBase {
714
714
  }
715
715
  async getPriceFromMyAPI(tokenSymbol) {
716
716
  logger.verbose(`getPrice from redis: ${tokenSymbol}`);
717
- const endpoint = "https://app.strkfarm.com";
717
+ const endpoint = "https://app.troves.fi";
718
718
  const url = `${endpoint}/api/price/${tokenSymbol}`;
719
719
  const priceInfoRes = await fetch(url);
720
720
  const priceInfo = await priceInfoRes.json();
@@ -9819,7 +9819,7 @@ var _riskFactor = [
9819
9819
  { type: "Counterparty Risk" /* COUNTERPARTY_RISK */, value: 1, weight: 50, reason: "Reasonable max LTV ratios and Curated by well-known risk managers like Re7" },
9820
9820
  { type: "Oracle Risk" /* ORACLE_RISK */, value: 0.5, weight: 25, reason: "Uses Pragma price feeds, Most reputable price feed on Starknet" }
9821
9821
  ];
9822
- var AUDIT_URL = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
9822
+ var AUDIT_URL = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
9823
9823
  var faqs = [
9824
9824
  {
9825
9825
  question: "What is the Vesu Rebalancing Strategy?",
@@ -9857,7 +9857,7 @@ var faqs = [
9857
9857
  question: "Is the strategy audited?",
9858
9858
  answer: /* @__PURE__ */ jsxs("div", { children: [
9859
9859
  "Yes, the strategy has been audited. You can review the audit report in our docs ",
9860
- /* @__PURE__ */ jsx2("a", { href: "https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
9860
+ /* @__PURE__ */ jsx2("a", { href: "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
9861
9861
  "."
9862
9862
  ] })
9863
9863
  }
@@ -9993,7 +9993,7 @@ VesuRebalanceStrategies.forEach((s) => {
9993
9993
  },
9994
9994
  ...COMMON_CONTRACTS
9995
9995
  ];
9996
- s.docs = "https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults";
9996
+ s.docs = "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults";
9997
9997
  s.description = highlightTextWithLinks(
9998
9998
  _description.replace("{{TOKEN}}", s.depositTokens[0].symbol),
9999
9999
  [{
@@ -15524,7 +15524,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15524
15524
  }
15525
15525
  };
15526
15526
  }
15527
- async getSwapInfoToHandleUnused(considerRebalance = true, newBounds = null) {
15527
+ async getSwapInfoToHandleUnused(considerRebalance = true, newBounds = null, maxIterations = 20) {
15528
15528
  const poolKey = await this.getPoolKey();
15529
15529
  const unusedBalances = await this.unusedBalances(poolKey);
15530
15530
  const { amount: token0Bal1, usdValue: token0PriceUsd } = unusedBalances.token0;
@@ -15561,10 +15561,11 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15561
15561
  poolKey,
15562
15562
  token0Bal,
15563
15563
  token1Bal,
15564
- ekuboBounds
15564
+ ekuboBounds,
15565
+ maxIterations
15565
15566
  );
15566
15567
  }
15567
- async getSwapInfoGivenAmounts(poolKey, token0Bal, token1Bal, bounds) {
15568
+ async getSwapInfoGivenAmounts(poolKey, token0Bal, token1Bal, bounds, maxIterations = 20) {
15568
15569
  logger.verbose(
15569
15570
  `${_EkuboCLVault.name}: getSwapInfoGivenAmounts::pre => token0Bal: ${token0Bal.toString()}, token1Bal: ${token1Bal.toString()}`
15570
15571
  );
@@ -15577,7 +15578,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15577
15578
  `${_EkuboCLVault.name}: getSwapInfoToHandleUnused => expectedAmounts2: ${expectedAmounts.amount0.toString()}, ${expectedAmounts.amount1.toString()}`
15578
15579
  );
15579
15580
  let retry = 0;
15580
- const maxRetry = 10;
15581
+ const maxRetry = maxIterations;
15581
15582
  function assertValidAmounts(expectedAmounts2, token0Bal2, token1Bal2) {
15582
15583
  if (expectedAmounts2.amount0.lessThan(token0Bal2) && expectedAmounts2.amount1.lessThan(token1Bal2)) {
15583
15584
  throw new Error("Both tokens are decreased, something is wrong");
@@ -15687,8 +15688,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15687
15688
  * @returns Array of contract calls needed for rebalancing
15688
15689
  * @throws Error if max retries reached without successful rebalance
15689
15690
  */
15690
- async rebalanceIter(swapInfo, acc, estimateCall, isSellTokenToken0 = true, retry = 0, lowerLimit = 0n, upperLimit = 0n) {
15691
- const MAX_RETRIES = 40;
15691
+ async rebalanceIter(swapInfo, acc, estimateCall, isSellTokenToken0 = true, retry = 0, lowerLimit = 0n, upperLimit = 0n, MAX_RETRIES = 40) {
15692
15692
  logger.verbose(
15693
15693
  `Rebalancing ${this.metadata.name}: retry=${retry}, lowerLimit=${lowerLimit}, upperLimit=${upperLimit}, isSellTokenToken0=${isSellTokenToken0}`
15694
15694
  );
@@ -15841,7 +15841,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15841
15841
  amount1
15842
15842
  };
15843
15843
  }
15844
- async harvest(acc) {
15844
+ async harvest(acc, maxIterations = 20) {
15845
15845
  const ekuboHarvests = new EkuboHarvests(this.config);
15846
15846
  const unClaimedRewards = await ekuboHarvests.getUnHarvestedRewards(
15847
15847
  this.address
@@ -15870,7 +15870,8 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15870
15870
  poolKey,
15871
15871
  token0Amt,
15872
15872
  token1Amt,
15873
- bounds
15873
+ bounds,
15874
+ maxIterations
15874
15875
  );
15875
15876
  swapInfo.token_to_address = token0Info.address.address;
15876
15877
  logger.verbose(
@@ -15994,7 +15995,7 @@ var _riskFactor2 = [
15994
15995
  var _riskFactorStable = [
15995
15996
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 }
15996
15997
  ];
15997
- var AUDIT_URL2 = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
15998
+ var AUDIT_URL2 = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
15998
15999
  var faqs2 = [
15999
16000
  {
16000
16001
  question: "What is the Ekubo CL Vault strategy?",
@@ -16016,7 +16017,7 @@ var faqs2 = [
16016
16017
  /* @__PURE__ */ jsx3(
16017
16018
  "a",
16018
16019
  {
16019
- href: "https://docs.strkfarm.com/p/ekubo-cl-vaults#technical-details",
16020
+ href: "https://docs.troves.fi/p/ekubo-cl-vaults#technical-details",
16020
16021
  style: { textDecoration: "underline", marginLeft: "5px" },
16021
16022
  children: "Here"
16022
16023
  }
@@ -16140,7 +16141,7 @@ EkuboCLVaultStrategies.forEach((s) => {
16140
16141
  },
16141
16142
  ...COMMON_CONTRACTS
16142
16143
  ];
16143
- s.docs = "https://docs.strkfarm.com/p/ekubo-cl-vaults";
16144
+ s.docs = "https://docs.troves.fi/p/ekubo-cl-vaults";
16144
16145
  s.description = /* @__PURE__ */ jsxs2("div", { children: [
16145
16146
  /* @__PURE__ */ jsx3("p", { children: highlightTextWithLinks(
16146
16147
  _description2.replace("{{POOL_NAME}}", s.name.split(" ")[1]),
package/dist/index.d.ts CHANGED
@@ -678,7 +678,11 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
678
678
  tick: number;
679
679
  sqrtRatio: any;
680
680
  }>;
681
- private _getCurrentPrice;
681
+ _getCurrentPrice(poolKey: EkuboPoolKey, blockIdentifier?: BlockIdentifier): Promise<{
682
+ price: number;
683
+ tick: number;
684
+ sqrtRatio: any;
685
+ }>;
682
686
  getCurrentBounds(blockIdentifier?: BlockIdentifier): Promise<EkuboBounds>;
683
687
  static div2Power128(num: BigInt): number;
684
688
  static priceToTick(price: number, isRoundDown: boolean, tickSpacing: number): {
@@ -708,8 +712,8 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
708
712
  usdValue: number;
709
713
  };
710
714
  }>;
711
- getSwapInfoToHandleUnused(considerRebalance?: boolean, newBounds?: EkuboBounds | null): Promise<SwapInfo>;
712
- getSwapInfoGivenAmounts(poolKey: EkuboPoolKey, token0Bal: Web3Number, token1Bal: Web3Number, bounds: EkuboBounds): Promise<SwapInfo>;
715
+ getSwapInfoToHandleUnused(considerRebalance?: boolean, newBounds?: EkuboBounds | null, maxIterations?: number): Promise<SwapInfo>;
716
+ getSwapInfoGivenAmounts(poolKey: EkuboPoolKey, token0Bal: Web3Number, token1Bal: Web3Number, bounds: EkuboBounds, maxIterations?: number): Promise<SwapInfo>;
713
717
  /**
714
718
  * Attempts to rebalance the vault by iteratively adjusting swap amounts if initial attempt fails.
715
719
  * Uses binary search approach to find optimal swap amount.
@@ -723,7 +727,7 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
723
727
  * @returns Array of contract calls needed for rebalancing
724
728
  * @throws Error if max retries reached without successful rebalance
725
729
  */
726
- rebalanceIter(swapInfo: SwapInfo, acc: Account, estimateCall: (swapInfo: SwapInfo) => Promise<Call[]>, isSellTokenToken0?: boolean, retry?: number, lowerLimit?: bigint, upperLimit?: bigint): Promise<Call[]>;
730
+ rebalanceIter(swapInfo: SwapInfo, acc: Account, estimateCall: (swapInfo: SwapInfo) => Promise<Call[]>, isSellTokenToken0?: boolean, retry?: number, lowerLimit?: bigint, upperLimit?: bigint, MAX_RETRIES?: number): Promise<Call[]>;
727
731
  static tickToi129(tick: number): {
728
732
  mag: number;
729
733
  sign: number;
@@ -742,7 +746,7 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
742
746
  amount0: Web3Number;
743
747
  amount1: Web3Number;
744
748
  }>;
745
- harvest(acc: Account): Promise<Call[]>;
749
+ harvest(acc: Account, maxIterations?: number): Promise<Call[]>;
746
750
  getInvestmentFlows(): Promise<IInvestmentFlow[]>;
747
751
  }
748
752
  /**
package/dist/index.js CHANGED
@@ -226,7 +226,7 @@ var FatalError = class extends Error {
226
226
  var defaultTokens = [{
227
227
  name: "Starknet",
228
228
  symbol: "STRK",
229
- logo: "https://assets.strkfarm.com/integrations/tokens/strk.svg",
229
+ logo: "https://assets.troves.fi/integrations/tokens/strk.svg",
230
230
  address: ContractAddr.from("0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"),
231
231
  decimals: 18,
232
232
  coingeckId: "starknet",
@@ -234,7 +234,7 @@ var defaultTokens = [{
234
234
  }, {
235
235
  name: "xSTRK",
236
236
  symbol: "xSTRK",
237
- logo: "https://assets.strkfarm.com/integrations/tokens/xstrk.svg",
237
+ logo: "https://assets.troves.fi/integrations/tokens/xstrk.svg",
238
238
  address: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a"),
239
239
  decimals: 18,
240
240
  coingeckId: void 0,
@@ -242,7 +242,7 @@ var defaultTokens = [{
242
242
  }, {
243
243
  name: "ETH",
244
244
  symbol: "ETH",
245
- logo: "https://assets.strkfarm.com/integrations/tokens/eth.svg",
245
+ logo: "https://assets.troves.fi/integrations/tokens/eth.svg",
246
246
  address: ContractAddr.from("0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"),
247
247
  decimals: 18,
248
248
  coingeckId: void 0,
@@ -250,7 +250,7 @@ var defaultTokens = [{
250
250
  }, {
251
251
  name: "USDC",
252
252
  symbol: "USDC",
253
- logo: "https://assets.strkfarm.com/integrations/tokens/usdc.svg",
253
+ logo: "https://assets.troves.fi/integrations/tokens/usdc.svg",
254
254
  address: ContractAddr.from("0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"),
255
255
  decimals: 6,
256
256
  coingeckId: void 0,
@@ -258,7 +258,7 @@ var defaultTokens = [{
258
258
  }, {
259
259
  name: "USDT",
260
260
  symbol: "USDT",
261
- logo: "https://assets.strkfarm.com/integrations/tokens/usdt.svg",
261
+ logo: "https://assets.troves.fi/integrations/tokens/usdt.svg",
262
262
  address: ContractAddr.from("0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8"),
263
263
  decimals: 6,
264
264
  coingeckId: void 0,
@@ -266,7 +266,7 @@ var defaultTokens = [{
266
266
  }, {
267
267
  name: "WBTC",
268
268
  symbol: "WBTC",
269
- logo: "https://assets.strkfarm.com/integrations/tokens/wbtc.svg",
269
+ logo: "https://assets.troves.fi/integrations/tokens/wbtc.svg",
270
270
  address: ContractAddr.from("0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac"),
271
271
  decimals: 8,
272
272
  coingeckId: void 0,
@@ -290,7 +290,7 @@ var Global = class _Global {
290
290
  }
291
291
  static async getTokens() {
292
292
  if (tokens.length) return tokens;
293
- const data = await import_axios.default.get("https://assets.strkfarm.com/integrations/tokens.json");
293
+ const data = await import_axios.default.get("https://assets.troves.fi/integrations/tokens.json");
294
294
  const tokensData = data.data.content;
295
295
  tokensData.forEach((token) => {
296
296
  if (!token.tags.includes("AVNU") || !token.tags.includes("Verified")) {
@@ -833,7 +833,7 @@ var PricerFromApi = class extends PricerBase {
833
833
  }
834
834
  async getPriceFromMyAPI(tokenSymbol) {
835
835
  logger.verbose(`getPrice from redis: ${tokenSymbol}`);
836
- const endpoint = "https://app.strkfarm.com";
836
+ const endpoint = "https://app.troves.fi";
837
837
  const url = `${endpoint}/api/price/${tokenSymbol}`;
838
838
  const priceInfoRes = await fetch(url);
839
839
  const priceInfo = await priceInfoRes.json();
@@ -9938,7 +9938,7 @@ var _riskFactor = [
9938
9938
  { type: "Counterparty Risk" /* COUNTERPARTY_RISK */, value: 1, weight: 50, reason: "Reasonable max LTV ratios and Curated by well-known risk managers like Re7" },
9939
9939
  { type: "Oracle Risk" /* ORACLE_RISK */, value: 0.5, weight: 25, reason: "Uses Pragma price feeds, Most reputable price feed on Starknet" }
9940
9940
  ];
9941
- var AUDIT_URL = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
9941
+ var AUDIT_URL = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
9942
9942
  var faqs = [
9943
9943
  {
9944
9944
  question: "What is the Vesu Rebalancing Strategy?",
@@ -9976,7 +9976,7 @@ var faqs = [
9976
9976
  question: "Is the strategy audited?",
9977
9977
  answer: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
9978
9978
  "Yes, the strategy has been audited. You can review the audit report in our docs ",
9979
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href: "https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
9979
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href: "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
9980
9980
  "."
9981
9981
  ] })
9982
9982
  }
@@ -10112,7 +10112,7 @@ VesuRebalanceStrategies.forEach((s) => {
10112
10112
  },
10113
10113
  ...COMMON_CONTRACTS
10114
10114
  ];
10115
- s.docs = "https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults";
10115
+ s.docs = "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults";
10116
10116
  s.description = highlightTextWithLinks(
10117
10117
  _description.replace("{{TOKEN}}", s.depositTokens[0].symbol),
10118
10118
  [{
@@ -15639,7 +15639,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15639
15639
  }
15640
15640
  };
15641
15641
  }
15642
- async getSwapInfoToHandleUnused(considerRebalance = true, newBounds = null) {
15642
+ async getSwapInfoToHandleUnused(considerRebalance = true, newBounds = null, maxIterations = 20) {
15643
15643
  const poolKey = await this.getPoolKey();
15644
15644
  const unusedBalances = await this.unusedBalances(poolKey);
15645
15645
  const { amount: token0Bal1, usdValue: token0PriceUsd } = unusedBalances.token0;
@@ -15676,10 +15676,11 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15676
15676
  poolKey,
15677
15677
  token0Bal,
15678
15678
  token1Bal,
15679
- ekuboBounds
15679
+ ekuboBounds,
15680
+ maxIterations
15680
15681
  );
15681
15682
  }
15682
- async getSwapInfoGivenAmounts(poolKey, token0Bal, token1Bal, bounds) {
15683
+ async getSwapInfoGivenAmounts(poolKey, token0Bal, token1Bal, bounds, maxIterations = 20) {
15683
15684
  logger.verbose(
15684
15685
  `${_EkuboCLVault.name}: getSwapInfoGivenAmounts::pre => token0Bal: ${token0Bal.toString()}, token1Bal: ${token1Bal.toString()}`
15685
15686
  );
@@ -15692,7 +15693,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15692
15693
  `${_EkuboCLVault.name}: getSwapInfoToHandleUnused => expectedAmounts2: ${expectedAmounts.amount0.toString()}, ${expectedAmounts.amount1.toString()}`
15693
15694
  );
15694
15695
  let retry = 0;
15695
- const maxRetry = 10;
15696
+ const maxRetry = maxIterations;
15696
15697
  function assertValidAmounts(expectedAmounts2, token0Bal2, token1Bal2) {
15697
15698
  if (expectedAmounts2.amount0.lessThan(token0Bal2) && expectedAmounts2.amount1.lessThan(token1Bal2)) {
15698
15699
  throw new Error("Both tokens are decreased, something is wrong");
@@ -15802,8 +15803,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15802
15803
  * @returns Array of contract calls needed for rebalancing
15803
15804
  * @throws Error if max retries reached without successful rebalance
15804
15805
  */
15805
- async rebalanceIter(swapInfo, acc, estimateCall, isSellTokenToken0 = true, retry = 0, lowerLimit = 0n, upperLimit = 0n) {
15806
- const MAX_RETRIES = 40;
15806
+ async rebalanceIter(swapInfo, acc, estimateCall, isSellTokenToken0 = true, retry = 0, lowerLimit = 0n, upperLimit = 0n, MAX_RETRIES = 40) {
15807
15807
  logger.verbose(
15808
15808
  `Rebalancing ${this.metadata.name}: retry=${retry}, lowerLimit=${lowerLimit}, upperLimit=${upperLimit}, isSellTokenToken0=${isSellTokenToken0}`
15809
15809
  );
@@ -15956,7 +15956,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15956
15956
  amount1
15957
15957
  };
15958
15958
  }
15959
- async harvest(acc) {
15959
+ async harvest(acc, maxIterations = 20) {
15960
15960
  const ekuboHarvests = new EkuboHarvests(this.config);
15961
15961
  const unClaimedRewards = await ekuboHarvests.getUnHarvestedRewards(
15962
15962
  this.address
@@ -15985,7 +15985,8 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15985
15985
  poolKey,
15986
15986
  token0Amt,
15987
15987
  token1Amt,
15988
- bounds
15988
+ bounds,
15989
+ maxIterations
15989
15990
  );
15990
15991
  swapInfo.token_to_address = token0Info.address.address;
15991
15992
  logger.verbose(
@@ -16109,7 +16110,7 @@ var _riskFactor2 = [
16109
16110
  var _riskFactorStable = [
16110
16111
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 }
16111
16112
  ];
16112
- var AUDIT_URL2 = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
16113
+ var AUDIT_URL2 = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
16113
16114
  var faqs2 = [
16114
16115
  {
16115
16116
  question: "What is the Ekubo CL Vault strategy?",
@@ -16131,7 +16132,7 @@ var faqs2 = [
16131
16132
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
16132
16133
  "a",
16133
16134
  {
16134
- href: "https://docs.strkfarm.com/p/ekubo-cl-vaults#technical-details",
16135
+ href: "https://docs.troves.fi/p/ekubo-cl-vaults#technical-details",
16135
16136
  style: { textDecoration: "underline", marginLeft: "5px" },
16136
16137
  children: "Here"
16137
16138
  }
@@ -16255,7 +16256,7 @@ EkuboCLVaultStrategies.forEach((s) => {
16255
16256
  },
16256
16257
  ...COMMON_CONTRACTS
16257
16258
  ];
16258
- s.docs = "https://docs.strkfarm.com/p/ekubo-cl-vaults";
16259
+ s.docs = "https://docs.troves.fi/p/ekubo-cl-vaults";
16259
16260
  s.description = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
16260
16261
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: highlightTextWithLinks(
16261
16262
  _description2.replace("{{POOL_NAME}}", s.name.split(" ")[1]),
package/dist/index.mjs CHANGED
@@ -156,7 +156,7 @@ var FatalError = class extends Error {
156
156
  var defaultTokens = [{
157
157
  name: "Starknet",
158
158
  symbol: "STRK",
159
- logo: "https://assets.strkfarm.com/integrations/tokens/strk.svg",
159
+ logo: "https://assets.troves.fi/integrations/tokens/strk.svg",
160
160
  address: ContractAddr.from("0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"),
161
161
  decimals: 18,
162
162
  coingeckId: "starknet",
@@ -164,7 +164,7 @@ var defaultTokens = [{
164
164
  }, {
165
165
  name: "xSTRK",
166
166
  symbol: "xSTRK",
167
- logo: "https://assets.strkfarm.com/integrations/tokens/xstrk.svg",
167
+ logo: "https://assets.troves.fi/integrations/tokens/xstrk.svg",
168
168
  address: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a"),
169
169
  decimals: 18,
170
170
  coingeckId: void 0,
@@ -172,7 +172,7 @@ var defaultTokens = [{
172
172
  }, {
173
173
  name: "ETH",
174
174
  symbol: "ETH",
175
- logo: "https://assets.strkfarm.com/integrations/tokens/eth.svg",
175
+ logo: "https://assets.troves.fi/integrations/tokens/eth.svg",
176
176
  address: ContractAddr.from("0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"),
177
177
  decimals: 18,
178
178
  coingeckId: void 0,
@@ -180,7 +180,7 @@ var defaultTokens = [{
180
180
  }, {
181
181
  name: "USDC",
182
182
  symbol: "USDC",
183
- logo: "https://assets.strkfarm.com/integrations/tokens/usdc.svg",
183
+ logo: "https://assets.troves.fi/integrations/tokens/usdc.svg",
184
184
  address: ContractAddr.from("0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"),
185
185
  decimals: 6,
186
186
  coingeckId: void 0,
@@ -188,7 +188,7 @@ var defaultTokens = [{
188
188
  }, {
189
189
  name: "USDT",
190
190
  symbol: "USDT",
191
- logo: "https://assets.strkfarm.com/integrations/tokens/usdt.svg",
191
+ logo: "https://assets.troves.fi/integrations/tokens/usdt.svg",
192
192
  address: ContractAddr.from("0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8"),
193
193
  decimals: 6,
194
194
  coingeckId: void 0,
@@ -196,7 +196,7 @@ var defaultTokens = [{
196
196
  }, {
197
197
  name: "WBTC",
198
198
  symbol: "WBTC",
199
- logo: "https://assets.strkfarm.com/integrations/tokens/wbtc.svg",
199
+ logo: "https://assets.troves.fi/integrations/tokens/wbtc.svg",
200
200
  address: ContractAddr.from("0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac"),
201
201
  decimals: 8,
202
202
  coingeckId: void 0,
@@ -220,7 +220,7 @@ var Global = class _Global {
220
220
  }
221
221
  static async getTokens() {
222
222
  if (tokens.length) return tokens;
223
- const data = await axios.get("https://assets.strkfarm.com/integrations/tokens.json");
223
+ const data = await axios.get("https://assets.troves.fi/integrations/tokens.json");
224
224
  const tokensData = data.data.content;
225
225
  tokensData.forEach((token) => {
226
226
  if (!token.tags.includes("AVNU") || !token.tags.includes("Verified")) {
@@ -763,7 +763,7 @@ var PricerFromApi = class extends PricerBase {
763
763
  }
764
764
  async getPriceFromMyAPI(tokenSymbol) {
765
765
  logger.verbose(`getPrice from redis: ${tokenSymbol}`);
766
- const endpoint = "https://app.strkfarm.com";
766
+ const endpoint = "https://app.troves.fi";
767
767
  const url = `${endpoint}/api/price/${tokenSymbol}`;
768
768
  const priceInfoRes = await fetch(url);
769
769
  const priceInfo = await priceInfoRes.json();
@@ -9868,7 +9868,7 @@ var _riskFactor = [
9868
9868
  { type: "Counterparty Risk" /* COUNTERPARTY_RISK */, value: 1, weight: 50, reason: "Reasonable max LTV ratios and Curated by well-known risk managers like Re7" },
9869
9869
  { type: "Oracle Risk" /* ORACLE_RISK */, value: 0.5, weight: 25, reason: "Uses Pragma price feeds, Most reputable price feed on Starknet" }
9870
9870
  ];
9871
- var AUDIT_URL = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
9871
+ var AUDIT_URL = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
9872
9872
  var faqs = [
9873
9873
  {
9874
9874
  question: "What is the Vesu Rebalancing Strategy?",
@@ -9906,7 +9906,7 @@ var faqs = [
9906
9906
  question: "Is the strategy audited?",
9907
9907
  answer: /* @__PURE__ */ jsxs("div", { children: [
9908
9908
  "Yes, the strategy has been audited. You can review the audit report in our docs ",
9909
- /* @__PURE__ */ jsx2("a", { href: "https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
9909
+ /* @__PURE__ */ jsx2("a", { href: "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
9910
9910
  "."
9911
9911
  ] })
9912
9912
  }
@@ -10042,7 +10042,7 @@ VesuRebalanceStrategies.forEach((s) => {
10042
10042
  },
10043
10043
  ...COMMON_CONTRACTS
10044
10044
  ];
10045
- s.docs = "https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults";
10045
+ s.docs = "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults";
10046
10046
  s.description = highlightTextWithLinks(
10047
10047
  _description.replace("{{TOKEN}}", s.depositTokens[0].symbol),
10048
10048
  [{
@@ -15573,7 +15573,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15573
15573
  }
15574
15574
  };
15575
15575
  }
15576
- async getSwapInfoToHandleUnused(considerRebalance = true, newBounds = null) {
15576
+ async getSwapInfoToHandleUnused(considerRebalance = true, newBounds = null, maxIterations = 20) {
15577
15577
  const poolKey = await this.getPoolKey();
15578
15578
  const unusedBalances = await this.unusedBalances(poolKey);
15579
15579
  const { amount: token0Bal1, usdValue: token0PriceUsd } = unusedBalances.token0;
@@ -15610,10 +15610,11 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15610
15610
  poolKey,
15611
15611
  token0Bal,
15612
15612
  token1Bal,
15613
- ekuboBounds
15613
+ ekuboBounds,
15614
+ maxIterations
15614
15615
  );
15615
15616
  }
15616
- async getSwapInfoGivenAmounts(poolKey, token0Bal, token1Bal, bounds) {
15617
+ async getSwapInfoGivenAmounts(poolKey, token0Bal, token1Bal, bounds, maxIterations = 20) {
15617
15618
  logger.verbose(
15618
15619
  `${_EkuboCLVault.name}: getSwapInfoGivenAmounts::pre => token0Bal: ${token0Bal.toString()}, token1Bal: ${token1Bal.toString()}`
15619
15620
  );
@@ -15626,7 +15627,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15626
15627
  `${_EkuboCLVault.name}: getSwapInfoToHandleUnused => expectedAmounts2: ${expectedAmounts.amount0.toString()}, ${expectedAmounts.amount1.toString()}`
15627
15628
  );
15628
15629
  let retry = 0;
15629
- const maxRetry = 10;
15630
+ const maxRetry = maxIterations;
15630
15631
  function assertValidAmounts(expectedAmounts2, token0Bal2, token1Bal2) {
15631
15632
  if (expectedAmounts2.amount0.lessThan(token0Bal2) && expectedAmounts2.amount1.lessThan(token1Bal2)) {
15632
15633
  throw new Error("Both tokens are decreased, something is wrong");
@@ -15736,8 +15737,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15736
15737
  * @returns Array of contract calls needed for rebalancing
15737
15738
  * @throws Error if max retries reached without successful rebalance
15738
15739
  */
15739
- async rebalanceIter(swapInfo, acc, estimateCall, isSellTokenToken0 = true, retry = 0, lowerLimit = 0n, upperLimit = 0n) {
15740
- const MAX_RETRIES = 40;
15740
+ async rebalanceIter(swapInfo, acc, estimateCall, isSellTokenToken0 = true, retry = 0, lowerLimit = 0n, upperLimit = 0n, MAX_RETRIES = 40) {
15741
15741
  logger.verbose(
15742
15742
  `Rebalancing ${this.metadata.name}: retry=${retry}, lowerLimit=${lowerLimit}, upperLimit=${upperLimit}, isSellTokenToken0=${isSellTokenToken0}`
15743
15743
  );
@@ -15890,7 +15890,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15890
15890
  amount1
15891
15891
  };
15892
15892
  }
15893
- async harvest(acc) {
15893
+ async harvest(acc, maxIterations = 20) {
15894
15894
  const ekuboHarvests = new EkuboHarvests(this.config);
15895
15895
  const unClaimedRewards = await ekuboHarvests.getUnHarvestedRewards(
15896
15896
  this.address
@@ -15919,7 +15919,8 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15919
15919
  poolKey,
15920
15920
  token0Amt,
15921
15921
  token1Amt,
15922
- bounds
15922
+ bounds,
15923
+ maxIterations
15923
15924
  );
15924
15925
  swapInfo.token_to_address = token0Info.address.address;
15925
15926
  logger.verbose(
@@ -16043,7 +16044,7 @@ var _riskFactor2 = [
16043
16044
  var _riskFactorStable = [
16044
16045
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 }
16045
16046
  ];
16046
- var AUDIT_URL2 = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
16047
+ var AUDIT_URL2 = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
16047
16048
  var faqs2 = [
16048
16049
  {
16049
16050
  question: "What is the Ekubo CL Vault strategy?",
@@ -16065,7 +16066,7 @@ var faqs2 = [
16065
16066
  /* @__PURE__ */ jsx3(
16066
16067
  "a",
16067
16068
  {
16068
- href: "https://docs.strkfarm.com/p/ekubo-cl-vaults#technical-details",
16069
+ href: "https://docs.troves.fi/p/ekubo-cl-vaults#technical-details",
16069
16070
  style: { textDecoration: "underline", marginLeft: "5px" },
16070
16071
  children: "Here"
16071
16072
  }
@@ -16189,7 +16190,7 @@ EkuboCLVaultStrategies.forEach((s) => {
16189
16190
  },
16190
16191
  ...COMMON_CONTRACTS
16191
16192
  ];
16192
- s.docs = "https://docs.strkfarm.com/p/ekubo-cl-vaults";
16193
+ s.docs = "https://docs.troves.fi/p/ekubo-cl-vaults";
16193
16194
  s.description = /* @__PURE__ */ jsxs2("div", { children: [
16194
16195
  /* @__PURE__ */ jsx3("p", { children: highlightTextWithLinks(
16195
16196
  _description2.replace("{{POOL_NAME}}", s.name.split(" ")[1]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strkfarm/sdk",
3
- "version": "1.0.49",
3
+ "version": "1.0.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",
package/src/global.ts CHANGED
@@ -17,7 +17,7 @@ export class FatalError extends Error {
17
17
  const defaultTokens: TokenInfo[] = [{
18
18
  name: 'Starknet',
19
19
  symbol: 'STRK',
20
- logo: 'https://assets.strkfarm.com/integrations/tokens/strk.svg',
20
+ logo: 'https://assets.troves.fi/integrations/tokens/strk.svg',
21
21
  address: ContractAddr.from('0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d'),
22
22
  decimals: 18,
23
23
  coingeckId: 'starknet',
@@ -25,7 +25,7 @@ const defaultTokens: TokenInfo[] = [{
25
25
  }, {
26
26
  name: 'xSTRK',
27
27
  symbol: 'xSTRK',
28
- logo: 'https://assets.strkfarm.com/integrations/tokens/xstrk.svg',
28
+ logo: 'https://assets.troves.fi/integrations/tokens/xstrk.svg',
29
29
  address: ContractAddr.from('0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a'),
30
30
  decimals: 18,
31
31
  coingeckId: undefined,
@@ -33,7 +33,7 @@ const defaultTokens: TokenInfo[] = [{
33
33
  }, {
34
34
  name: 'ETH',
35
35
  symbol: 'ETH',
36
- logo: 'https://assets.strkfarm.com/integrations/tokens/eth.svg',
36
+ logo: 'https://assets.troves.fi/integrations/tokens/eth.svg',
37
37
  address: ContractAddr.from('0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'),
38
38
  decimals: 18,
39
39
  coingeckId: undefined,
@@ -41,7 +41,7 @@ const defaultTokens: TokenInfo[] = [{
41
41
  }, {
42
42
  name: 'USDC',
43
43
  symbol: 'USDC',
44
- logo: 'https://assets.strkfarm.com/integrations/tokens/usdc.svg',
44
+ logo: 'https://assets.troves.fi/integrations/tokens/usdc.svg',
45
45
  address: ContractAddr.from('0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8'),
46
46
  decimals: 6,
47
47
  coingeckId: undefined,
@@ -49,7 +49,7 @@ const defaultTokens: TokenInfo[] = [{
49
49
  }, {
50
50
  name: 'USDT',
51
51
  symbol: 'USDT',
52
- logo: 'https://assets.strkfarm.com/integrations/tokens/usdt.svg',
52
+ logo: 'https://assets.troves.fi/integrations/tokens/usdt.svg',
53
53
  address: ContractAddr.from('0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8'),
54
54
  decimals: 6,
55
55
  coingeckId: undefined,
@@ -57,7 +57,7 @@ const defaultTokens: TokenInfo[] = [{
57
57
  }, {
58
58
  name: 'WBTC',
59
59
  symbol: 'WBTC',
60
- logo: 'https://assets.strkfarm.com/integrations/tokens/wbtc.svg',
60
+ logo: 'https://assets.troves.fi/integrations/tokens/wbtc.svg',
61
61
  address: ContractAddr.from('0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac'),
62
62
  decimals: 8,
63
63
  coingeckId: undefined,
@@ -90,7 +90,7 @@ export class Global {
90
90
  if (tokens.length) return tokens;
91
91
 
92
92
  // fetch from avnu API
93
- const data = await axios.get('https://assets.strkfarm.com/integrations/tokens.json');
93
+ const data = await axios.get('https://assets.troves.fi/integrations/tokens.json');
94
94
  const tokensData = data.data.content;
95
95
 
96
96
  // Array of the following is returned
@@ -42,7 +42,7 @@ export class PricerFromApi extends PricerBase {
42
42
 
43
43
  async getPriceFromMyAPI(tokenSymbol: string) {
44
44
  logger.verbose(`getPrice from redis: ${tokenSymbol}`);
45
- const endpoint = 'https://app.strkfarm.com'
45
+ const endpoint = 'https://app.troves.fi'
46
46
  const url = `${endpoint}/api/price/${tokenSymbol}`;
47
47
  const priceInfoRes = await fetch(url);
48
48
  const priceInfo = await priceInfoRes.json();
@@ -566,7 +566,7 @@ export class EkuboCLVault extends BaseStrategy<
566
566
  return this._getCurrentPrice(poolKey, blockIdentifier);
567
567
  }
568
568
 
569
- private async _getCurrentPrice(
569
+ async _getCurrentPrice(
570
570
  poolKey: EkuboPoolKey,
571
571
  blockIdentifier: BlockIdentifier = "pending"
572
572
  ) {
@@ -872,7 +872,7 @@ export class EkuboCLVault extends BaseStrategy<
872
872
  };
873
873
  }
874
874
 
875
- async getSwapInfoToHandleUnused(considerRebalance: boolean = true, newBounds: EkuboBounds | null = null): Promise<SwapInfo> {
875
+ async getSwapInfoToHandleUnused(considerRebalance: boolean = true, newBounds: EkuboBounds | null = null, maxIterations = 20): Promise<SwapInfo> {
876
876
  const poolKey = await this.getPoolKey();
877
877
 
878
878
  // fetch current unused balances of vault
@@ -932,7 +932,8 @@ export class EkuboCLVault extends BaseStrategy<
932
932
  poolKey,
933
933
  token0Bal,
934
934
  token1Bal,
935
- ekuboBounds
935
+ ekuboBounds,
936
+ maxIterations
936
937
  );
937
938
  }
938
939
 
@@ -940,7 +941,8 @@ export class EkuboCLVault extends BaseStrategy<
940
941
  poolKey: EkuboPoolKey,
941
942
  token0Bal: Web3Number,
942
943
  token1Bal: Web3Number,
943
- bounds: EkuboBounds
944
+ bounds: EkuboBounds,
945
+ maxIterations: number = 20
944
946
  ): Promise<SwapInfo> {
945
947
  logger.verbose(
946
948
  `${
@@ -961,7 +963,7 @@ export class EkuboCLVault extends BaseStrategy<
961
963
  );
962
964
 
963
965
  let retry = 0;
964
- const maxRetry = 10;
966
+ const maxRetry = maxIterations;
965
967
 
966
968
  // Helper to check for invalid states:
967
969
  // Throws if both tokens are decreased or both are increased, which is not expected
@@ -1146,9 +1148,9 @@ export class EkuboCLVault extends BaseStrategy<
1146
1148
  isSellTokenToken0 = true,
1147
1149
  retry = 0,
1148
1150
  lowerLimit = 0n,
1149
- upperLimit = 0n
1151
+ upperLimit = 0n,
1152
+ MAX_RETRIES = 40
1150
1153
  ): Promise<Call[]> {
1151
- const MAX_RETRIES = 40;
1152
1154
 
1153
1155
  logger.verbose(
1154
1156
  `Rebalancing ${this.metadata.name}: ` +
@@ -1334,7 +1336,7 @@ export class EkuboCLVault extends BaseStrategy<
1334
1336
  };
1335
1337
  }
1336
1338
 
1337
- async harvest(acc: Account) {
1339
+ async harvest(acc: Account, maxIterations = 20): Promise<Call[]> {
1338
1340
  const ekuboHarvests = new EkuboHarvests(this.config);
1339
1341
  const unClaimedRewards = await ekuboHarvests.getUnHarvestedRewards(
1340
1342
  this.address
@@ -1377,7 +1379,8 @@ export class EkuboCLVault extends BaseStrategy<
1377
1379
  poolKey,
1378
1380
  token0Amt,
1379
1381
  token1Amt,
1380
- bounds
1382
+ bounds,
1383
+ maxIterations
1381
1384
  );
1382
1385
  swapInfo.token_to_address = token0Info.address.address;
1383
1386
  logger.verbose(
@@ -1521,7 +1524,7 @@ const _riskFactorStable: RiskFactor[] = [
1521
1524
  { type: RiskType.SMART_CONTRACT_RISK, value: 0.5, weight: 25 },
1522
1525
  ];
1523
1526
  const AUDIT_URL =
1524
- "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
1527
+ "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
1525
1528
 
1526
1529
  const faqs: FAQ[] = [
1527
1530
  {
@@ -1546,7 +1549,7 @@ const faqs: FAQ[] = [
1546
1549
  Yes, the strategy has been audited. You can review the audit report in
1547
1550
  our docs{" "}
1548
1551
  <a
1549
- href="https://docs.strkfarm.com/p/ekubo-cl-vaults#technical-details"
1552
+ href="https://docs.troves.fi/p/ekubo-cl-vaults#technical-details"
1550
1553
  style={{ textDecoration: "underline", marginLeft: "5px" }}
1551
1554
  >
1552
1555
  Here
@@ -1685,7 +1688,7 @@ EkuboCLVaultStrategies.forEach((s) => {
1685
1688
  },
1686
1689
  ...COMMON_CONTRACTS];
1687
1690
  // set docs link
1688
- s.docs = "https://docs.strkfarm.com/p/ekubo-cl-vaults"
1691
+ s.docs = "https://docs.troves.fi/p/ekubo-cl-vaults"
1689
1692
 
1690
1693
  // set description
1691
1694
  s.description = (
@@ -897,7 +897,7 @@ const _riskFactor: RiskFactor[] = [
897
897
  { type: RiskType.ORACLE_RISK, value: 0.5, weight: 25, reason: "Uses Pragma price feeds, Most reputable price feed on Starknet" }
898
898
  ];
899
899
  const AUDIT_URL =
900
- "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
900
+ "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
901
901
 
902
902
  const faqs: FAQ[] = [
903
903
  {
@@ -942,7 +942,7 @@ const faqs: FAQ[] = [
942
942
  {
943
943
  question: "Is the strategy audited?",
944
944
  answer:
945
- <div>Yes, the strategy has been audited. You can review the audit report in our docs <a href="https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults#technical-details" style={{textDecoration: 'underline', marginLeft: '5px'}}>Here</a>.</div>
945
+ <div>Yes, the strategy has been audited. You can review the audit report in our docs <a href="https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults#technical-details" style={{textDecoration: 'underline', marginLeft: '5px'}}>Here</a>.</div>
946
946
  }
947
947
  ];
948
948
 
@@ -1092,7 +1092,7 @@ VesuRebalanceStrategies.forEach((s) => {
1092
1092
  },
1093
1093
  ...COMMON_CONTRACTS];
1094
1094
  // set docs link
1095
- s.docs = "https://docs.strkfarm.com/p/strategies/vesu-fusion-rebalancing-vaults"
1095
+ s.docs = "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults"
1096
1096
 
1097
1097
  // set description
1098
1098
  s.description = highlightTextWithLinks(