@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.
package/dist/index.mjs CHANGED
@@ -4,6 +4,269 @@ import axios3 from "axios";
4
4
  // src/global.ts
5
5
  import axios from "axios";
6
6
 
7
+ // src/utils/logger.node.ts
8
+ import winston, { format } from "winston";
9
+ var colors = {
10
+ error: "red",
11
+ warn: "yellow",
12
+ info: "blue",
13
+ verbose: "white",
14
+ debug: "white"
15
+ };
16
+ winston.addColors(colors);
17
+ var logLevel = (process.env.LOG_LEVEL || process.env.SDK_LOG_LEVEL || "debug").toLowerCase();
18
+ var logger = winston.createLogger({
19
+ level: logLevel,
20
+ // Set the minimum logging level from environment variable
21
+ format: format.combine(
22
+ format.colorize({ all: true }),
23
+ // Apply custom colors
24
+ format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
25
+ // Add timestamp to log messages
26
+ format.printf(({ timestamp, level, message, ...meta }) => {
27
+ let msg = `${timestamp} ${level}: ${message}`;
28
+ if (meta && meta[/* @__PURE__ */ Symbol.for("splat")]) {
29
+ const splat = meta[/* @__PURE__ */ Symbol.for("splat")];
30
+ if (Array.isArray(splat)) {
31
+ for (const arg of splat) {
32
+ if (arg instanceof Error) {
33
+ msg += `
34
+ ${arg.stack}`;
35
+ }
36
+ }
37
+ }
38
+ }
39
+ return msg;
40
+ })
41
+ ),
42
+ transports: [
43
+ new winston.transports.Console()
44
+ // Output logs to the console
45
+ ]
46
+ });
47
+
48
+ // src/interfaces/lending.ts
49
+ var MarginType = /* @__PURE__ */ ((MarginType2) => {
50
+ MarginType2["SHARED"] = "shared";
51
+ MarginType2["NONE"] = "none";
52
+ return MarginType2;
53
+ })(MarginType || {});
54
+ var ILending = class {
55
+ constructor(config, metadata) {
56
+ this.tokens = [];
57
+ this.initialised = false;
58
+ this.metadata = metadata;
59
+ this.config = config;
60
+ this.init();
61
+ }
62
+ /** Wait for initialisation */
63
+ waitForInitilisation() {
64
+ return new Promise((resolve, reject) => {
65
+ const interval = setInterval(() => {
66
+ logger.verbose(`Waiting for ${this.metadata.name} to initialise`);
67
+ if (this.initialised) {
68
+ logger.verbose(`${this.metadata.name} initialised`);
69
+ clearInterval(interval);
70
+ resolve();
71
+ }
72
+ }, 1e3);
73
+ });
74
+ }
75
+ };
76
+
77
+ // src/interfaces/common.tsx
78
+ import { BlockTag, RpcProvider } from "starknet";
79
+ import { Fragment, jsx } from "react/jsx-runtime";
80
+ var RiskType = /* @__PURE__ */ ((RiskType2) => {
81
+ RiskType2["MARKET_RISK"] = "Market Risk";
82
+ RiskType2["IMPERMANENT_LOSS"] = "Impermanent Loss Risk";
83
+ RiskType2["LIQUIDATION_RISK"] = "Liquidation Risk";
84
+ RiskType2["LOW_LIQUIDITY_RISK"] = "Low Liquidity Risk";
85
+ RiskType2["SMART_CONTRACT_RISK"] = "Smart Contract Risk";
86
+ RiskType2["ORACLE_RISK"] = "Oracle Risk";
87
+ RiskType2["TECHNICAL_RISK"] = "Technical Risk";
88
+ RiskType2["COUNTERPARTY_RISK"] = "Counterparty Risk";
89
+ RiskType2["DEPEG_RISK"] = "Depeg Risk";
90
+ return RiskType2;
91
+ })(RiskType || {});
92
+ var TokenIndexingType = /* @__PURE__ */ ((TokenIndexingType2) => {
93
+ TokenIndexingType2["PEGGED"] = "pegged";
94
+ TokenIndexingType2["INDEXER"] = "indexer";
95
+ TokenIndexingType2["LST_SCRIPT"] = "lstScript";
96
+ TokenIndexingType2["IGNORE"] = "ignore";
97
+ return TokenIndexingType2;
98
+ })(TokenIndexingType || {});
99
+ var Network = /* @__PURE__ */ ((Network2) => {
100
+ Network2["mainnet"] = "mainnet";
101
+ Network2["sepolia"] = "sepolia";
102
+ Network2["devnet"] = "devnet";
103
+ return Network2;
104
+ })(Network || {});
105
+ var StrategyTag = /* @__PURE__ */ ((StrategyTag3) => {
106
+ StrategyTag3["META_VAULT"] = "Meta Vaults";
107
+ StrategyTag3["LEVERED"] = "Maxx";
108
+ StrategyTag3["AUTOMATED_LP"] = "Ekubo";
109
+ StrategyTag3["BTC"] = "BTC";
110
+ return StrategyTag3;
111
+ })(StrategyTag || {});
112
+ var VaultType = /* @__PURE__ */ ((VaultType2) => {
113
+ VaultType2["LOOPING"] = "Looping";
114
+ VaultType2["META_VAULT"] = "Meta Vault";
115
+ VaultType2["DELTA_NEUTRAL"] = "Delta Neutral";
116
+ VaultType2["AUTOMATED_LP"] = "Automated LP";
117
+ VaultType2["TVA"] = "Troves Value Averaging";
118
+ return VaultType2;
119
+ })(VaultType || {});
120
+ var AuditStatus = /* @__PURE__ */ ((AuditStatus2) => {
121
+ AuditStatus2["AUDITED"] = "Audited";
122
+ AuditStatus2["NOT_AUDITED"] = "Not Audited";
123
+ return AuditStatus2;
124
+ })(AuditStatus || {});
125
+ var SourceCodeType = /* @__PURE__ */ ((SourceCodeType2) => {
126
+ SourceCodeType2["OPEN_SOURCE"] = "Open Source";
127
+ SourceCodeType2["CLOSED_SOURCE"] = "Closed Source";
128
+ return SourceCodeType2;
129
+ })(SourceCodeType || {});
130
+ var AccessControlType = /* @__PURE__ */ ((AccessControlType2) => {
131
+ AccessControlType2["MULTISIG_ACCOUNT"] = "Multisig Account";
132
+ AccessControlType2["STANDARD_ACCOUNT"] = "Standard Account";
133
+ AccessControlType2["ROLE_BASED_ACCESS"] = "Role Based Access";
134
+ return AccessControlType2;
135
+ })(AccessControlType || {});
136
+ var InstantWithdrawalVault = /* @__PURE__ */ ((InstantWithdrawalVault2) => {
137
+ InstantWithdrawalVault2["YES"] = "Yes";
138
+ InstantWithdrawalVault2["NO"] = "No";
139
+ return InstantWithdrawalVault2;
140
+ })(InstantWithdrawalVault || {});
141
+ var FlowChartColors = /* @__PURE__ */ ((FlowChartColors2) => {
142
+ FlowChartColors2["Green"] = "purple";
143
+ FlowChartColors2["Blue"] = "#35484f";
144
+ FlowChartColors2["Purple"] = "#6e53dc";
145
+ return FlowChartColors2;
146
+ })(FlowChartColors || {});
147
+ var StrategyLiveStatus = /* @__PURE__ */ ((StrategyLiveStatus2) => {
148
+ StrategyLiveStatus2["ACTIVE"] = "Active";
149
+ StrategyLiveStatus2["NEW"] = "New";
150
+ StrategyLiveStatus2["COMING_SOON"] = "Coming Soon";
151
+ StrategyLiveStatus2["DEPRECATED"] = "Deprecated";
152
+ StrategyLiveStatus2["RETIRED"] = "Retired";
153
+ StrategyLiveStatus2["HOT"] = "Hot & New \u{1F525}";
154
+ return StrategyLiveStatus2;
155
+ })(StrategyLiveStatus || {});
156
+ function getMainnetConfig(rpcUrl = "https://starknet-mainnet.public.blastapi.io", blockIdentifier = BlockTag.LATEST) {
157
+ return {
158
+ provider: new RpcProvider({
159
+ nodeUrl: rpcUrl,
160
+ blockIdentifier
161
+ // specVersion
162
+ }),
163
+ stage: "production",
164
+ network: "mainnet" /* mainnet */
165
+ };
166
+ }
167
+ var getStrategyTagDesciption = (tag) => {
168
+ switch (tag) {
169
+ case "Meta Vaults" /* META_VAULT */:
170
+ return "A meta vault is a vault that auto allocates funds to multiple vaults based on optimal yield opportunities";
171
+ case "Maxx" /* LEVERED */:
172
+ return "Looping vaults on Endur LSTs with leveraged borrowing of STRK or BTC to increase yield (2-4x higher yield than simply staking)";
173
+ case "Ekubo" /* AUTOMATED_LP */:
174
+ return "Automated LP vaults on Ekubo that rebalance position automatically, ensuring you earn fees efficiently";
175
+ case "BTC" /* BTC */:
176
+ return "BTC linked vaults";
177
+ }
178
+ };
179
+ var getAllStrategyTags = () => {
180
+ return Object.values(StrategyTag);
181
+ };
182
+ var getRiskExplaination = (riskType) => {
183
+ switch (riskType) {
184
+ case "Market Risk" /* MARKET_RISK */:
185
+ return "The risk of the market moving against the position.";
186
+ case "Impermanent Loss Risk" /* IMPERMANENT_LOSS */:
187
+ return "The temporary loss of value experienced by liquidity providers in AMMs when asset prices diverge compared to simply holding them.";
188
+ case "Liquidation Risk" /* LIQUIDATION_RISK */:
189
+ return "The risk of losing funds due to the position being liquidated.";
190
+ case "Low Liquidity Risk" /* LOW_LIQUIDITY_RISK */:
191
+ return "The risk of low liquidity in the pool, which can lead to high slippages or reduced in-abilities to quickly exit the position.";
192
+ case "Oracle Risk" /* ORACLE_RISK */:
193
+ return "The risk of the oracle being manipulated or incorrect.";
194
+ case "Smart Contract Risk" /* SMART_CONTRACT_RISK */:
195
+ return "The risk of the smart contract being vulnerable to attacks.";
196
+ case "Technical Risk" /* TECHNICAL_RISK */:
197
+ return "The risk of technical issues e.g. backend failure.";
198
+ case "Counterparty Risk" /* COUNTERPARTY_RISK */:
199
+ return "The risk of the counterparty defaulting e.g. bad debt on lending platforms.";
200
+ case "Depeg Risk" /* DEPEG_RISK */:
201
+ return "The risk of a token losing its peg to the underlying asset, leading to potential losses for holders.";
202
+ }
203
+ };
204
+ var getRiskColor = (risk) => {
205
+ const value = risk.value;
206
+ if (value <= 2) return "light_green_2";
207
+ if (value < 3) return "yellow";
208
+ return "red";
209
+ };
210
+ var getNoRiskTags = (risks) => {
211
+ const noRisks1 = risks.filter((risk) => risk.value === 0).map((risk) => risk.type);
212
+ const noRisks2 = Object.values(RiskType).filter(
213
+ (risk) => !risks.map((risk2) => risk2.type).includes(risk)
214
+ );
215
+ const mergedUnique = [.../* @__PURE__ */ new Set([...noRisks1, ...noRisks2])];
216
+ return mergedUnique;
217
+ };
218
+ function highlightTextWithLinks(put, highlights) {
219
+ const escapeRegExp = (text) => text.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
220
+ const pattern = new RegExp(
221
+ `(${highlights.map((m) => escapeRegExp(m.highlight)).join("|")})`,
222
+ "gi"
223
+ );
224
+ const parts = put.split(pattern);
225
+ return /* @__PURE__ */ jsx(Fragment, { children: parts.map((part, i) => {
226
+ const match = highlights.find((m) => m.highlight.toLowerCase() === part.toLowerCase());
227
+ 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);
228
+ }) });
229
+ }
230
+ var VesuProtocol = {
231
+ name: "Vesu",
232
+ logo: "https://static-assets-8zct.onrender.com/integrations/vesu/logo.png"
233
+ };
234
+ var EndurProtocol = {
235
+ name: "Endur",
236
+ logo: "http://endur.fi/logo.png"
237
+ };
238
+ var ExtendedProtocol = {
239
+ name: "Extended",
240
+ logo: "https://static-assets-8zct.onrender.com/integrations/extended/extended.svg"
241
+ };
242
+ var Protocols = {
243
+ VESU: VesuProtocol,
244
+ ENDUR: EndurProtocol,
245
+ EXTENDED: ExtendedProtocol
246
+ };
247
+ var UnwrapLabsCurator = {
248
+ name: "Unwrap Labs",
249
+ logo: "https://assets.troves.fi/integrations/unwraplabs/white.png"
250
+ };
251
+
252
+ // src/interfaces/initializable.ts
253
+ var Initializable = class {
254
+ constructor() {
255
+ this.initialized = false;
256
+ }
257
+ async waitForInitilisation() {
258
+ return new Promise((resolve, reject) => {
259
+ const interval = setInterval(() => {
260
+ if (this.initialized) {
261
+ console.log("Initialised");
262
+ clearInterval(interval);
263
+ resolve();
264
+ }
265
+ }, 1e3);
266
+ });
267
+ }
268
+ };
269
+
7
270
  // src/dataTypes/bignumber.node.ts
