@strkfarm/sdk 2.0.0-staging.70 → 2.0.0-staging.72

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.
@@ -4,6 +4,236 @@ import axios3 from "axios";
4
4
  // src/global.ts
5
5
  import axios from "axios";
6
6
 
7
+ // src/utils/logger.browser.ts
8
+ var logger = {
9
+ ...console,
10
+ verbose(message) {
11
+ console.log(`[VERBOSE] ${message}`);
12
+ }
13
+ };
14
+
15
+ // src/interfaces/lending.ts
16
+ var MarginType = /* @__PURE__ */ ((MarginType2) => {
17
+ MarginType2["SHARED"] = "shared";
18
+ MarginType2["NONE"] = "none";
19
+ return MarginType2;
20
+ })(MarginType || {});
21
+ var ILending = class {
22
+ constructor(config, metadata) {
23
+ this.tokens = [];
24
+ this.initialised = false;
25
+ this.metadata = metadata;
26
+ this.config = config;
27
+ this.init();
28
+ }
29
+ /** Wait for initialisation */
30
+ waitForInitilisation() {
31
+ return new Promise((resolve, reject) => {
32
+ const interval = setInterval(() => {
33
+ logger.verbose(`Waiting for ${this.metadata.name} to initialise`);
34
+ if (this.initialised) {
35
+ logger.verbose(`${this.metadata.name} initialised`);
36
+ clearInterval(interval);
37
+ resolve();
38
+ }
39
+ }, 1e3);
40
+ });
41
+ }
42
+ };
43
+
44
+ // src/interfaces/common.tsx
45
+ import { BlockTag, RpcProvider } from "starknet";
46
+ import { Fragment, jsx } from "react/jsx-runtime";
47
+ var RiskType = /* @__PURE__ */ ((RiskType2) => {
48
+ RiskType2["MARKET_RISK"] = "Market Risk";
49
+ RiskType2["IMPERMANENT_LOSS"] = "Impermanent Loss Risk";
50
+ RiskType2["LIQUIDATION_RISK"] = "Liquidation Risk";
51
+ RiskType2["LOW_LIQUIDITY_RISK"] = "Low Liquidity Risk";
52
+ RiskType2["SMART_CONTRACT_RISK"] = "Smart Contract Risk";
53
+ RiskType2["ORACLE_RISK"] = "Oracle Risk";
54
+ RiskType2["TECHNICAL_RISK"] = "Technical Risk";
55
+ RiskType2["COUNTERPARTY_RISK"] = "Counterparty Risk";
56
+ RiskType2["DEPEG_RISK"] = "Depeg Risk";
57
+ return RiskType2;
58
+ })(RiskType || {});
59
+ var TokenIndexingType = /* @__PURE__ */ ((TokenIndexingType2) => {
60
+ TokenIndexingType2["PEGGED"] = "pegged";
61
+ TokenIndexingType2["INDEXER"] = "indexer";
62
+ TokenIndexingType2["LST_SCRIPT"] = "lstScript";
63
+ TokenIndexingType2["IGNORE"] = "ignore";
64
+ return TokenIndexingType2;
65
+ })(TokenIndexingType || {});
66
+ var Network = /* @__PURE__ */ ((Network2) => {
67
+ Network2["mainnet"] = "mainnet";
68
+ Network2["sepolia"] = "sepolia";
69
+ Network2["devnet"] = "devnet";
70
+ return Network2;
71
+ })(Network || {});
72
+ var StrategyTag = /* @__PURE__ */ ((StrategyTag3) => {
73
+ StrategyTag3["META_VAULT"] = "Meta Vaults";
74
+ StrategyTag3["LEVERED"] = "Maxx";
75
+ StrategyTag3["AUTOMATED_LP"] = "Ekubo";
76
+ StrategyTag3["BTC"] = "BTC";
77
+ return StrategyTag3;
78
+ })(StrategyTag || {});
79
+ var VaultType = /* @__PURE__ */ ((VaultType2) => {
80
+ VaultType2["LOOPING"] = "Looping";
81
+ VaultType2["META_VAULT"] = "Meta Vault";
82
+ VaultType2["DELTA_NEUTRAL"] = "Delta Neutral";
83
+ VaultType2["AUTOMATED_LP"] = "Automated LP";
84
+ VaultType2["TVA"] = "Troves Value Averaging";
85
+ return VaultType2;
86
+ })(VaultType || {});
87
+ var AuditStatus = /* @__PURE__ */ ((AuditStatus2) => {
88
+ AuditStatus2["AUDITED"] = "Audited";
89
+ AuditStatus2["NOT_AUDITED"] = "Not Audited";
90
+ return AuditStatus2;
91
+ })(AuditStatus || {});
92
+ var SourceCodeType = /* @__PURE__ */ ((SourceCodeType2) => {
93
+ SourceCodeType2["OPEN_SOURCE"] = "Open Source";
94
+ SourceCodeType2["CLOSED_SOURCE"] = "Closed Source";
95
+ return SourceCodeType2;
96
+ })(SourceCodeType || {});
97
+ var AccessControlType = /* @__PURE__ */ ((AccessControlType2) => {
98
+ AccessControlType2["MULTISIG_ACCOUNT"] = "Multisig Account";
99
+ AccessControlType2["STANDARD_ACCOUNT"] = "Standard Account";
100
+ AccessControlType2["ROLE_BASED_ACCESS"] = "Role Based Access";
101
+ return AccessControlType2;
102
+ })(AccessControlType || {});
103
+ var InstantWithdrawalVault = /* @__PURE__ */ ((InstantWithdrawalVault2) => {
104
+ InstantWithdrawalVault2["YES"] = "Yes";
105
+ InstantWithdrawalVault2["NO"] = "No";
106
+ return InstantWithdrawalVault2;
107
+ })(InstantWithdrawalVault || {});
108
+ var FlowChartColors = /* @__PURE__ */ ((FlowChartColors2) => {
109
+ FlowChartColors2["Green"] = "purple";
110
+ FlowChartColors2["Blue"] = "#35484f";
111
+ FlowChartColors2["Purple"] = "#6e53dc";
112
+ return FlowChartColors2;
113
+ })(FlowChartColors || {});
114
+ var StrategyLiveStatus = /* @__PURE__ */ ((StrategyLiveStatus2) => {
115
+ StrategyLiveStatus2["ACTIVE"] = "Active";
116
+ StrategyLiveStatus2["NEW"] = "New";
117
+ StrategyLiveStatus2["COMING_SOON"] = "Coming Soon";
118
+ StrategyLiveStatus2["DEPRECATED"] = "Deprecated";
119
+ StrategyLiveStatus2["RETIRED"] = "Retired";
120
+ StrategyLiveStatus2["HOT"] = "Hot & New \u{1F525}";
121
+ return StrategyLiveStatus2;
122
+ })(StrategyLiveStatus || {});
123
+ function getMainnetConfig(rpcUrl = "https://starknet-mainnet.public.blastapi.io", blockIdentifier = BlockTag.LATEST) {
124
+ return {
125
+ provider: new RpcProvider({
126
+ nodeUrl: rpcUrl,
127
+ blockIdentifier
128
+ // specVersion
129
+ }),
130
+ stage: "production",
131
+ network: "mainnet" /* mainnet */
132
+ };
133
+ }
134
+ var getStrategyTagDesciption = (tag) => {
135
+ switch (tag) {
136
+ case "Meta Vaults" /* META_VAULT */:
137
+ return "A meta vault is a vault that auto allocates funds to multiple vaults based on optimal yield opportunities";
138
+ case "Maxx" /* LEVERED */:
139
+ return "Looping vaults on Endur LSTs with leveraged borrowing of STRK or BTC to increase yield (2-4x higher yield than simply staking)";
140
+ case "Ekubo" /* AUTOMATED_LP */:
141
+ return "Automated LP vaults on Ekubo that rebalance position automatically, ensuring you earn fees efficiently";
142
+ case "BTC" /* BTC */:
143
+ return "BTC linked vaults";
144
+ }
145
+ };
146
+ var getAllStrategyTags = () => {
147
+ return Object.values(StrategyTag);
148
+ };
149
+ var getRiskExplaination = (riskType) => {
150
+ switch (riskType) {
151
+ case "Market Risk" /* MARKET_RISK */:
152
+ return "The risk of the market moving against the position.";
153
+ case "Impermanent Loss Risk" /* IMPERMANENT_LOSS */:
154
+ return "The temporary loss of value experienced by liquidity providers in AMMs when asset prices diverge compared to simply holding them.";
155
+ case "Liquidation Risk" /* LIQUIDATION_RISK */:
156
+ return "The risk of losing funds due to the position being liquidated.";
157
+ case "Low Liquidity Risk" /* LOW_LIQUIDITY_RISK */:
158
+ return "The risk of low liquidity in the pool, which can lead to high slippages or reduced in-abilities to quickly exit the position.";
159
+ case "Oracle Risk" /* ORACLE_RISK */:
160
+ return "The risk of the oracle being manipulated or incorrect.";
161
+ case "Smart Contract Risk" /* SMART_CONTRACT_RISK */:
162
+ return "The risk of the smart contract being vulnerable to attacks.";
163
+ case "Technical Risk" /* TECHNICAL_RISK */:
164
+ return "The risk of technical issues e.g. backend failure.";
165
+ case "Counterparty Risk" /* COUNTERPARTY_RISK */:
166
+ return "The risk of the counterparty defaulting e.g. bad debt on lending platforms.";
167
+ case "Depeg Risk" /* DEPEG_RISK */:
168
+ return "The risk of a token losing its peg to the underlying asset, leading to potential losses for holders.";
169
+ }
170
+ };
171
+ var getRiskColor = (risk) => {
172
+ const value = risk.value;
173
+ if (value <= 2) return "light_green_2";
174
+ if (value < 3) return "yellow";
175
+ return "red";
176
+ };
177
+ var getNoRiskTags = (risks) => {
178
+ const noRisks1 = risks.filter((risk) => risk.value === 0).map((risk) => risk.type);
179
+ const noRisks2 = Object.values(RiskType).filter(
180
+ (risk) => !risks.map((risk2) => risk2.type).includes(risk)
181
+ );
182
+ const mergedUnique = [.../* @__PURE__ */ new Set([...noRisks1, ...noRisks2])];
183
+ return mergedUnique;
184
+ };
185
+ function highlightTextWithLinks(put, highlights) {
186
+ const escapeRegExp = (text) => text.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
187
+ const pattern = new RegExp(
188
+ `(${highlights.map((m) => escapeRegExp(m.highlight)).join("|")})`,
189
+ "gi"
190
+ );
191
+ const parts = put.split(pattern);
192
+ return /* @__PURE__ */ jsx(Fragment, { children: parts.map((part, i) => {
193
+ const match = highlights.find((m) => m.highlight.toLowerCase() === part.toLowerCase());
194
+ return match ? /* @__PURE__ */ jsx("a", { href: match.link, target: "_blank", style: { color: "white", background: "rgba(255, 255, 255, 0.04)" }, children: part }, i) : /* @__PURE__ */ jsx("span", { children: part }, i);
195
+ }) });
196
+ }
197
+ var VesuProtocol = {
198
+ name: "Vesu",
199
+ logo: "https://static-assets-8zct.onrender.com/integrations/vesu/logo.png"
200
+ };
201
+ var EndurProtocol = {
202
+ name: "Endur",
203
+ logo: "http://endur.fi/logo.png"
204
+ };
205
+ var ExtendedProtocol = {
206
+ name: "Extended",
207
+ logo: "https://static-assets-8zct.onrender.com/integrations/extended/extended.svg"
208
+ };
209
+ var Protocols = {
210
+ VESU: VesuProtocol,
211
+ ENDUR: EndurProtocol,
212
+ EXTENDED: ExtendedProtocol
213
+ };
214
+ var UnwrapLabsCurator = {
215
+ name: "Unwrap Labs",
216
+ logo: "https://assets.troves.fi/integrations/unwraplabs/white.png"
217
+ };
218
+
219
+ // src/interfaces/initializable.ts
220
+ var Initializable = class {
221
+ constructor() {
222
+ this.initialized = false;
223
+ }
224
+ async waitForInitilisation() {
225
+ return new Promise((resolve, reject) => {
226
+ const interval = setInterval(() => {
227
+ if (this.initialized) {
228
+ console.log("Initialised");
229
+ clearInterval(interval);
230
+ resolve();
231
+ }
232
+ }, 1e3);
233
+ });
234
+ }
235
+ };
236
+
7
237
  // src/dataTypes/bignumber.browser.ts
