@strkfarm/sdk 1.0.38 → 1.0.40

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.
@@ -17293,8 +17293,7 @@ var strkfarm_risk_engine = (() => {
17293
17293
  getMainnetConfig: () => getMainnetConfig,
17294
17294
  getNoRiskTags: () => getNoRiskTags,
17295
17295
  getRiskColor: () => getRiskColor,
17296
- getRiskExplaination: () => getRiskExplaination,
17297
- logger: () => logger
17296
+ getRiskExplaination: () => getRiskExplaination
17298
17297
  });
17299
17298
 
17300
17299
  // node_modules/.pnpm/axios@1.7.2/node_modules/axios/lib/helpers/bind.js
@@ -19752,8 +19751,8 @@ var strkfarm_risk_engine = (() => {
19752
19751
  construct(value, decimals) {
19753
19752
  return new this.constructor(value, decimals);
19754
19753
  }
19755
- toString(decimals = this.maxToFixedDecimals()) {
19756
- return super.toFixed(decimals);
19754
+ toString() {
19755
+ return super.toString();
19757
19756
  }
19758
19757
  toJSON() {
19759
19758
  return this.toString();
@@ -36011,13 +36010,15 @@ var strkfarm_risk_engine = (() => {
36011
36010
  }
36012
36011
  };
36013
36012
 
36014
- // src/global.ts
36013
+ // src/utils/logger.browser.ts
36015
36014
  var logger = {
36016
36015
  ...console,
36017
36016
  verbose(message) {
36018
36017
  console.log(`[VERBOSE] ${message}`);
36019
36018
  }
36020
36019
  };
36020
+
36021
+ // src/global.ts
36021
36022
  var FatalError = class extends Error {
36022
36023
  constructor(message, err2) {
36023
36024
  super(message);
@@ -36596,7 +36597,7 @@ var strkfarm_risk_engine = (() => {
36596
36597
  } catch (e) {
36597
36598
  logger.warn("getPriceFromMyAPI error", JSON.stringify(e.message || e));
36598
36599
  }
36599
- logger.log("getPrice coinbase", tokenSymbol);
36600
+ logger.info("getPrice coinbase", tokenSymbol);
36600
36601
  let retry = 0;
36601
36602
  const MAX_RETRIES = 5;
36602
36603
  for (retry = 1; retry < MAX_RETRIES + 1; retry++) {
@@ -37774,6 +37775,11 @@ var strkfarm_risk_engine = (() => {
37774
37775
  const balance = await contract.call("balanceOf", [address.toString()]);
37775
37776
  return Web3Number.fromWei(balance.toString(), tokenDecimals);
37776
37777
  }
37778
+ async allowance(token, owner, spender, tokenDecimals) {
37779
+ const contract = this.contract(token);
37780
+ const allowance = await contract.call("allowance", [owner.toString(), spender.toString()]);
37781
+ return Web3Number.fromWei(allowance.toString(), tokenDecimals);
37782
+ }
37777
37783
  };
37778
37784
 
37779
37785
  // node_modules/.pnpm/ethers@6.13.5/node_modules/ethers/lib.esm/_version.js
@@ -49609,6 +49615,7 @@ var strkfarm_risk_engine = (() => {
49609
49615
  address: ContractAddr.from(
49610
49616
  "0x7fb5bcb8525954a60fde4e8fb8220477696ce7117ef264775a1770e23571929"
49611
49617
  ),
49618
+ launchBlock: 0,
49612
49619
  type: "ERC4626",
49613
49620
  depositTokens: [
49614
49621
  Global.getDefaultTokens().find((t) => t.symbol === "STRK")
@@ -49632,6 +49639,7 @@ var strkfarm_risk_engine = (() => {
49632
49639
  address: ContractAddr.from(
49633
49640
  "0x5eaf5ee75231cecf79921ff8ded4b5ffe96be718bcb3daf206690ad1a9ad0ca"
49634
49641
  ),
49642
+ launchBlock: 0,
49635
49643
  type: "ERC4626",
49636
49644
  auditUrl: AUDIT_URL,
49637
49645
  depositTokens: [
@@ -49655,6 +49663,7 @@ var strkfarm_risk_engine = (() => {
49655
49663
  address: ContractAddr.from(
49656
49664
  "0xa858c97e9454f407d1bd7c57472fc8d8d8449a777c822b41d18e387816f29c"
49657
49665
  ),
49666
+ launchBlock: 0,
49658
49667
  type: "ERC4626",
49659
49668
  auditUrl: AUDIT_URL,
49660
49669
  depositTokens: [
@@ -49678,6 +49687,7 @@ var strkfarm_risk_engine = (() => {
49678
49687
  address: ContractAddr.from(
49679
49688
  "0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"
49680
49689
  ),
49690
+ launchBlock: 0,
49681
49691
  type: "ERC4626",
49682
49692
  depositTokens: [
49683
49693
  Global.getDefaultTokens().find((t) => t.symbol === "USDT")
@@ -54637,11 +54647,15 @@ var strkfarm_risk_engine = (() => {
54637
54647
  this.address.address,
54638
54648
  this.config.provider
54639
54649
  );
54640
- this.lstContract = new Contract(
54641
- erc4626_abi_default,
54642
- this.metadata.additionalInfo.lstContract.address,
54643
- this.config.provider
54644
- );
54650
+ if (this.metadata.additionalInfo.lstContract) {
54651
+ this.lstContract = new Contract(
54652
+ erc4626_abi_default,
54653
+ this.metadata.additionalInfo.lstContract.address,
54654
+ this.config.provider
54655
+ );
54656
+ } else {
54657
+ this.lstContract = null;
54658
+ }
54645
54659
  const EKUBO_POSITION = "0x02e0af29598b407c8716b17f6d2795eca1b471413fa03fb145a5e33722184067";
54646
54660
  this.ekuboPositionsContract = new Contract(
54647
54661
  ekubo_positions_abi_default,
@@ -54775,7 +54789,7 @@ var strkfarm_risk_engine = (() => {
54775
54789
  const priceNow = await this.getCurrentPrice(blockIdentifier);
54776
54790
  let blockNow = typeof blockIdentifier == "number" ? blockIdentifier : (await this.config.provider.getBlockLatestAccepted()).block_number;
54777
54791
  const blockNowTime = typeof blockIdentifier == "number" ? (await this.config.provider.getBlockWithTxs(blockIdentifier)).timestamp : (/* @__PURE__ */ new Date()).getTime() / 1e3;
54778
- const blockBefore = blockNow - sinceBlocks;
54792
+ const blockBefore = Math.max(blockNow - sinceBlocks, this.metadata.launchBlock);
54779
54793
  const adjustedSupplyNow = supplyNow.minus(
54780
54794
  await this.getHarvestRewardShares(blockBefore, blockNow)
54781
54795
  );
@@ -54786,9 +54800,9 @@ var strkfarm_risk_engine = (() => {
54786
54800
  const supplyBefore = await this.totalSupply(blockBefore);
54787
54801
  const priceBefore = await this.getCurrentPrice(blockBefore);
54788
54802
  const tvlInToken0Now = tvlNow.amount0.multipliedBy(priceNow.price).plus(tvlNow.amount1);
54789
- const tvlPerShareNow = tvlInToken0Now.multipliedBy(1e18).dividedBy(adjustedSupplyNow);
54803
+ const tvlPerShareNow = tvlInToken0Now.multipliedBy(1e18).dividedBy(adjustedSupplyNow.toString());
54790
54804
  const tvlInToken0Bf = tvlBefore.amount0.multipliedBy(priceBefore.price).plus(tvlBefore.amount1);
54791
- const tvlPerShareBf = tvlInToken0Bf.multipliedBy(1e18).dividedBy(supplyBefore);
54805
+ const tvlPerShareBf = tvlInToken0Bf.multipliedBy(1e18).dividedBy(supplyBefore.toString());
54792
54806
  const timeDiffSeconds = blockNowTime - blockBeforeInfo.timestamp;
54793
54807
  logger.verbose(`tvlInToken0Now: ${tvlInToken0Now.toString()}`);
54794
54808
  logger.verbose(`tvlInToken0Bf: ${tvlInToken0Bf.toString()}`);
@@ -54826,7 +54840,9 @@ var strkfarm_risk_engine = (() => {
54826
54840
  return shares;
54827
54841
  }
54828
54842
  async balanceOf(user, blockIdentifier = "pending") {
54829
- let bal = await this.contract.call("balance_of", [user.address]);
54843
+ let bal = await this.contract.call("balance_of", [user.address], {
54844
+ blockIdentifier
54845
+ });
54830
54846
  return Web3Number.fromWei(bal.toString(), 18);
54831
54847
  }
54832
54848
  async getUserTVL(user, blockIdentifier = "pending") {
@@ -54974,11 +54990,16 @@ var strkfarm_risk_engine = (() => {
54974
54990
  return Number(result.salt.toString());
54975
54991
  }
54976
54992
  async truePrice() {
54977
- const result = await this.lstContract.call("convert_to_assets", [
54978
- uint256_exports.bnToUint256(BigInt(1e18).toString())
54979
- ]);
54980
- const truePrice = Number(BigInt(result.toString()) * BigInt(1e9) / BigInt(1e18)) / 1e9;
54981
- return truePrice;
54993
+ if (this.metadata.additionalInfo.truePrice) {
54994
+ return this.metadata.additionalInfo.truePrice;
54995
+ } else if (this.lstContract) {
54996
+ const result = await this.lstContract.call("convert_to_assets", [
54997
+ uint256_exports.bnToUint256(BigInt(1e18).toString())
54998
+ ]);
54999
+ const truePrice = Number(BigInt(result.toString()) * BigInt(1e9) / BigInt(1e18)) / 1e9;
55000
+ return truePrice;
55001
+ }
55002
+ throw new Error("No true price available");
54982
55003
  }
54983
55004
  async getCurrentPrice(blockIdentifier = "pending") {
54984
55005
  const poolKey = await this.getPoolKey(blockIdentifier);
@@ -55532,6 +55553,7 @@ var strkfarm_risk_engine = (() => {
55532
55553
  const swap1Amount = Web3Number.fromWei(
55533
55554
  uint256_exports.uint256ToBN(swapInfo1.token_from_amount).toString(),
55534
55555
  18
55556
+ // cause its always STRK?
55535
55557
  );
55536
55558
  const remainingAmount = postFeeAmount.minus(swap1Amount);
55537
55559
  const swapInfo2 = {
@@ -55622,6 +55644,9 @@ var strkfarm_risk_engine = (() => {
55622
55644
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 },
55623
55645
  { type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value: 1, weight: 75 }
55624
55646
  ];
55647
+ var _riskFactorStable = [
55648
+ { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 }
55649
+ ];
55625
55650
  var AUDIT_URL2 = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
55626
55651
  var faqs2 = [
55627
55652
  {
@@ -55668,6 +55693,7 @@ var strkfarm_risk_engine = (() => {
55668
55693
  address: ContractAddr.from(
55669
55694
  "0x01f083b98674bc21effee29ef443a00c7b9a500fd92cf30341a3da12c73f2324"
55670
55695
  ),
55696
+ launchBlock: 1209881,
55671
55697
  type: "Other",
55672
55698
  // must be same order as poolKey token0 and token1
55673
55699
  depositTokens: [
@@ -55700,6 +55726,53 @@ var strkfarm_risk_engine = (() => {
55700
55726
  answer: "A negative APY can occur when xSTRK's price drops on DEXes. This is usually temporary and tends to recover within a few days or a week."
55701
55727
  }
55702
55728
  ]
55729
+ },
55730
+ {
55731
+ name: "Ekubo USDC/USDT",
55732
+ description: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
55733
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: _description2.replace("{{POOL_NAME}}", "USDC/USDT") }),
55734
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
55735
+ "ul",
55736
+ {
55737
+ style: {
55738
+ marginLeft: "20px",
55739
+ listStyle: "circle",
55740
+ fontSize: "12px"
55741
+ },
55742
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { style: { marginTop: "10px" }, children: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." })
55743
+ }
55744
+ )
55745
+ ] }),
55746
+ address: ContractAddr.from(
55747
+ "0xd647ed735f0db52f2a5502b6e06ed21dc4284a43a36af4b60d3c80fbc56c91"
55748
+ ),
55749
+ launchBlock: 1385576,
55750
+ type: "Other",
55751
+ // must be same order as poolKey token0 and token1
55752
+ depositTokens: [
55753
+ Global.getDefaultTokens().find((t) => t.symbol === "USDC"),
55754
+ Global.getDefaultTokens().find((t) => t.symbol === "USDT")
55755
+ ],
55756
+ protocols: [_protocol2],
55757
+ auditUrl: AUDIT_URL2,
55758
+ maxTVL: Web3Number.fromWei("0", 6),
55759
+ risk: {
55760
+ riskFactor: _riskFactorStable,
55761
+ netRisk: _riskFactorStable.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactorStable.reduce((acc, curr) => acc + curr.weight, 0),
55762
+ notARisks: getNoRiskTags(_riskFactorStable)
55763
+ },
55764
+ apyMethodology: "APY based on 7-day historical performance, including fees and rewards.",
55765
+ additionalInfo: {
55766
+ newBounds: {
55767
+ lower: -1,
55768
+ upper: 1
55769
+ },
55770
+ truePrice: 1,
55771
+ feeBps: 1e3
55772
+ },
55773
+ faqs: [
55774
+ ...faqs2
55775
+ ]
55703
55776
  }
55704
55777
  ];
55705
55778
  return __toCommonJS(index_browser_exports);
@@ -33,8 +33,8 @@ var _Web3Number = class extends BigNumber {
33
33
  construct(value, decimals) {
34
34
  return new this.constructor(value, decimals);
35
35
  }
36
- toString(decimals = this.maxToFixedDecimals()) {
37
- return super.toFixed(decimals);
36
+ toString() {
37
+ return super.toString();
38
38
  }
39
39
  toJSON() {
40
40
  return this.toString();
@@ -94,13 +94,15 @@ var ContractAddr = class _ContractAddr {
94
94
  }
95
95
  };
96
96
 
97
- // src/global.ts
97
+ // src/utils/logger.browser.ts
98
98
  var logger = {
99
99
  ...console,
100
100
  verbose(message) {
101
101
  console.log(`[VERBOSE] ${message}`);
102
102
  }
103
103
  };
104
+
105
+ // src/global.ts
104
106
  var FatalError = class extends Error {
105
107
  constructor(message, err) {
106
108
  super(message);
@@ -686,7 +688,7 @@ var PricerFromApi = class extends PricerBase {
686
688
  } catch (e) {
687
689
  logger.warn("getPriceFromMyAPI error", JSON.stringify(e.message || e));
688
690
  }
689
- logger.log("getPrice coinbase", tokenSymbol);
691
+ logger.info("getPrice coinbase", tokenSymbol);
690
692
  let retry = 0;
691
693
  const MAX_RETRIES = 5;
692
694
  for (retry = 1; retry < MAX_RETRIES + 1; retry++) {
@@ -1867,6 +1869,11 @@ var ERC20 = class {
1867
1869
  const balance = await contract.call("balanceOf", [address.toString()]);
1868
1870
  return Web3Number.fromWei(balance.toString(), tokenDecimals);
1869
1871
  }
1872
+ async allowance(token, owner, spender, tokenDecimals) {
1873
+ const contract = this.contract(token);
1874
+ const allowance = await contract.call("allowance", [owner.toString(), spender.toString()]);
1875
+ return Web3Number.fromWei(allowance.toString(), tokenDecimals);
1876
+ }
1870
1877
  };
1871
1878
 
1872
1879
  // src/modules/avnu.ts
@@ -13395,6 +13402,7 @@ var VesuRebalanceStrategies = [
13395
13402
  address: ContractAddr.from(
13396
13403
  "0x7fb5bcb8525954a60fde4e8fb8220477696ce7117ef264775a1770e23571929"
13397
13404
  ),
13405
+ launchBlock: 0,
13398
13406
  type: "ERC4626",
13399
13407
  depositTokens: [
13400
13408
  Global.getDefaultTokens().find((t) => t.symbol === "STRK")
@@ -13418,6 +13426,7 @@ var VesuRebalanceStrategies = [
13418
13426
  address: ContractAddr.from(
13419
13427
  "0x5eaf5ee75231cecf79921ff8ded4b5ffe96be718bcb3daf206690ad1a9ad0ca"
13420
13428
  ),
13429
+ launchBlock: 0,
13421
13430
  type: "ERC4626",
13422
13431
  auditUrl: AUDIT_URL,
13423
13432
  depositTokens: [
@@ -13441,6 +13450,7 @@ var VesuRebalanceStrategies = [
13441
13450
  address: ContractAddr.from(
13442
13451
  "0xa858c97e9454f407d1bd7c57472fc8d8d8449a777c822b41d18e387816f29c"
13443
13452
  ),
13453
+ launchBlock: 0,
13444
13454
  type: "ERC4626",
13445
13455
  auditUrl: AUDIT_URL,
13446
13456
  depositTokens: [
@@ -13464,6 +13474,7 @@ var VesuRebalanceStrategies = [
13464
13474
  address: ContractAddr.from(
13465
13475
  "0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"
13466
13476
  ),
13477
+ launchBlock: 0,
13467
13478
  type: "ERC4626",
13468
13479
  depositTokens: [
13469
13480
  Global.getDefaultTokens().find((t) => t.symbol === "USDT")
@@ -18430,11 +18441,15 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
18430
18441
  this.address.address,
18431
18442
  this.config.provider
18432
18443
  );
18433
- this.lstContract = new Contract6(
18434
- erc4626_abi_default,
18435
- this.metadata.additionalInfo.lstContract.address,
18436
- this.config.provider
18437
- );
18444
+ if (this.metadata.additionalInfo.lstContract) {
18445
+ this.lstContract = new Contract6(
18446
+ erc4626_abi_default,
18447
+ this.metadata.additionalInfo.lstContract.address,
18448
+ this.config.provider
18449
+ );
18450
+ } else {
18451
+ this.lstContract = null;
18452
+ }
18438
18453
  const EKUBO_POSITION = "0x02e0af29598b407c8716b17f6d2795eca1b471413fa03fb145a5e33722184067";
18439
18454
  this.ekuboPositionsContract = new Contract6(
18440
18455
  ekubo_positions_abi_default,
@@ -18568,7 +18583,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
18568
18583
  const priceNow = await this.getCurrentPrice(blockIdentifier);
18569
18584
  let blockNow = typeof blockIdentifier == "number" ? blockIdentifier : (await this.config.provider.getBlockLatestAccepted()).block_number;
18570
18585
  const blockNowTime = typeof blockIdentifier == "number" ? (await this.config.provider.getBlockWithTxs(blockIdentifier)).timestamp : (/* @__PURE__ */ new Date()).getTime() / 1e3;
18571
- const blockBefore = blockNow - sinceBlocks;
18586
+ const blockBefore = Math.max(blockNow - sinceBlocks, this.metadata.launchBlock);
18572
18587
  const adjustedSupplyNow = supplyNow.minus(
18573
18588
  await this.getHarvestRewardShares(blockBefore, blockNow)
18574
18589
  );
@@ -18579,9 +18594,9 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
18579
18594
  const supplyBefore = await this.totalSupply(blockBefore);
18580
18595
  const priceBefore = await this.getCurrentPrice(blockBefore);
18581
18596
  const tvlInToken0Now = tvlNow.amount0.multipliedBy(priceNow.price).plus(tvlNow.amount1);
18582
- const tvlPerShareNow = tvlInToken0Now.multipliedBy(1e18).dividedBy(adjustedSupplyNow);
18597
+ const tvlPerShareNow = tvlInToken0Now.multipliedBy(1e18).dividedBy(adjustedSupplyNow.toString());
18583
18598
  const tvlInToken0Bf = tvlBefore.amount0.multipliedBy(priceBefore.price).plus(tvlBefore.amount1);
18584
- const tvlPerShareBf = tvlInToken0Bf.multipliedBy(1e18).dividedBy(supplyBefore);
18599
+ const tvlPerShareBf = tvlInToken0Bf.multipliedBy(1e18).dividedBy(supplyBefore.toString());
18585
18600
  const timeDiffSeconds = blockNowTime - blockBeforeInfo.timestamp;
18586
18601
  logger.verbose(`tvlInToken0Now: ${tvlInToken0Now.toString()}`);
18587
18602
  logger.verbose(`tvlInToken0Bf: ${tvlInToken0Bf.toString()}`);
@@ -18619,7 +18634,9 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
18619
18634
  return shares;
18620
18635
  }
18621
18636
  async balanceOf(user, blockIdentifier = "pending") {
18622
- let bal = await this.contract.call("balance_of", [user.address]);
18637
+ let bal = await this.contract.call("balance_of", [user.address], {
18638
+ blockIdentifier
18639
+ });
18623
18640
  return Web3Number.fromWei(bal.toString(), 18);
18624
18641
  }
18625
18642
  async getUserTVL(user, blockIdentifier = "pending") {
@@ -18767,11 +18784,16 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
18767
18784
  return Number(result.salt.toString());
18768
18785
  }
18769
18786
  async truePrice() {
18770
- const result = await this.lstContract.call("convert_to_assets", [
18771
- uint2564.bnToUint256(BigInt(1e18).toString())
18772
- ]);
18773
- const truePrice = Number(BigInt(result.toString()) * BigInt(1e9) / BigInt(1e18)) / 1e9;
18774
- return truePrice;
18787
+ if (this.metadata.additionalInfo.truePrice) {
18788
+ return this.metadata.additionalInfo.truePrice;
18789
+ } else if (this.lstContract) {
18790
+ const result = await this.lstContract.call("convert_to_assets", [
18791
+ uint2564.bnToUint256(BigInt(1e18).toString())
18792
+ ]);
18793
+ const truePrice = Number(BigInt(result.toString()) * BigInt(1e9) / BigInt(1e18)) / 1e9;
18794
+ return truePrice;
18795
+ }
18796
+ throw new Error("No true price available");
18775
18797
  }
18776
18798
  async getCurrentPrice(blockIdentifier = "pending") {
18777
18799
  const poolKey = await this.getPoolKey(blockIdentifier);
@@ -19325,6 +19347,7 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
19325
19347
  const swap1Amount = Web3Number.fromWei(
19326
19348
  uint2564.uint256ToBN(swapInfo1.token_from_amount).toString(),
19327
19349
  18
19350
+ // cause its always STRK?
19328
19351
  );
19329
19352
  const remainingAmount = postFeeAmount.minus(swap1Amount);
19330
19353
  const swapInfo2 = {
@@ -19415,6 +19438,9 @@ var _riskFactor2 = [
19415
19438
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 },
19416
19439
  { type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value: 1, weight: 75 }
19417
19440
  ];
19441
+ var _riskFactorStable = [
19442
+ { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 }
19443
+ ];
19418
19444
  var AUDIT_URL2 = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
19419
19445
  var faqs2 = [
19420
19446
  {
@@ -19461,6 +19487,7 @@ var EkuboCLVaultStrategies = [
19461
19487
  address: ContractAddr.from(
19462
19488
  "0x01f083b98674bc21effee29ef443a00c7b9a500fd92cf30341a3da12c73f2324"
19463
19489
  ),
19490
+ launchBlock: 1209881,
19464
19491
  type: "Other",
19465
19492
  // must be same order as poolKey token0 and token1
19466
19493
  depositTokens: [
@@ -19493,6 +19520,53 @@ var EkuboCLVaultStrategies = [
19493
19520
  answer: "A negative APY can occur when xSTRK's price drops on DEXes. This is usually temporary and tends to recover within a few days or a week."
19494
19521
  }
19495
19522
  ]
19523
+ },
19524
+ {
19525
+ name: "Ekubo USDC/USDT",
19526
+ description: /* @__PURE__ */ jsxs2("div", { children: [
19527
+ /* @__PURE__ */ jsx2("p", { children: _description2.replace("{{POOL_NAME}}", "USDC/USDT") }),
19528
+ /* @__PURE__ */ jsx2(
19529
+ "ul",
19530
+ {
19531
+ style: {
19532
+ marginLeft: "20px",
19533
+ listStyle: "circle",
19534
+ fontSize: "12px"
19535
+ },
19536
+ children: /* @__PURE__ */ jsx2("li", { style: { marginTop: "10px" }, children: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." })
19537
+ }
19538
+ )
19539
+ ] }),
19540
+ address: ContractAddr.from(
19541
+ "0xd647ed735f0db52f2a5502b6e06ed21dc4284a43a36af4b60d3c80fbc56c91"
19542
+ ),
19543
+ launchBlock: 1385576,
19544
+ type: "Other",
19545
+ // must be same order as poolKey token0 and token1
19546
+ depositTokens: [
19547
+ Global.getDefaultTokens().find((t) => t.symbol === "USDC"),
19548
+ Global.getDefaultTokens().find((t) => t.symbol === "USDT")
19549
+ ],
19550
+ protocols: [_protocol2],
19551
+ auditUrl: AUDIT_URL2,
19552
+ maxTVL: Web3Number.fromWei("0", 6),
19553
+ risk: {
19554
+ riskFactor: _riskFactorStable,
19555
+ netRisk: _riskFactorStable.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactorStable.reduce((acc, curr) => acc + curr.weight, 0),
19556
+ notARisks: getNoRiskTags(_riskFactorStable)
19557
+ },
19558
+ apyMethodology: "APY based on 7-day historical performance, including fees and rewards.",
19559
+ additionalInfo: {
19560
+ newBounds: {
19561
+ lower: -1,
19562
+ upper: 1
19563
+ },
19564
+ truePrice: 1,
19565
+ feeBps: 1e3
19566
+ },
19567
+ faqs: [
19568
+ ...faqs2
19569
+ ]
19496
19570
  }
19497
19571
  ];
19498
19572
  export {
@@ -19521,6 +19595,5 @@ export {
19521
19595
  getMainnetConfig,
19522
19596
  getNoRiskTags,
19523
19597
  getRiskColor,
19524
- getRiskExplaination,
19525
- logger
19598
+ getRiskExplaination
19526
19599
  };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,6 @@ import * as starknet from 'starknet';
3
3
  import { RpcProvider, BlockIdentifier, Contract, Uint256, Call, Account } from 'starknet';
4
4
  import React from 'react';
5
5
  import { Quote } from '@avnu/avnu-sdk';
6
- import * as util from 'util';
7
6
  import TelegramBot from 'node-telegram-bot-api';
8
7
 
9
8
  declare class _Web3Number<T extends _Web3Number<T>> extends BigNumber {
@@ -15,7 +14,7 @@ declare class _Web3Number<T extends _Web3Number<T>> extends BigNumber {
15
14
  plus(value: string | number | T): T;
16
15
  minus(n: number | string | T, base?: number): T;
17
16
  protected construct(value: string | number, decimals: number): T;
18
- toString(decimals?: number | undefined): string;
17
+ toString(): string;
19
18
  toJSON(): string;
20
19
  valueOf(): string;
21
20
  private maxToFixedDecimals;
@@ -97,6 +96,7 @@ interface IStrategyMetadata<T> {
97
96
  name: string;
98
97
  description: string | React.ReactNode;
99
98
  address: ContractAddr;
99
+ launchBlock: number;
100
100
  type: "ERC4626" | "ERC721" | "Other";
101
101
  depositTokens: TokenInfo[];
102
102
  protocols: IProtocol[];
@@ -265,6 +265,7 @@ declare class ERC20 {
265
265
  constructor(config: IConfig);
266
266
  contract(addr: string | ContractAddr): Contract;
267
267
  balanceOf(token: string | ContractAddr, address: string | ContractAddr, tokenDecimals: number): Promise<Web3Number>;
268
+ allowance(token: string | ContractAddr, owner: string | ContractAddr, spender: string | ContractAddr, tokenDecimals: number): Promise<Web3Number>;
268
269
  }
269
270
 
270
271
  interface Route {
@@ -290,52 +291,6 @@ declare class AvnuWrapper {
290
291
  getSwapInfo(quote: Quote, taker: string, integratorFeeBps: number, integratorFeeRecipient: string, minAmount?: string): Promise<SwapInfo>;
291
292
  }
292
293
 
293
- declare const logger: {
294
- verbose(message: string): void;
295
- assert(condition?: boolean, ...data: any[]): void;
296
- assert(value: any, message?: string, ...optionalParams: any[]): void;
297
- clear(): void;
298
- clear(): void;
299
- count(label?: string): void;
300
- count(label?: string): void;
301
- countReset(label?: string): void;
302
- countReset(label?: string): void;
303
- debug(...data: any[]): void;
304
- debug(message?: any, ...optionalParams: any[]): void;
305
- dir(item?: any, options?: any): void;
306
- dir(obj: any, options?: util.InspectOptions): void;
307
- dirxml(...data: any[]): void;
308
- dirxml(...data: any[]): void;
309
- error(...data: any[]): void;
310
- error(message?: any, ...optionalParams: any[]): void;
311
- group(...data: any[]): void;
312
- group(...label: any[]): void;
313
- groupCollapsed(...data: any[]): void;
314
- groupCollapsed(...label: any[]): void;
315
- groupEnd(): void;
316
- groupEnd(): void;
317
- info(...data: any[]): void;
318
- info(message?: any, ...optionalParams: any[]): void;
319
- log(...data: any[]): void;
320
- log(message?: any, ...optionalParams: any[]): void;
321
- table(tabularData?: any, properties?: string[]): void;
322
- table(tabularData: any, properties?: readonly string[]): void;
323
- time(label?: string): void;
324
- time(label?: string): void;
325
- timeEnd(label?: string): void;
326
- timeEnd(label?: string): void;
327
- timeLog(label?: string, ...data: any[]): void;
328
- timeLog(label?: string, ...data: any[]): void;
329
- timeStamp(label?: string): void;
330
- timeStamp(label?: string): void;
331
- trace(...data: any[]): void;
332
- trace(message?: any, ...optionalParams: any[]): void;
333
- warn(...data: any[]): void;
334
- warn(message?: any, ...optionalParams: any[]): void;
335
- Console: console.ConsoleConstructor;
336
- profile(label?: string): void;
337
- profileEnd(label?: string): void;
338
- };
339
294
  declare class FatalError extends Error {
340
295
  constructor(message: string, err?: Error);
341
296
  }
@@ -640,7 +595,8 @@ interface CLVaultStrategySettings {
640
595
  lower: number;
641
596
  upper: number;
642
597
  };
643
- lstContract: ContractAddr;
598
+ lstContract?: ContractAddr;
599
+ truePrice?: number;
644
600
  feeBps: number;
645
601
  }
646
602
  declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount> {
@@ -655,7 +611,7 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
655
611
  readonly BASE_WEIGHT = 10000;
656
612
  readonly ekuboPositionsContract: Contract;
657
613
  readonly ekuboMathContract: Contract;
658
- readonly lstContract: Contract;
614
+ readonly lstContract: Contract | null;
659
615
  poolKey: EkuboPoolKey | undefined;
660
616
  readonly avnu: AvnuWrapper;
661
617
  /**
@@ -766,6 +722,19 @@ declare class TelegramNotif {
766
722
  sendMessage(msg: string): void;
767
723
  }
768
724
 
725
+ interface LeveledLogMethod {
726
+ (message: string, ...meta: any[]): void;
727
+ (message: any): void;
728
+ }
729
+ interface MyLogger {
730
+ error: LeveledLogMethod;
731
+ warn: LeveledLogMethod;
732
+ info: LeveledLogMethod;
733
+ verbose: LeveledLogMethod;
734
+ debug: LeveledLogMethod;
735
+ }
736
+ declare const logger: MyLogger;
737
+
769
738
  type RequiredFields<T> = {
770
739
  [K in keyof T]-?: T[K];
771
740
  };