8
271
  import util from "util";
9
272
 
@@ -266,47 +529,6 @@ var MyNumber = class _MyNumber {
266
529
  }
267
530
  };
268
531
 
269
- // src/utils/logger.node.ts
270
- import winston, { format } from "winston";
271
- var colors = {
272
- error: "red",
273
- warn: "yellow",
274
- info: "blue",
275
- verbose: "white",
276
- debug: "white"
277
- };
278
- winston.addColors(colors);
279
- var logLevel = (process.env.LOG_LEVEL || process.env.SDK_LOG_LEVEL || "debug").toLowerCase();
280
- var logger = winston.createLogger({
281
- level: logLevel,
282
- // Set the minimum logging level from environment variable
283
- format: format.combine(
284
- format.colorize({ all: true }),
285
- // Apply custom colors
286
- format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
287
- // Add timestamp to log messages
288
- format.printf(({ timestamp, level, message, ...meta }) => {
289
- let msg = `${timestamp} ${level}: ${message}`;
290
- if (meta && meta[/* @__PURE__ */ Symbol.for("splat")]) {
291
- const splat = meta[/* @__PURE__ */ Symbol.for("splat")];
292
- if (Array.isArray(splat)) {
293
- for (const arg of splat) {
294
- if (arg instanceof Error) {
295
- msg += `
296
- ${arg.stack}`;
297
- }
298
- }
299
- }
300
- }
301
- return msg;
302
- })
303
- ),
304
- transports: [
305
- new winston.transports.Console()
306
- // Output logs to the console
307
- ]
308
- });
309
-
310
532
  // src/global.ts