8
238
  import { uint256 as uint2562 } from "starknet";
9
239
 
@@ -256,14 +486,6 @@ var MyNumber = class _MyNumber {
256
486
  }
257
487
  };
258
488
 
259
- // src/utils/logger.browser.ts
260
- var logger = {
261
- ...console,
262
- verbose(message) {
263
- console.log(`[VERBOSE] ${message}`);
264
- }
265
- };
266
-
267
489
  // src/global.ts
268
490
  var FatalError = class extends Error {
269
491
  constructor(message, err) {
@@ -282,7 +504,9 @@ var defaultTokens = [{
282
504
  decimals: 18,
283
505
  coingeckId: "starknet",
284
506
  displayDecimals: 2,
285
- priceCheckAmount: 1e3
507
+ priceCheckAmount: 5e3,
508
+ priceMethod: "Avnu",
509
+ indexingType: "indexer" /* INDEXER */
286
510
  }, {
287
511
  name: "xSTRK",
288
512
  symbol: "xSTRK",
@@ -290,8 +514,10 @@ var defaultTokens = [{
290
514
  address: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a"),
291
515
  decimals: 18,
292
516
  coingeckId: void 0,
293
- priceCheckAmount: 1e3,
294
- displayDecimals: 2
517
+ priceCheckAmount: 5e3,
518
+ displayDecimals: 2,
519
+ priceMethod: "Avnu",
520
+ indexingType: "lstScript" /* LST_SCRIPT */
295
521
  }, {
296
522
  name: "ETH",
297
523
  symbol: "ETH",
@@ -300,7 +526,8 @@ var defaultTokens = [{
300
526
  decimals: 18,
301
527
  coingeckId: void 0,
302
528
  priceCheckAmount: 0.1,
303
- displayDecimals: 6
529
+ displayDecimals: 6,
530
+ indexingType: "indexer" /* INDEXER */
304
531
  }, {
305
532
  name: "USDC.e",
306
533
  symbol: "USDC.e",
@@ -309,7 +536,9 @@ var defaultTokens = [{
309
536
  decimals: 6,
310
537
  coingeckId: void 0,
311
538
  displayDecimals: 2,
312
- priceCheckAmount: 1e3
539
+ priceCheckAmount: 1e3,
540
+ priceProxySymbol: "USDC",
541
+ indexingType: "pegged" /* PEGGED */
313
542
  }, {
314
543
  name: "USDC",
315
544
  symbol: "USDC",
@@ -318,7 +547,8 @@ var defaultTokens = [{
318
547
  decimals: 6,
319
548
  coingeckId: void 0,
320
549
  displayDecimals: 2,
321
- priceCheckAmount: 1e3
550
+ priceCheckAmount: 1e3,
551
+ indexingType: "indexer" /* INDEXER */
322
552
  }, {
323
553
  name: "USDT",
324
554
  symbol: "USDT",
@@ -327,7 +557,8 @@ var defaultTokens = [{
327
557
  decimals: 6,
328
558
  coingeckId: void 0,
329
559
  priceCheckAmount: 1e3,
330
- displayDecimals: 2
560
+ displayDecimals: 2,
561
+ indexingType: "indexer" /* INDEXER */
331
562
  }, {
332
563
  name: "WBTC",
333
564
  symbol: "WBTC",
@@ -336,8 +567,9 @@ var defaultTokens = [{
336
567
  decimals: 8,
337
568
  coingeckId: void 0,
338
569
  displayDecimals: 6,
339
- priceCheckAmount: 1e-3
570
+ priceCheckAmount: 1e-3,
340
571
  // 112000 * 0.0001 = $110.2
572
+ indexingType: "indexer" /* INDEXER */
341
573
  }, {
342
574
  name: "tBTC",
343
575
  symbol: "tBTC",
@@ -346,8 +578,10 @@ var defaultTokens = [{
346
578
  decimals: 18,
347
579
  coingeckId: void 0,
348
580
  displayDecimals: 6,
349
- priceCheckAmount: 1e-3
581
+ priceCheckAmount: 1e-3,
350
582
  // 112000 * 0.0001 = $110.2
583
+ priceProxySymbol: "WBTC",
584
+ indexingType: "pegged" /* PEGGED */
351
585
  }, {
352
586
  name: "solvBTC",
353
587
  symbol: "solvBTC",
@@ -357,8 +591,9 @@ var defaultTokens = [{
357
591
  coingeckId: void 0,
358
592
  priceProxySymbol: "WBTC",
359
593
  displayDecimals: 6,
360
- priceCheckAmount: 1e-4
594
+ priceCheckAmount: 1e-4,
361
595
  // 112000 * 0.0001 = $11.2
596
+ indexingType: "pegged" /* PEGGED */
362
597
  }, {
363
598
  name: "LBTC",
364
599
  symbol: "LBTC",
@@ -368,8 +603,9 @@ var defaultTokens = [{
368
603
  coingeckId: void 0,
369
604
  displayDecimals: 6,
370
605
  priceProxySymbol: "WBTC",
371
- priceCheckAmount: 1e-4
606
+ priceCheckAmount: 1e-4,
372
607
  // 112000 * 0.0001 = $11.2
608
+ indexingType: "pegged" /* PEGGED */
373
609
  }, {
374
610
  name: "xWBTC",
375
611
  symbol: "xWBTC",
@@ -378,9 +614,10 @@ var defaultTokens = [{
378
614
  decimals: 8,
379
615
  coingeckId: void 0,
380
616
  displayDecimals: 6,
381
- priceProxySymbol: "WBTC",
382
- priceCheckAmount: 1e-3
617
+ priceCheckAmount: 1e-3,
383
618
  // 112000 * 0.0001 = $110.2
619
+ priceMethod: "Avnu",
620
+ indexingType: "lstScript" /* LST_SCRIPT */
384
621
  }, {
385
622
  name: "xsBTC",
386
623
  symbol: "xsBTC",
@@ -389,11 +626,11 @@ var defaultTokens = [{
389
626
  decimals: 18,
390
627
  coingeckId: void 0,
391
628
  displayDecimals: 6,
392
- priceProxySymbol: "WBTC",
393
- priceCheckAmount: 1e-4
629
+ priceCheckAmount: 1e-4,
394
630
  // 112000 * 0.0001 = $11.2
631
+ priceMethod: "Avnu",
632
+ indexingType: "lstScript" /* LST_SCRIPT */
395
633
  }, {
396
- // todo upgrade proxy tokens once feeds are available
397
634
  name: "xtBTC",
398
635
  symbol: "xtBTC",
399
636
  logo: "https://assets.strkfarm.com/integrations/tokens/xtbtc.svg",
@@ -403,7 +640,8 @@ var defaultTokens = [{
403
640
  displayDecimals: 6,
404
641
  priceCheckAmount: 1e-3,
405
642
  // 112000 * 0.0001 = $110.2
406
- priceProxySymbol: "WBTC"
643
+ priceMethod: "Avnu",
644
+ indexingType: "lstScript" /* LST_SCRIPT */
407
645
  }, {
408
646
  name: "xLBTC",
409
647
  symbol: "xLBTC",
@@ -412,9 +650,10 @@ var defaultTokens = [{
412
650
  decimals: 8,
413
651
  coingeckId: void 0,
414
652
  displayDecimals: 6,
415
- priceProxySymbol: "WBTC",
416
- priceCheckAmount: 1e-4
653
+ priceCheckAmount: 1e-4,
417
654
  // 112000 * 0.0001 = $11.2
655
+ priceMethod: "Avnu",
656
+ indexingType: "lstScript" /* LST_SCRIPT */
418
657
  }, {
419
658
  name: "mRe7BTC",
420
659
  symbol: "mRe7BTC",
@@ -425,7 +664,8 @@ var defaultTokens = [{
425
664
  displayDecimals: 6,
426
665
  priceCheckAmount: 1e-4,
427
666
  // 112000 * 0.0001 = $11.2
428
- dontPrice: true
667
+ dontPrice: true,
668
+ indexingType: "ignore" /* IGNORE */
429
669
  }, {
430
670
  name: "mRe7YIELD",
431
671
  symbol: "mRe7YIELD",
@@ -435,7 +675,8 @@ var defaultTokens = [{
435
675
  coingeckId: void 0,
436
676
  displayDecimals: 2,
437
677
  priceCheckAmount: 100,
438
- dontPrice: true
678
+ dontPrice: true,
679
+ indexingType: "ignore" /* IGNORE */
439
680
  }, {
440
681
  name: "fyeWBTC",
441
682
  symbol: "fyeWBTC",
@@ -446,7 +687,8 @@ var defaultTokens = [{
446
687
  displayDecimals: 6,
447
688
  priceCheckAmount: 1e-3,
448
689
  // 112000 * 0.0001 = $110.2
449
- dontPrice: true
690
+ dontPrice: true,
691
+ indexingType: "ignore" /* IGNORE */
450
692
  }, {
451
693
  name: "fyETH",
452
694
  symbol: "fyETH",
@@ -456,7 +698,8 @@ var defaultTokens = [{
456
698
  coingeckId: void 0,
457
699
  displayDecimals: 4,
458
700
  priceCheckAmount: 0.1,
459
- dontPrice: true
701
+ dontPrice: true,
702
+ indexingType: "ignore" /* IGNORE */
460
703
  }, {
461
704
  name: "fyeUSDC",
462
705
  symbol: "fyeUSDC",
@@ -466,7 +709,8 @@ var defaultTokens = [{
466
709
  coingeckId: void 0,
467
710
  displayDecimals: 2,
468
711
  priceCheckAmount: 100,
469
- dontPrice: true
712
+ dontPrice: true,
713
+ indexingType: "ignore" /* IGNORE */
470
714
  }, {
471
715
  name: "strkBTC",
472
716
  symbol: "strkBTC",
@@ -477,7 +721,9 @@ var defaultTokens = [{
477
721
  displayDecimals: 6,
478
722
  priceCheckAmount: 1e-3,
479
723
  // 112000 * 0.0001 = $110.2
480
- priceProxySymbol: "WBTC"
724
+ priceMethod: "Avnu",
725
+ priceProxySymbol: "WBTC",
726
+ indexingType: "pegged" /* PEGGED */
481
727
  }, {
482
728
  name: "xstrkBTC",
483
729
  symbol: "xstrkBTC",
@@ -487,7 +733,8 @@ var defaultTokens = [{
487
733
  coingeckId: void 0,
488
734
  displayDecimals: 6,
489
735
  priceCheckAmount: 1e-3,
490
- priceProxySymbol: "WBTC"
736
+ priceMethod: "Avnu",
737
+ indexingType: "lstScript" /* LST_SCRIPT */
491
738
  }];
492
739
  var tokens = defaultTokens;
493
740
  var _Global = class _Global {
@@ -520,7 +767,8 @@ var _Global = class _Global {
520
767
  decimals: token.decimals,
521
768
  logo: token.logoUri,
522
769
  coingeckId: token.extensions.coingeckoId,
523
- displayDecimals: 2
770
+ displayDecimals: 2,
771
+ indexingType: "ignore" /* IGNORE */
524
772
  });
525
773
  });
526
774
  console.log(tokens);
@@ -971,21 +1219,14 @@ var Pricer = class extends PricerBase {
971
1219
  }
972
1220
  }
973
1221
  async _getPrice(token) {
974
- const pinned = this.methodToUse[token.symbol];
975
- if (pinned) {
976
- logger.verbose(`Fetching price of ${token.symbol} using pinned ${pinned}`);
977
- try {
978
- return await this._tryPriceMethod(token, pinned);
979
- } catch (error) {
980
- console.warn(`${pinned}: pinned price failed [${token.symbol}]: `, error.message);
981
- delete this.methodToUse[token.symbol];
982
- }
983
- }
984
- for (const method of PRICE_METHOD_PRIORITY) {
1222
+ const methodsToTry = this._getMethodsToTry(token);
1223
+ for (const method of methodsToTry) {
985
1224
  logger.verbose(`Fetching price of ${token.symbol} using ${method}`);
986
1225
  try {
987
1226
  const result = await this._tryPriceMethod(token, method);
988
- this.methodToUse[token.symbol] = method;
1227
+ if (!token.priceMethod) {
1228
+ this.methodToUse[token.symbol] = method;
1229
+ }
989
1230
  return result;
990
1231
  } catch (error) {
991
1232
  console.warn(`${method}: price err [${token.symbol}]: `, error.message);
@@ -993,6 +1234,22 @@ var Pricer = class extends PricerBase {
993
1234
  }
994
1235
  throw new FatalError(`Price not found for ${token.symbol}`);
995
1236
  }
1237
+ _getMethodsToTry(token) {
1238
+ const methods = [];
1239
+ if (token.priceMethod) {
1240
+ methods.push(token.priceMethod);
1241
+ }
1242
+ const pinned = this.methodToUse[token.symbol];
1243
+ if (pinned && pinned !== token.priceMethod) {
1244
+ methods.push(pinned);
1245
+ }
1246
+ for (const method of PRICE_METHOD_PRIORITY) {
1247
+ if (!methods.includes(method)) {
1248
+ methods.push(method);
1249
+ }
1250
+ }
1251
+ return methods;
1252
+ }
996
1253
  async _tryPriceMethod(token, method) {
997
1254
  switch (method) {
998
1255
  case "AvnuApi":
@@ -1192,37 +1449,6 @@ var Pragma = class extends PricerBase {
1192
1449
 
1193
1450
  // src/modules/zkLend.ts
1194
1451
  import axios4 from "axios";
1195
-
1196
- // src/interfaces/lending.ts
1197
- var MarginType = /* @__PURE__ */ ((MarginType2) => {
1198
- MarginType2["SHARED"] = "shared";
1199
- MarginType2["NONE"] = "none";
1200
- return MarginType2;
1201
- })(MarginType || {});
1202
- var ILending = class {
1203
- constructor(config, metadata) {
1204
- this.tokens = [];
1205
- this.initialised = false;
1206
- this.metadata = metadata;
1207
- this.config = config;
1208
- this.init();
1209
- }
1210
- /** Wait for initialisation */
1211
- waitForInitilisation() {
1212
- return new Promise((resolve, reject) => {
1213
- const interval = setInterval(() => {
1214
- logger.verbose(`Waiting for ${this.metadata.name} to initialise`);
1215
- if (this.initialised) {
1216
- logger.verbose(`${this.metadata.name} initialised`);
1217
- clearInterval(interval);
1218
- resolve();
1219
- }
1220
- }, 1e3);
1221
- });
1222
- }
1223
- };
1224
-
1225
- // src/modules/zkLend.ts
1226
1452
  var _ZkLend = class _ZkLend extends ILending {
1227
1453
  constructor(config, pricer) {
1228
1454
  super(config, {
@@ -1252,7 +1478,8 @@ var _ZkLend = class _ZkLend extends ILending {
1252
1478
  decimals: pool.token.decimals,
1253
1479
  borrowFactor: Web3Number.fromWei(pool.borrow_factor.value, pool.borrow_factor.decimals),
1254
1480
  collareralFactor,
1255
- displayDecimals: 2
1481
+ displayDecimals: 2,
1482
+ indexingType: "ignore" /* IGNORE */
1256
1483
  };
1257
1484
  this.tokens.push(token);
1258
1485
  });
@@ -1654,7 +1881,8 @@ var EkuboPricer = class extends PricerBase {
1654
1881
  constructor(config, tokens2) {
1655
1882
  super(config, tokens2);
1656
1883
  this.EKUBO_PRICE_FETCHER_ADDRESS = "0x04946fb4ad5237d97bbb1256eba2080c4fe1de156da6a7f83e3b4823bb6d7da1";
1657
- this.USDC_ADDRESS = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8";
1884
+ // Updating to new USDC_ADDRESS
1885
+ this.USDC_ADDRESS = "0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb";
1658
1886
  this.USDC_DECIMALS = 6;
1659
1887
  this.contract = new Contract2({
1660
1888
  abi: ekubo_price_fethcer_abi_default,
@@ -3240,192 +3468,6 @@ LSTAPRService.cache = null;
3240
3468
  LSTAPRService.cacheTimestamp = 0;
3241
3469
  LSTAPRService.CACHE_DURATION = 5 * 60 * 1e3;
3242
3470
 
3243
- // src/interfaces/common.tsx
3244
- import { BlockTag, RpcProvider as RpcProvider3 } from "starknet";
3245
- import { Fragment, jsx } from "react/jsx-runtime";
3246
- var RiskType = /* @__PURE__ */ ((RiskType2) => {
3247
- RiskType2["MARKET_RISK"] = "Market Risk";
3248
- RiskType2["IMPERMANENT_LOSS"] = "Impermanent Loss Risk";
3249
- RiskType2["LIQUIDATION_RISK"] = "Liquidation Risk";
3250
- RiskType2["LOW_LIQUIDITY_RISK"] = "Low Liquidity Risk";
3251
- RiskType2["SMART_CONTRACT_RISK"] = "Smart Contract Risk";
3252
- RiskType2["ORACLE_RISK"] = "Oracle Risk";
3253
- RiskType2["TECHNICAL_RISK"] = "Technical Risk";
3254
- RiskType2["COUNTERPARTY_RISK"] = "Counterparty Risk";
3255
- RiskType2["DEPEG_RISK"] = "Depeg Risk";
3256
- return RiskType2;
3257
- })(RiskType || {});
3258
- var Network = /* @__PURE__ */ ((Network2) => {
3259
- Network2["mainnet"] = "mainnet";
3260
- Network2["sepolia"] = "sepolia";
3261
- Network2["devnet"] = "devnet";
3262
- return Network2;
3263
- })(Network || {});
3264
- var StrategyTag = /* @__PURE__ */ ((StrategyTag3) => {
3265
- StrategyTag3["META_VAULT"] = "Meta Vaults";
3266
- StrategyTag3["LEVERED"] = "Maxx";
3267
- StrategyTag3["AUTOMATED_LP"] = "Ekubo";
3268
- StrategyTag3["BTC"] = "BTC";
3269
- return StrategyTag3;
3270
- })(StrategyTag || {});
3271
- var VaultType = /* @__PURE__ */ ((VaultType2) => {
3272
- VaultType2["LOOPING"] = "Looping";
3273
- VaultType2["META_VAULT"] = "Meta Vault";
3274
- VaultType2["DELTA_NEUTRAL"] = "Delta Neutral";
3275
- VaultType2["AUTOMATED_LP"] = "Automated LP";
3276
- VaultType2["TVA"] = "Troves Value Averaging";
3277
- return VaultType2;
3278
- })(VaultType || {});
3279
- var AuditStatus = /* @__PURE__ */ ((AuditStatus2) => {
3280
- AuditStatus2["AUDITED"] = "Audited";
3281
- AuditStatus2["NOT_AUDITED"] = "Not Audited";
3282
- return AuditStatus2;
3283
- })(AuditStatus || {});
3284
- var SourceCodeType = /* @__PURE__ */ ((SourceCodeType2) => {
3285
- SourceCodeType2["OPEN_SOURCE"] = "Open Source";
3286
- SourceCodeType2["CLOSED_SOURCE"] = "Closed Source";
3287
- return SourceCodeType2;
3288
- })(SourceCodeType || {});
3289
- var AccessControlType = /* @__PURE__ */ ((AccessControlType2) => {
3290
- AccessControlType2["MULTISIG_ACCOUNT"] = "Multisig Account";
3291
- AccessControlType2["STANDARD_ACCOUNT"] = "Standard Account";
3292
- AccessControlType2["ROLE_BASED_ACCESS"] = "Role Based Access";
3293
- return AccessControlType2;
3294
- })(AccessControlType || {});
3295
- var InstantWithdrawalVault = /* @__PURE__ */ ((InstantWithdrawalVault2) => {
3296
- InstantWithdrawalVault2["YES"] = "Yes";
3297
- InstantWithdrawalVault2["NO"] = "No";
3298
- return InstantWithdrawalVault2;
3299
- })(InstantWithdrawalVault || {});
3300
- var FlowChartColors = /* @__PURE__ */ ((FlowChartColors2) => {
3301
- FlowChartColors2["Green"] = "purple";
3302
- FlowChartColors2["Blue"] = "#35484f";
3303
- FlowChartColors2["Purple"] = "#6e53dc";
3304
- return FlowChartColors2;
3305
- })(FlowChartColors || {});
3306
- var StrategyLiveStatus = /* @__PURE__ */ ((StrategyLiveStatus2) => {
3307
- StrategyLiveStatus2["ACTIVE"] = "Active";
3308
- StrategyLiveStatus2["NEW"] = "New";
3309
- StrategyLiveStatus2["COMING_SOON"] = "Coming Soon";
3310
- StrategyLiveStatus2["DEPRECATED"] = "Deprecated";
3311
- StrategyLiveStatus2["RETIRED"] = "Retired";
3312
- StrategyLiveStatus2["HOT"] = "Hot & New \u{1F525}";
3313
- return StrategyLiveStatus2;
3314
- })(StrategyLiveStatus || {});
3315
- function getMainnetConfig(rpcUrl = "https://starknet-mainnet.public.blastapi.io", blockIdentifier = BlockTag.LATEST) {
3316
- return {
3317
- provider: new RpcProvider3({
3318
- nodeUrl: rpcUrl,
3319
- blockIdentifier
3320
- // specVersion
3321
- }),
3322
- stage: "production",
3323
- network: "mainnet" /* mainnet */
3324
- };
3325
- }
3326
- var getStrategyTagDesciption = (tag) => {
3327
- switch (tag) {
3328
- case "Meta Vaults" /* META_VAULT */:
3329
- return "A meta vault is a vault that auto allocates funds to multiple vaults based on optimal yield opportunities";
3330
- case "Maxx" /* LEVERED */:
3331
- return "Looping vaults on Endur LSTs with leveraged borrowing of STRK or BTC to increase yield (2-4x higher yield than simply staking)";
3332
- case "Ekubo" /* AUTOMATED_LP */:
3333
- return "Automated LP vaults on Ekubo that rebalance position automatically, ensuring you earn fees efficiently";
3334
- case "BTC" /* BTC */:
3335
- return "BTC linked vaults";
3336
- }
3337
- };
3338
- var getAllStrategyTags = () => {
3339
- return Object.values(StrategyTag);
3340
- };
3341
- var getRiskExplaination = (riskType) => {
3342
- switch (riskType) {
3343
- case "Market Risk" /* MARKET_RISK */:
3344
- return "The risk of the market moving against the position.";
3345
- case "Impermanent Loss Risk" /* IMPERMANENT_LOSS */:
3346
- return "The temporary loss of value experienced by liquidity providers in AMMs when asset prices diverge compared to simply holding them.";
3347
- case "Liquidation Risk" /* LIQUIDATION_RISK */:
3348
- return "The risk of losing funds due to the position being liquidated.";
3349
- case "Low Liquidity Risk" /* LOW_LIQUIDITY_RISK */:
3350
- return "The risk of low liquidity in the pool, which can lead to high slippages or reduced in-abilities to quickly exit the position.";
3351
- case "Oracle Risk" /* ORACLE_RISK */:
3352
- return "The risk of the oracle being manipulated or incorrect.";
3353
- case "Smart Contract Risk" /* SMART_CONTRACT_RISK */:
3354
- return "The risk of the smart contract being vulnerable to attacks.";
3355
- case "Technical Risk" /* TECHNICAL_RISK */:
3356
- return "The risk of technical issues e.g. backend failure.";
3357
- case "Counterparty Risk" /* COUNTERPARTY_RISK */:
3358
- return "The risk of the counterparty defaulting e.g. bad debt on lending platforms.";
3359
- case "Depeg Risk" /* DEPEG_RISK */:
3360
- return "The risk of a token losing its peg to the underlying asset, leading to potential losses for holders.";
3361
- }
3362
- };
3363
- var getRiskColor = (risk) => {
3364
- const value = risk.value;
3365
- if (value <= 2) return "light_green_2";
3366
- if (value < 3) return "yellow";
3367
- return "red";
3368
- };
3369
- var getNoRiskTags = (risks) => {
3370
- const noRisks1 = risks.filter((risk) => risk.value === 0).map((risk) => risk.type);
3371
- const noRisks2 = Object.values(RiskType).filter(
3372
- (risk) => !risks.map((risk2) => risk2.type).includes(risk)
3373
- );
3374
- const mergedUnique = [.../* @__PURE__ */ new Set([...noRisks1, ...noRisks2])];
3375
- return mergedUnique;
3376
- };
3377
- function highlightTextWithLinks(put, highlights) {
3378
- const escapeRegExp = (text) => text.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
3379
- const pattern = new RegExp(
3380
- `(${highlights.map((m) => escapeRegExp(m.highlight)).join("|")})`,
3381
- "gi"
3382
- );
3383
- const parts = put.split(pattern);
3384
- return /* @__PURE__ */ jsx(Fragment, { children: parts.map((part, i) => {
3385
- const match = highlights.find((m) => m.highlight.toLowerCase() === part.toLowerCase());
3386
- return match ? /* @__PURE__ */ jsx("a", { href: match.link, target: "_blank", style: { color: "white", background: "rgba(255, 255, 255, 0.04)" }, children: part }, i) : /* @__PURE__ */ jsx("span", { children: part }, i);
3387
- }) });
3388
- }
3389
- var VesuProtocol = {
3390
- name: "Vesu",
3391
- logo: "https://static-assets-8zct.onrender.com/integrations/vesu/logo.png"
3392
- };
3393
- var EndurProtocol = {
3394
- name: "Endur",
3395
- logo: "http://endur.fi/logo.png"
3396
- };
3397
- var ExtendedProtocol = {
3398
- name: "Extended",
3399
- logo: "https://static-assets-8zct.onrender.com/integrations/extended/extended.svg"
3400
- };
3401
- var Protocols = {
3402
- VESU: VesuProtocol,
3403
- ENDUR: EndurProtocol,
3404
- EXTENDED: ExtendedProtocol
3405
- };
3406
- var UnwrapLabsCurator = {
3407
- name: "Unwrap Labs",
3408
- logo: "https://assets.troves.fi/integrations/unwraplabs/white.png"
3409
- };
3410
-
3411
- // src/interfaces/initializable.ts
3412
- var Initializable = class {
3413
- constructor() {
3414
- this.initialized = false;
3415
- }
3416
- async waitForInitilisation() {
3417
- return new Promise((resolve, reject) => {
3418
- const interval = setInterval(() => {
3419
- if (this.initialized) {
3420
- console.log("Initialised");
3421
- clearInterval(interval);
3422
- resolve();
3423
- }
3424
- }, 1e3);
3425
- });
3426
- }
3427
- };
3428
-
3429
3471
  // src/strategies/autoCompounderStrk.ts
3430
3472
  import { Contract as Contract4, uint256 as uint2565 } from "starknet";
3431
3473
  var AutoCompounderSTRK = class {
@@ -18193,6 +18235,9 @@ var xSTRKSTRK = {
18193
18235
  },
18194
18236
  apyMethodology: "APY based on 30-day historical performance, including fees and rewards.",
18195
18237
  realizedApyMethodology: "The realizedAPY is based on past 14 days performance by the vault",
18238
+ feeBps: {
18239
+ performanceFeeBps: 1e3
18240
+ },
18196
18241
  additionalInfo: {
18197
18242
  newBounds: {
18198
18243
  lower: -1,
@@ -29498,7 +29543,8 @@ var vesuPrimeUSDC = {
29498
29543
  name: "Vesu Prime USDC",
29499
29544
  decimals: 18,
29500
29545
  logo: usdc.logo,
29501
- displayDecimals: 2
29546
+ displayDecimals: 2,
29547
+ indexingType: "ignore" /* IGNORE */
29502
29548
  };
29503
29549
  var strk = Global.getDefaultTokens().find((t) => t.symbol === "STRK");
29504
29550
  function getYoloVaultErc4626Config(mainToken, secondaryToken) {
@@ -29644,6 +29690,9 @@ var YoloVaultStrategies = yoloVaultsConfig.map((yoloConfig) => {
29644
29690
  notARisks: getNoRiskTags(yoloRiskFactors)
29645
29691
  },
29646
29692
  apyMethodology: "Not a primary yield strategy. Funds earn yield when idle, but the main return comes from BTC price appreciation and your conviction to hold. This vault simply helps you accumulate more BTC.",
29693
+ feeBps: {
29694
+ performanceFeeBps: 1e3
29695
+ },
29647
29696
  additionalInfo: {
29648
29697
  mainToken: yoloConfig.mainToken,
29649
29698
  secondaryToken: yoloConfig.secondaryToken,
@@ -33273,6 +33322,9 @@ var createUniversalStrategy = (params) => {
33273
33322
  auditUrl: AUDIT_URL3,
33274
33323
  protocols: [Protocols.VESU],
33275
33324
  realizedApyMethodology: "The realizedAPY is based on past 14 days performance by the vault",
33325
+ feeBps: {
33326
+ performanceFeeBps: 1e3
33327
+ },
33276
33328
  curator: UnwrapLabsCurator,
33277
33329
  settings: createUniversalSettings(params.tokenSymbol),
33278
33330
  contractDetails: getContractDetails(params.vaultSettings),
@@ -34991,6 +35043,9 @@ function getStrategySettings(lstSymbol, underlyingSymbol, settings, isPreview =
34991
35043
  isPreview,
34992
35044
  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.",
34993
35045
  realizedApyMethodology: "The realizedAPY is based on past 14 days performance by the vault",
35046
+ feeBps: {
35047
+ performanceFeeBps: 1e3
35048
+ },
34994
35049
  tags: lstSymbol.includes("BTC") ? ["BTC" /* BTC */, "Maxx" /* LEVERED */] : ["Maxx" /* LEVERED */],
34995
35050
  security: HYPER_LST_SECURITY,
34996
35051
  redemptionInfo: HYPER_LST_REDEMPTION_INFO,
@@ -35297,6 +35352,7 @@ export {
35297
35352
  StrategyLiveStatus,
35298
35353
  StrategyTag,
35299
35354
  StrategyType,
35355
+ TokenIndexingType,
35300
35356
  UNIVERSAL_ADAPTERS,
35301
35357
  UNIVERSAL_MANAGE_IDS,
35302
35358
  UniversalLstMultiplierStrategy,