311
533
  var FatalError = class extends Error {
312
534
  constructor(message, err) {
@@ -325,7 +547,9 @@ var defaultTokens = [{
325
547
  decimals: 18,
326
548
  coingeckId: "starknet",
327
549
  displayDecimals: 2,
328
- priceCheckAmount: 1e3
550
+ priceCheckAmount: 5e3,
551
+ priceMethod: "Avnu",
552
+ indexingType: "indexer" /* INDEXER */
329
553
  }, {
330
554
  name: "xSTRK",
331
555
  symbol: "xSTRK",
@@ -333,8 +557,10 @@ var defaultTokens = [{
333
557
  address: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a"),
334
558
  decimals: 18,
335
559
  coingeckId: void 0,
336
- priceCheckAmount: 1e3,
337
- displayDecimals: 2
560
+ priceCheckAmount: 5e3,
561
+ displayDecimals: 2,
562
+ priceMethod: "Avnu",
563
+ indexingType: "lstScript" /* LST_SCRIPT */
338
564
  }, {
339
565
  name: "ETH",
340
566
  symbol: "ETH",
@@ -343,7 +569,8 @@ var defaultTokens = [{
343
569
  decimals: 18,
344
570
  coingeckId: void 0,
345
571
  priceCheckAmount: 0.1,
346
- displayDecimals: 6
572
+ displayDecimals: 6,
573
+ indexingType: "indexer" /* INDEXER */
347
574
  }, {
348
575
  name: "USDC.e",
349
576
  symbol: "USDC.e",
@@ -352,7 +579,9 @@ var defaultTokens = [{
352
579
  decimals: 6,
353
580
  coingeckId: void 0,
354
581
  displayDecimals: 2,
355
- priceCheckAmount: 1e3
582
+ priceCheckAmount: 1e3,
583
+ priceProxySymbol: "USDC",
584
+ indexingType: "pegged" /* PEGGED */
356
585
  }, {
357
586
  name: "USDC",
358
587
  symbol: "USDC",
@@ -361,7 +590,8 @@ var defaultTokens = [{
361
590
  decimals: 6,
362
591
  coingeckId: void 0,
363
592
  displayDecimals: 2,
364
- priceCheckAmount: 1e3
593
+ priceCheckAmount: 1e3,
594
+ indexingType: "indexer" /* INDEXER */
365
595
  }, {
366
596
  name: "USDT",
367
597
  symbol: "USDT",
@@ -370,7 +600,8 @@ var defaultTokens = [{
370
600
  decimals: 6,
371
601
  coingeckId: void 0,
372
602
  priceCheckAmount: 1e3,
373
- displayDecimals: 2
603
+ displayDecimals: 2,
604
+ indexingType: "indexer" /* INDEXER */
374
605
  }, {
375
606
  name: "WBTC",
376
607
  symbol: "WBTC",
@@ -379,8 +610,9 @@ var defaultTokens = [{
379
610
  decimals: 8,
380
611
  coingeckId: void 0,
381
612
  displayDecimals: 6,
382
- priceCheckAmount: 1e-3
613
+ priceCheckAmount: 1e-3,
383
614
  // 112000 * 0.0001 = $110.2
615
+ indexingType: "indexer" /* INDEXER */
384
616
  }, {
385
617
  name: "tBTC",
386
618
  symbol: "tBTC",
@@ -389,8 +621,10 @@ var defaultTokens = [{
389
621
  decimals: 18,
390
622
  coingeckId: void 0,
391
623
  displayDecimals: 6,
392
- priceCheckAmount: 1e-3
624
+ priceCheckAmount: 1e-3,
393
625
  // 112000 * 0.0001 = $110.2
626
+ priceProxySymbol: "WBTC",
627
+ indexingType: "pegged" /* PEGGED */
394
628
  }, {
395
629
  name: "solvBTC",
396
630
  symbol: "solvBTC",
@@ -400,8 +634,9 @@ var defaultTokens = [{
400
634
  coingeckId: void 0,
401
635
  priceProxySymbol: "WBTC",
402
636
  displayDecimals: 6,
403
- priceCheckAmount: 1e-4
637
+ priceCheckAmount: 1e-4,
404
638
  // 112000 * 0.0001 = $11.2
639
+ indexingType: "pegged" /* PEGGED */
405
640
  }, {
406
641
  name: "LBTC",
407
642
  symbol: "LBTC",
@@ -411,8 +646,9 @@ var defaultTokens = [{
411
646
  coingeckId: void 0,
412
647
  displayDecimals: 6,
413
648
  priceProxySymbol: "WBTC",
414
- priceCheckAmount: 1e-4
649
+ priceCheckAmount: 1e-4,
415
650
  // 112000 * 0.0001 = $11.2
651
+ indexingType: "pegged" /* PEGGED */
416
652
  }, {
417
653
  name: "xWBTC",
418
654
  symbol: "xWBTC",
@@ -421,9 +657,10 @@ var defaultTokens = [{
421
657
  decimals: 8,
422
658
  coingeckId: void 0,
423
659
  displayDecimals: 6,
424
- priceProxySymbol: "WBTC",
425
- priceCheckAmount: 1e-3
660
+ priceCheckAmount: 1e-3,
426
661
  // 112000 * 0.0001 = $110.2
662
+ priceMethod: "Avnu",
663
+ indexingType: "lstScript" /* LST_SCRIPT */
427
664
  }, {
428
665
  name: "xsBTC",
429
666
  symbol: "xsBTC",
@@ -432,11 +669,11 @@ var defaultTokens = [{
432
669
  decimals: 18,
433
670
  coingeckId: void 0,
434
671
  displayDecimals: 6,
435
- priceProxySymbol: "WBTC",
436
- priceCheckAmount: 1e-4
672
+ priceCheckAmount: 1e-4,
437
673
  // 112000 * 0.0001 = $11.2
674
+ priceMethod: "Avnu",
675
+ indexingType: "lstScript" /* LST_SCRIPT */
438
676
  }, {
439
- // todo upgrade proxy tokens once feeds are available
440
677
  name: "xtBTC",
441
678
  symbol: "xtBTC",
442
679
  logo: "https://assets.strkfarm.com/integrations/tokens/xtbtc.svg",
@@ -446,7 +683,8 @@ var defaultTokens = [{
446
683
  displayDecimals: 6,
447
684
  priceCheckAmount: 1e-3,
448
685
  // 112000 * 0.0001 = $110.2
449
- priceProxySymbol: "WBTC"
686
+ priceMethod: "Avnu",
687
+ indexingType: "lstScript" /* LST_SCRIPT */
450
688
  }, {
451
689
  name: "xLBTC",
452
690
  symbol: "xLBTC",
@@ -455,9 +693,10 @@ var defaultTokens = [{
455
693
  decimals: 8,
456
694
  coingeckId: void 0,
457
695
  displayDecimals: 6,
458
- priceProxySymbol: "WBTC",
459
- priceCheckAmount: 1e-4
696
+ priceCheckAmount: 1e-4,
460
697
  // 112000 * 0.0001 = $11.2
698
+ priceMethod: "Avnu",
699
+ indexingType: "lstScript" /* LST_SCRIPT */
461
700
  }, {
462
701
  name: "mRe7BTC",
463
702
  symbol: "mRe7BTC",
@@ -468,7 +707,8 @@ var defaultTokens = [{
468
707
  displayDecimals: 6,
469
708
  priceCheckAmount: 1e-4,
470
709
  // 112000 * 0.0001 = $11.2
471
- dontPrice: true
710
+ dontPrice: true,
711
+ indexingType: "ignore" /* IGNORE */
472
712
  }, {
473
713
  name: "mRe7YIELD",
474
714
  symbol: "mRe7YIELD",
@@ -478,7 +718,8 @@ var defaultTokens = [{
478
718
  coingeckId: void 0,
479
719
  displayDecimals: 2,
480
720
  priceCheckAmount: 100,
481
- dontPrice: true
721
+ dontPrice: true,
722
+ indexingType: "ignore" /* IGNORE */
482
723
  }, {
483
724
  name: "fyeWBTC",
484
725
  symbol: "fyeWBTC",
@@ -489,7 +730,8 @@ var defaultTokens = [{
489
730
  displayDecimals: 6,
490
731
  priceCheckAmount: 1e-3,
491
732
  // 112000 * 0.0001 = $110.2
492
- dontPrice: true
733
+ dontPrice: true,
734
+ indexingType: "ignore" /* IGNORE */
493
735
  }, {
494
736
  name: "fyETH",
495
737
  symbol: "fyETH",
@@ -499,7 +741,8 @@ var defaultTokens = [{
499
741
  coingeckId: void 0,
500
742
  displayDecimals: 4,
501
743
  priceCheckAmount: 0.1,
502
- dontPrice: true
744
+ dontPrice: true,
745
+ indexingType: "ignore" /* IGNORE */
503
746
  }, {
504
747
  name: "fyeUSDC",
505
748
  symbol: "fyeUSDC",
@@ -509,7 +752,8 @@ var defaultTokens = [{
509
752
  coingeckId: void 0,
510
753
  displayDecimals: 2,
511
754
  priceCheckAmount: 100,
512
- dontPrice: true
755
+ dontPrice: true,
756
+ indexingType: "ignore" /* IGNORE */
513
757
  }, {
514
758
  name: "strkBTC",
515
759
  symbol: "strkBTC",
@@ -520,7 +764,9 @@ var defaultTokens = [{
520
764
  displayDecimals: 6,
521
765
  priceCheckAmount: 1e-3,
522
766
  // 112000 * 0.0001 = $110.2
523
- priceProxySymbol: "WBTC"
767
+ priceMethod: "Avnu",
768
+ priceProxySymbol: "WBTC",
769
+ indexingType: "pegged" /* PEGGED */
524
770
  }, {
525
771
  name: "xstrkBTC",
526
772
  symbol: "xstrkBTC",
@@ -530,7 +776,8 @@ var defaultTokens = [{
530
776
  coingeckId: void 0,
531
777
  displayDecimals: 6,
532
778
  priceCheckAmount: 1e-3,
533
- priceProxySymbol: "WBTC"
779
+ priceMethod: "Avnu",
780
+ indexingType: "lstScript" /* LST_SCRIPT */
534
781
  }];
535
782
  var tokens = defaultTokens;
536
783
  var _Global = class _Global {
@@ -563,7 +810,8 @@ var _Global = class _Global {
563
810
  decimals: token.decimals,
564
811
  logo: token.logoUri,
565
812
  coingeckId: token.extensions.coingeckoId,
566
- displayDecimals: 2
813
+ displayDecimals: 2,
814
+ indexingType: "ignore" /* IGNORE */
567
815
  });
568
816
  });
569
817
  console.log(tokens);
@@ -1014,21 +1262,14 @@ var Pricer = class extends PricerBase {
1014
1262
  }
1015
1263
  }
1016
1264
  async _getPrice(token) {
1017
- const pinned = this.methodToUse[token.symbol];
1018
- if (pinned) {
1019
- logger.verbose(`Fetching price of ${token.symbol} using pinned ${pinned}`);
1020
- try {
1021
- return await this._tryPriceMethod(token, pinned);
1022
- } catch (error) {
1023
- console.warn(`${pinned}: pinned price failed [${token.symbol}]: `, error.message);
1024
- delete this.methodToUse[token.symbol];
1025
- }
1026
- }
1027
- for (const method of PRICE_METHOD_PRIORITY) {
1265
+ const methodsToTry = this._getMethodsToTry(token);
1266
+ for (const method of methodsToTry) {
1028
1267
  logger.verbose(`Fetching price of ${token.symbol} using ${method}`);
1029
1268
  try {
1030
1269
  const result = await this._tryPriceMethod(token, method);
1031
- this.methodToUse[token.symbol] = method;
1270
+ if (!token.priceMethod) {
1271
+ this.methodToUse[token.symbol] = method;
1272
+ }
1032
1273
  return result;
1033
1274
  } catch (error) {
1034
1275
  console.warn(`${method}: price err [${token.symbol}]: `, error.message);
@@ -1036,6 +1277,22 @@ var Pricer = class extends PricerBase {
1036
1277
  }
1037
1278
  throw new FatalError(`Price not found for ${token.symbol}`);
1038
1279
  }
1280
+ _getMethodsToTry(token) {
1281
+ const methods = [];
1282
+ if (token.priceMethod) {
1283
+ methods.push(token.priceMethod);
1284
+ }
1285
+ const pinned = this.methodToUse[token.symbol];
1286
+ if (pinned && pinned !== token.priceMethod) {
1287
+ methods.push(pinned);
1288
+ }
1289
+ for (const method of PRICE_METHOD_PRIORITY) {
1290
+ if (!methods.includes(method)) {
1291
+ methods.push(method);
1292
+ }
1293
+ }
1294
+ return methods;
1295
+ }
1039
1296
  async _tryPriceMethod(token, method) {
1040
1297
  switch (method) {
1041
1298
  case "AvnuApi":
@@ -1248,35 +1505,6 @@ var Web3Number2 = class _Web3Number2 extends _Web3Number {
1248
1505
  }
1249
1506
  };
1250
1507
 
1251
- // src/interfaces/lending.ts
1252
- var MarginType = /* @__PURE__ */ ((MarginType2) => {
1253
- MarginType2["SHARED"] = "shared";
1254
- MarginType2["NONE"] = "none";
1255
- return MarginType2;
1256
- })(MarginType || {});
1257
- var ILending = class {
1258
- constructor(config, metadata) {
1259
- this.tokens = [];
1260
- this.initialised = false;
1261
- this.metadata = metadata;
1262
- this.config = config;
1263
- this.init();
1264
- }
1265
- /** Wait for initialisation */
1266
- waitForInitilisation() {
1267
- return new Promise((resolve, reject) => {
1268
- const interval = setInterval(() => {
1269
- logger.verbose(`Waiting for ${this.metadata.name} to initialise`);
1270
- if (this.initialised) {
1271
- logger.verbose(`${this.metadata.name} initialised`);
1272
- clearInterval(interval);
1273
- resolve();
1274
- }
1275
- }, 1e3);
1276
- });
1277
- }
1278
- };
1279
-
1280
1508
  // src/modules/zkLend.ts
1281
1509
  var _ZkLend = class _ZkLend extends ILending {
1282
1510
  constructor(config, pricer) {
@@ -1307,7 +1535,8 @@ var _ZkLend = class _ZkLend extends ILending {
1307
1535
  decimals: pool.token.decimals,
1308
1536
  borrowFactor: Web3Number2.fromWei(pool.borrow_factor.value, pool.borrow_factor.decimals),
1309
1537
  collareralFactor,
1310
- displayDecimals: 2
1538
+ displayDecimals: 2,
1539
+ indexingType: "ignore" /* IGNORE */
1311
1540
  };
1312
1541
  this.tokens.push(token);
1313
1542
  });
@@ -1709,7 +1938,8 @@ var EkuboPricer = class extends PricerBase {
1709
1938
  constructor(config, tokens2) {
1710
1939
  super(config, tokens2);
1711
1940
  this.EKUBO_PRICE_FETCHER_ADDRESS = "0x04946fb4ad5237d97bbb1256eba2080c4fe1de156da6a7f83e3b4823bb6d7da1";
1712
- this.USDC_ADDRESS = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8";
1941
+ // Updating to new USDC_ADDRESS
1942
+ this.USDC_ADDRESS = "0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb";
1713
1943
  this.USDC_DECIMALS = 6;
1714
1944
  this.contract = new Contract2({
1715
1945
  abi: ekubo_price_fethcer_abi_default,
@@ -3144,192 +3374,6 @@ var EkuboQuoter = class {
3144
3374
  }
3145
3375
  };
3146
3376
 
3147
- // src/interfaces/common.tsx
3148
- import { BlockTag, RpcProvider as RpcProvider3 } from "starknet";
3149
- import { Fragment, jsx } from "react/jsx-runtime";
3150
- var RiskType = /* @__PURE__ */ ((RiskType2) => {
3151
- RiskType2["MARKET_RISK"] = "Market Risk";
3152
- RiskType2["IMPERMANENT_LOSS"] = "Impermanent Loss Risk";
3153
- RiskType2["LIQUIDATION_RISK"] = "Liquidation Risk";
3154
- RiskType2["LOW_LIQUIDITY_RISK"] = "Low Liquidity Risk";
3155
- RiskType2["SMART_CONTRACT_RISK"] = "Smart Contract Risk";
3156
- RiskType2["ORACLE_RISK"] = "Oracle Risk";
3157
- RiskType2["TECHNICAL_RISK"] = "Technical Risk";
3158
- RiskType2["COUNTERPARTY_RISK"] = "Counterparty Risk";
3159
- RiskType2["DEPEG_RISK"] = "Depeg Risk";
3160
- return RiskType2;
3161
- })(RiskType || {});
3162
- var Network = /* @__PURE__ */ ((Network2) => {
3163
- Network2["mainnet"] = "mainnet";
3164
- Network2["sepolia"] = "sepolia";
3165
- Network2["devnet"] = "devnet";
3166
- return Network2;
3167
- })(Network || {});
3168
- var StrategyTag = /* @__PURE__ */ ((StrategyTag3) => {
3169
- StrategyTag3["META_VAULT"] = "Meta Vaults";
3170
- StrategyTag3["LEVERED"] = "Maxx";
3171
- StrategyTag3["AUTOMATED_LP"] = "Ekubo";
3172
- StrategyTag3["BTC"] = "BTC";
3173
- return StrategyTag3;
3174
- })(StrategyTag || {});
3175
- var VaultType = /* @__PURE__ */ ((VaultType2) => {
3176
- VaultType2["LOOPING"] = "Looping";
3177
- VaultType2["META_VAULT"] = "Meta Vault";
3178
- VaultType2["DELTA_NEUTRAL"] = "Delta Neutral";
3179
- VaultType2["AUTOMATED_LP"] = "Automated LP";
3180
- VaultType2["TVA"] = "Troves Value Averaging";
3181
- return VaultType2;
3182
- })(VaultType || {});
3183
- var AuditStatus = /* @__PURE__ */ ((AuditStatus2) => {
3184
- AuditStatus2["AUDITED"] = "Audited";
3185
- AuditStatus2["NOT_AUDITED"] = "Not Audited";
3186
- return AuditStatus2;
3187
- })(AuditStatus || {});
3188
- var SourceCodeType = /* @__PURE__ */ ((SourceCodeType2) => {
3189
- SourceCodeType2["OPEN_SOURCE"] = "Open Source";
3190
- SourceCodeType2["CLOSED_SOURCE"] = "Closed Source";
3191
- return SourceCodeType2;
3192
- })(SourceCodeType || {});
3193
- var AccessControlType = /* @__PURE__ */ ((AccessControlType2) => {
3194
- AccessControlType2["MULTISIG_ACCOUNT"] = "Multisig Account";
3195
- AccessControlType2["STANDARD_ACCOUNT"] = "Standard Account";
3196
- AccessControlType2["ROLE_BASED_ACCESS"] = "Role Based Access";
3197
- return AccessControlType2;
3198
- })(AccessControlType || {});
3199
- var InstantWithdrawalVault = /* @__PURE__ */ ((InstantWithdrawalVault2) => {
3200
- InstantWithdrawalVault2["YES"] = "Yes";
3201
- InstantWithdrawalVault2["NO"] = "No";
3202
- return InstantWithdrawalVault2;
3203
- })(InstantWithdrawalVault || {});
3204
- var FlowChartColors = /* @__PURE__ */ ((FlowChartColors2) => {
3205
- FlowChartColors2["Green"] = "purple";
3206
- FlowChartColors2["Blue"] = "#35484f";
3207
- FlowChartColors2["Purple"] = "#6e53dc";
3208
- return FlowChartColors2;
3209
- })(FlowChartColors || {});
3210
- var StrategyLiveStatus = /* @__PURE__ */ ((StrategyLiveStatus2) => {
3211
- StrategyLiveStatus2["ACTIVE"] = "Active";
3212
- StrategyLiveStatus2["NEW"] = "New";
3213
- StrategyLiveStatus2["COMING_SOON"] = "Coming Soon";
3214
- StrategyLiveStatus2["DEPRECATED"] = "Deprecated";
3215
- StrategyLiveStatus2["RETIRED"] = "Retired";
3216
- StrategyLiveStatus2["HOT"] = "Hot & New \u{1F525}";
3217
- return StrategyLiveStatus2;
3218
- })(StrategyLiveStatus || {});
3219
- function getMainnetConfig(rpcUrl = "https://starknet-mainnet.public.blastapi.io", blockIdentifier = BlockTag.LATEST) {
3220
- return {
3221
- provider: new RpcProvider3({
3222
- nodeUrl: rpcUrl,
3223
- blockIdentifier
3224
- // specVersion
3225
- }),
3226
- stage: "production",
3227
- network: "mainnet" /* mainnet */
3228
- };
3229
- }
3230
- var getStrategyTagDesciption = (tag) => {
3231
- switch (tag) {
3232
- case "Meta Vaults" /* META_VAULT */:
3233
- return "A meta vault is a vault that auto allocates funds to multiple vaults based on optimal yield opportunities";
3234
- case "Maxx" /* LEVERED */:
3235
- return "Looping vaults on Endur LSTs with leveraged borrowing of STRK or BTC to increase yield (2-4x higher yield than simply staking)";
3236
- case "Ekubo" /* AUTOMATED_LP */:
3237
- return "Automated LP vaults on Ekubo that rebalance position automatically, ensuring you earn fees efficiently";
3238
- case "BTC" /* BTC */:
3239
- return "BTC linked vaults";
3240
- }
3241
- };
3242
- var getAllStrategyTags = () => {
3243
- return Object.values(StrategyTag);
3244
- };
3245
- var getRiskExplaination = (riskType) => {
3246
- switch (riskType) {
3247
- case "Market Risk" /* MARKET_RISK */:
3248
- return "The risk of the market moving against the position.";
3249
- case "Impermanent Loss Risk" /* IMPERMANENT_LOSS */:
3250
- return "The temporary loss of value experienced by liquidity providers in AMMs when asset prices diverge compared to simply holding them.";
3251
- case "Liquidation Risk" /* LIQUIDATION_RISK */:
3252
- return "The risk of losing funds due to the position being liquidated.";
3253
- case "Low Liquidity Risk" /* LOW_LIQUIDITY_RISK */:
3254
- return "The risk of low liquidity in the pool, which can lead to high slippages or reduced in-abilities to quickly exit the position.";
3255
- case "Oracle Risk" /* ORACLE_RISK */:
3256
- return "The risk of the oracle being manipulated or incorrect.";
3257
- case "Smart Contract Risk" /* SMART_CONTRACT_RISK */:
3258
- return "The risk of the smart contract being vulnerable to attacks.";
3259
- case "Technical Risk" /* TECHNICAL_RISK */:
3260
- return "The risk of technical issues e.g. backend failure.";
3261
- case "Counterparty Risk" /* COUNTERPARTY_RISK */:
3262
- return "The risk of the counterparty defaulting e.g. bad debt on lending platforms.";
3263
- case "Depeg Risk" /* DEPEG_RISK */:
3264
- return "The risk of a token losing its peg to the underlying asset, leading to potential losses for holders.";
3265
- }
3266
- };
3267
- var getRiskColor = (risk) => {
3268
- const value = risk.value;
3269
- if (value <= 2) return "light_green_2";
3270
- if (value < 3) return "yellow";
3271
- return "red";
3272
- };
3273
- var getNoRiskTags = (risks) => {
3274
- const noRisks1 = risks.filter((risk) => risk.value === 0).map((risk) => risk.type);
3275
- const noRisks2 = Object.values(RiskType).filter(
3276
- (risk) => !risks.map((risk2) => risk2.type).includes(risk)
3277
- );
3278
- const mergedUnique = [.../* @__PURE__ */ new Set([...noRisks1, ...noRisks2])];
3279
- return mergedUnique;
3280
- };
3281
- function highlightTextWithLinks(put, highlights) {
3282
- const escapeRegExp = (text) => text.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
3283
- const pattern = new RegExp(
3284
- `(${highlights.map((m) => escapeRegExp(m.highlight)).join("|")})`,
3285
- "gi"
3286
- );
3287
- const parts = put.split(pattern);
3288
- return /* @__PURE__ */ jsx(Fragment, { children: parts.map((part, i) => {
3289
- const match = highlights.find((m) => m.highlight.toLowerCase() === part.toLowerCase());
3290
- 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);
3291
- }) });
3292
- }
3293
- var VesuProtocol = {
3294
- name: "Vesu",
3295
- logo: "https://static-assets-8zct.onrender.com/integrations/vesu/logo.png"
3296
- };
3297
- var EndurProtocol = {
3298
- name: "Endur",
3299
- logo: "http://endur.fi/logo.png"
3300
- };
3301
- var ExtendedProtocol = {
3302
- name: "Extended",
3303
- logo: "https://static-assets-8zct.onrender.com/integrations/extended/extended.svg"
3304
- };
3305
- var Protocols = {
3306
- VESU: VesuProtocol,
3307
- ENDUR: EndurProtocol,
3308
- EXTENDED: ExtendedProtocol
3309
- };
3310
- var UnwrapLabsCurator = {
3311
- name: "Unwrap Labs",
3312
- logo: "https://assets.troves.fi/integrations/unwraplabs/white.png"
3313
- };
3314
-
3315
- // src/interfaces/initializable.ts
3316
- var Initializable = class {
3317
- constructor() {
3318
- this.initialized = false;
3319
- }
3320
- async waitForInitilisation() {
3321
- return new Promise((resolve, reject) => {
3322
- const interval = setInterval(() => {
3323
- if (this.initialized) {
3324
- console.log("Initialised");
3325
- clearInterval(interval);
3326
- resolve();
3327
- }
3328
- }, 1e3);
3329
- });
3330
- }
3331
- };
3332
-
3333
3377
  // src/strategies/autoCompounderStrk.ts
3334
3378
  import { Contract as Contract4, uint256 as uint2566 } from "starknet";
3335
3379
  var AutoCompounderSTRK = class {
@@ -18097,6 +18141,9 @@ var xSTRKSTRK = {
18097
18141
  },
18098
18142
  apyMethodology: "APY based on 30-day historical performance, including fees and rewards.",
18099
18143
  realizedApyMethodology: "The realizedAPY is based on past 14 days performance by the vault",
18144
+ feeBps: {
18145
+ performanceFeeBps: 1e3
18146
+ },
18100
18147
  additionalInfo: {
18101
18148
  newBounds: {
18102
18149
  lower: -1,
@@ -29503,7 +29550,8 @@ var vesuPrimeUSDC = {
29503
29550
  name: "Vesu Prime USDC",
29504
29551
  decimals: 18,
29505
29552
  logo: usdc.logo,
29506
- displayDecimals: 2
29553
+ displayDecimals: 2,
29554
+ indexingType: "ignore" /* IGNORE */
29507
29555
  };
29508
29556
  var strk = Global.getDefaultTokens().find((t) => t.symbol === "STRK");
29509
29557
  function getYoloVaultErc4626Config(mainToken, secondaryToken) {
@@ -29649,6 +29697,9 @@ var YoloVaultStrategies = yoloVaultsConfig.map((yoloConfig) => {
29649
29697
  notARisks: getNoRiskTags(yoloRiskFactors)
29650
29698
  },
29651
29699
  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.",
29700
+ feeBps: {
29701
+ performanceFeeBps: 1e3
29702
+ },
29652
29703
  additionalInfo: {
29653
29704
  mainToken: yoloConfig.mainToken,
29654
29705
  secondaryToken: yoloConfig.secondaryToken,
@@ -33278,6 +33329,9 @@ var createUniversalStrategy = (params) => {
33278
33329
  auditUrl: AUDIT_URL3,
33279
33330
  protocols: [Protocols.VESU],
33280
33331
  realizedApyMethodology: "The realizedAPY is based on past 14 days performance by the vault",
33332
+ feeBps: {
33333
+ performanceFeeBps: 1e3
33334
+ },
33281
33335
  curator: UnwrapLabsCurator,
33282
33336
  settings: createUniversalSettings(params.tokenSymbol),
33283
33337
  contractDetails: getContractDetails(params.vaultSettings),
@@ -34996,6 +35050,9 @@ function getStrategySettings(lstSymbol, underlyingSymbol, settings, isPreview =
34996
35050
  isPreview,
34997
35051
  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.",
34998
35052
  realizedApyMethodology: "The realizedAPY is based on past 14 days performance by the vault",
35053
+ feeBps: {
35054
+ performanceFeeBps: 1e3
35055
+ },
34999
35056
  tags: lstSymbol.includes("BTC") ? ["BTC" /* BTC */, "Maxx" /* LEVERED */] : ["Maxx" /* LEVERED */],
35000
35057
  security: HYPER_LST_SECURITY,
35001
35058
  redemptionInfo: HYPER_LST_REDEMPTION_INFO,
@@ -35896,6 +35953,7 @@ export {
35896
35953
  StrategyType,
35897
35954
  TelegramGroupNotif,
35898
35955
  TelegramNotif,
35956
+ TokenIndexingType,
35899
35957
  UNIVERSAL_ADAPTERS,
35900
35958
  UNIVERSAL_MANAGE_IDS,
35901
35959
  UniversalLstMultiplierStrategy,