@strkfarm/sdk 1.0.62 → 1.0.64

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.js CHANGED
@@ -300,7 +300,7 @@ var defaultTokens = [{
300
300
  name: "WBTC",
301
301
  symbol: "WBTC",
302
302
  logo: "https://assets.troves.fi/integrations/tokens/wbtc.svg",
303
- address: ContractAddr.from("0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac"),
303
+ address: ContractAddr.from("0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac"),
304
304
  decimals: 8,
305
305
  coingeckId: void 0,
306
306
  displayDecimals: 6,
@@ -316,6 +316,26 @@ var defaultTokens = [{
316
316
  displayDecimals: 6,
317
317
  priceCheckAmount: 1e-4
318
318
  // 112000 * 0.0001 = $11.2
319
+ }, {
320
+ name: "solvBTC",
321
+ symbol: "solvBTC",
322
+ logo: "https://assets.strkfarm.com/integrations/tokens/solvbtc.svg",
323
+ address: ContractAddr.from("0x0593e034dda23eea82d2ba9a30960ed42cf4a01502cc2351dc9b9881f9931a68"),
324
+ decimals: 18,
325
+ coingeckId: void 0,
326
+ displayDecimals: 6,
327
+ priceCheckAmount: 1e-4
328
+ // 112000 * 0.0001 = $11.2
329
+ }, {
330
+ name: "LBTC",
331
+ symbol: "LBTC",
332
+ logo: "https://assets.strkfarm.com/integrations/tokens/lbtc.svg",
333
+ address: ContractAddr.from("0x036834a40984312f7f7de8d31e3f6305b325389eaeea5b1c0664b2fb936461a4"),
334
+ decimals: 8,
335
+ coingeckId: void 0,
336
+ displayDecimals: 6,
337
+ priceCheckAmount: 1e-4
338
+ // 112000 * 0.0001 = $11.2
319
339
  }];
320
340
  var tokens = defaultTokens;
321
341
  var _Global = class _Global {
@@ -3977,11 +3997,12 @@ var EkuboHarvests = class extends Harvests {
3977
3997
  return rewards.sort((a, b) => b.endDate.getTime() - a.endDate.getTime());
3978
3998
  }
3979
3999
  };
4000
+ var VESU_REWARDS_CONTRACT = ContractAddr.from("0x0387f3eb1d98632fbe3440a9f1385Aec9d87b6172491d3Dd81f1c35A7c61048F");
3980
4001
  var VesuHarvests = class _VesuHarvests extends Harvests {
3981
4002
  async getHarvests(addr) {
3982
4003
  const result = await fetch(`https://api.vesu.xyz/users/${addr.address}/strk-rewards/calldata`);
3983
4004
  const data = await result.json();
3984
- const rewardsContract = ContractAddr.from("0x0387f3eb1d98632fbe3440a9f1385Aec9d87b6172491d3Dd81f1c35A7c61048F");
4005
+ const rewardsContract = VESU_REWARDS_CONTRACT;
3985
4006
  const cls = await this.config.provider.getClassAt(rewardsContract.address);
3986
4007
  const contract = new import_starknet8.Contract(cls.abi, rewardsContract.address, this.config.provider);
3987
4008
  const _claimed_amount = await contract.call("amount_already_claimed", [addr.address]);
@@ -16342,14 +16363,31 @@ var _protocol2 = {
16342
16363
  name: "Ekubo",
16343
16364
  logo: "https://app.ekubo.org/favicon.ico"
16344
16365
  };
16345
- var _riskFactor2 = [
16346
- { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 34, reason: "Audited smart contracts" },
16347
- { type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value: 0.75, weight: 33, reason: "Low risk due to co-related assets" },
16348
- { type: "Market Risk" /* MARKET_RISK */, value: 0.75, weight: 33, reason: "Low risk due to co-related assets" }
16366
+ var _corelatedPoolRiskFactors = [
16367
+ { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 2 /* WELL_AUDITED */, weight: 34, reason: "Audited smart contracts" },
16368
+ { type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value: 1 /* HIGHLY_CORRELATED */, weight: 33, reason: "Low risk due to co-related assets" },
16369
+ { type: "Market Risk" /* MARKET_RISK */, value: 1 /* VERY_LOW_VOLATILITY */, weight: 33, reason: "Low risk due to co-related assets" }
16370
+ ];
16371
+ var mediumVolatilityPoolRiskFactors = [
16372
+ { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 2 /* WELL_AUDITED */, weight: 34, reason: "Audited smart contracts" },
16373
+ { type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value: 3 /* NON_CORRELATED */, weight: 33, reason: "Low risk due to co-related assets" },
16374
+ { type: "Market Risk" /* MARKET_RISK */, value: 3 /* MODERATE_VOLATILITY */, weight: 33, reason: "Low risk due to co-related assets" }
16349
16375
  ];
16350
- var _riskFactorStable = [
16351
- { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 }
16376
+ var highVolatilityPoolRiskFactors = [
16377
+ { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 2 /* WELL_AUDITED */, weight: 34, reason: "Audited smart contracts" },
16378
+ { type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value: 3 /* NON_CORRELATED */, weight: 33, reason: "Low risk due to co-related assets" },
16379
+ { type: "Market Risk" /* MARKET_RISK */, value: 4 /* HIGH_VOLATILITY */, weight: 33, reason: "Low risk due to co-related assets" }
16352
16380
  ];
16381
+ var mediumRisk = {
16382
+ riskFactor: mediumVolatilityPoolRiskFactors,
16383
+ netRisk: mediumVolatilityPoolRiskFactors.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / mediumVolatilityPoolRiskFactors.reduce((acc, curr) => acc + curr.weight, 0),
16384
+ notARisks: getNoRiskTags(mediumVolatilityPoolRiskFactors)
16385
+ };
16386
+ var highRisk = {
16387
+ riskFactor: highVolatilityPoolRiskFactors,
16388
+ netRisk: highVolatilityPoolRiskFactors.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / highVolatilityPoolRiskFactors.reduce((acc, curr) => acc + curr.weight, 0),
16389
+ notARisks: getNoRiskTags(highVolatilityPoolRiskFactors)
16390
+ };
16353
16391
  var AUDIT_URL2 = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
16354
16392
  var faqs2 = [
16355
16393
  {
@@ -16364,6 +16402,10 @@ var faqs2 = [
16364
16402
  question: "What happens during withdrawal?",
16365
16403
  answer: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices."
16366
16404
  },
16405
+ {
16406
+ question: "Are there any deposit/withdrawal fees?",
16407
+ answer: "No, there are no deposit/withdrawal fees. However, there is a performance fee varying between 10-20% of the fees and rewards generated. The exact fee is determined by the strategy and the APY shown is net of this fee."
16408
+ },
16367
16409
  {
16368
16410
  question: "Is the strategy audited?",
16369
16411
  answer: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
@@ -16398,9 +16440,9 @@ var xSTRKSTRK = {
16398
16440
  auditUrl: AUDIT_URL2,
16399
16441
  maxTVL: Web3Number.fromWei("0", 18),
16400
16442
  risk: {
16401
- riskFactor: _riskFactor2,
16402
- netRisk: _riskFactor2.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor2.reduce((acc, curr) => acc + curr.weight, 0),
16403
- notARisks: getNoRiskTags(_riskFactor2)
16443
+ riskFactor: _corelatedPoolRiskFactors,
16444
+ netRisk: _corelatedPoolRiskFactors.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _corelatedPoolRiskFactors.reduce((acc, curr) => acc + curr.weight, 0),
16445
+ notARisks: getNoRiskTags(_corelatedPoolRiskFactors)
16404
16446
  },
16405
16447
  apyMethodology: "APY based on 7-day historical performance, including fees and rewards.",
16406
16448
  additionalInfo: {
@@ -16416,7 +16458,8 @@ var xSTRKSTRK = {
16416
16458
  customShouldRebalance: async (currentPrice) => true,
16417
16459
  minWaitHours: 24,
16418
16460
  direction: "uponly"
16419
- }
16461
+ },
16462
+ quoteAsset: Global.getDefaultTokens().find((t) => t.symbol === "STRK")
16420
16463
  },
16421
16464
  faqs: [
16422
16465
  ...faqs2,
@@ -16433,68 +16476,165 @@ var xSTRKSTRK = {
16433
16476
  contractDetails: [],
16434
16477
  investmentSteps: []
16435
16478
  };
16436
- var EkuboCLVaultStrategies = [
16437
- xSTRKSTRK,
16479
+ var ETHUSDCRe7Strategy = {
16480
+ ...xSTRKSTRK,
16481
+ name: "Ekubo ETH/USDC",
16482
+ description: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}),
16483
+ address: ContractAddr.from(
16484
+ "0x160d8fa4569ef6a12e6bf47cb943d7b5ebba8a41a69a14c1d943050ba5ff947"
16485
+ ),
16486
+ launchBlock: 1501761,
16487
+ // must be same order as poolKey token0 and token1
16488
+ depositTokens: [
16489
+ Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
16490
+ Global.getDefaultTokens().find((t) => t.symbol === "USDC")
16491
+ ],
16492
+ additionalInfo: {
16493
+ newBounds: "Managed by Re7",
16494
+ truePrice: 1,
16495
+ feeBps: 1e3,
16496
+ rebalanceConditions: {
16497
+ customShouldRebalance: async (currentPrice) => currentPrice > 0.99 && currentPrice < 1.01,
16498
+ minWaitHours: 6,
16499
+ direction: "any"
16500
+ },
16501
+ quoteAsset: Global.getDefaultTokens().find((t) => t.symbol === "USDC")
16502
+ },
16503
+ faqs: [
16504
+ ...faqs2,
16505
+ {
16506
+ question: "Who is the curator of this strategy?",
16507
+ answer: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
16508
+ "Re7 Labs is the curator of this strategy. Re7 Labs is a well-known Web3 asset management firm. This strategy is completely managed by them, including ownership of the vault. Troves is developer of the smart contracts and maintains infrastructure to help users access these strategies. You can find more information about them on their website ",
16509
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: "https://www.re7labs.xyz", style: { textDecoration: "underline", marginLeft: "2px" }, target: "_blank", children: "here" }),
16510
+ "."
16511
+ ] })
16512
+ }
16513
+ ],
16514
+ risk: highRisk,
16515
+ points: [],
16516
+ curator: { name: "Re7 Labs", logo: "https://www.re7labs.xyz/favicon.ico" }
16517
+ };
16518
+ var RE7Strategies = [
16519
+ ETHUSDCRe7Strategy,
16438
16520
  {
16439
- ...xSTRKSTRK,
16521
+ ...ETHUSDCRe7Strategy,
16440
16522
  name: "Ekubo USDC/USDT",
16441
16523
  description: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}),
16442
16524
  address: ContractAddr.from(
16443
- "0xd647ed735f0db52f2a5502b6e06ed21dc4284a43a36af4b60d3c80fbc56c91"
16525
+ "0x3a4f8debaf12af97bb911099bc011d63d6c208d4c5ba8e15d7f437785b0aaa2"
16444
16526
  ),
16445
- launchBlock: 1385576,
16527
+ launchBlock: 1501761,
16446
16528
  // must be same order as poolKey token0 and token1
16447
16529
  depositTokens: [
16448
16530
  Global.getDefaultTokens().find((t) => t.symbol === "USDC"),
16449
16531
  Global.getDefaultTokens().find((t) => t.symbol === "USDT")
16450
16532
  ],
16451
- additionalInfo: {
16452
- newBounds: {
16453
- lower: -1,
16454
- upper: 1
16455
- },
16456
- truePrice: 1,
16457
- feeBps: 1e3,
16458
- rebalanceConditions: {
16459
- customShouldRebalance: async (currentPrice) => currentPrice > 0.99 && currentPrice < 1.01,
16460
- minWaitHours: 6,
16461
- direction: "any"
16462
- }
16463
- }
16533
+ risk: xSTRKSTRK.risk
16464
16534
  },
16465
16535
  {
16466
- ...xSTRKSTRK,
16536
+ ...ETHUSDCRe7Strategy,
16467
16537
  name: "Ekubo STRK/USDC",
16468
16538
  description: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}),
16469
16539
  address: ContractAddr.from(
16470
- "0xb7bd37121041261446d8eedec618955a4490641034942da688e8cbddea7b23"
16540
+ "0x351b36d0d9d8b40010658825adeeddb1397436cd41acd0ff6c6e23aaa8b5b30"
16471
16541
  ),
16472
- launchBlock: 1492136,
16542
+ launchBlock: 1501762,
16473
16543
  // must be same order as poolKey token0 and token1
16474
16544
  depositTokens: [
16475
16545
  Global.getDefaultTokens().find((t) => t.symbol === "STRK"),
16476
16546
  Global.getDefaultTokens().find((t) => t.symbol === "USDC")
16477
16547
  ],
16478
- maxTVL: Web3Number.fromWei("0", 6),
16479
- additionalInfo: {
16480
- newBounds: "Managed by Re7",
16481
- feeBps: 1e3,
16482
- rebalanceConditions: {
16483
- customShouldRebalance: async (currentPrice) => true,
16484
- minWaitHours: 6,
16485
- direction: "any"
16486
- }
16487
- }
16548
+ risk: highRisk
16549
+ },
16550
+ {
16551
+ ...ETHUSDCRe7Strategy,
16552
+ name: "Ekubo STRK/ETH",
16553
+ description: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}),
16554
+ address: ContractAddr.from(
16555
+ "0x4ce3024b0ee879009112d7b0e073f8a87153dd35b029347d4247ffe48d28f51"
16556
+ ),
16557
+ launchBlock: 1501763,
16558
+ // must be same order as poolKey token0 and token1
16559
+ depositTokens: [
16560
+ Global.getDefaultTokens().find((t) => t.symbol === "STRK"),
16561
+ Global.getDefaultTokens().find((t) => t.symbol === "ETH")
16562
+ ],
16563
+ risk: highRisk
16564
+ },
16565
+ {
16566
+ ...ETHUSDCRe7Strategy,
16567
+ name: "Ekubo WBTC/USDC",
16568
+ description: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}),
16569
+ address: ContractAddr.from(
16570
+ "0x2bcaef2eb7706875a5fdc6853dd961a0590f850bc3a031c59887189b5e84ba1"
16571
+ ),
16572
+ launchBlock: 1501764,
16573
+ // must be same order as poolKey token0 and token1
16574
+ depositTokens: [
16575
+ Global.getDefaultTokens().find((t) => t.symbol === "WBTC"),
16576
+ Global.getDefaultTokens().find((t) => t.symbol === "USDC")
16577
+ ],
16578
+ risk: mediumRisk
16579
+ },
16580
+ {
16581
+ ...ETHUSDCRe7Strategy,
16582
+ name: "Ekubo tBTC/USDC",
16583
+ description: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}),
16584
+ address: ContractAddr.from(
16585
+ "0x4aad891a2d4432fba06b6558631bb13f6bbd7f6f33ab8c3111e344889ea4456"
16586
+ ),
16587
+ launchBlock: 1501764,
16588
+ // must be same order as poolKey token0 and token1
16589
+ depositTokens: [
16590
+ Global.getDefaultTokens().find((t) => t.symbol === "tBTC"),
16591
+ Global.getDefaultTokens().find((t) => t.symbol === "USDC")
16592
+ ],
16593
+ risk: mediumRisk
16594
+ },
16595
+ {
16596
+ ...ETHUSDCRe7Strategy,
16597
+ name: "Ekubo WBTC/ETH",
16598
+ description: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}),
16599
+ address: ContractAddr.from(
16600
+ "0x1c9232b8186d9317652f05055615f18a120c2ad9e5ee96c39e031c257fb945b"
16601
+ ),
16602
+ launchBlock: 1501765,
16603
+ // must be same order as poolKey token0 and token1
16604
+ depositTokens: [
16605
+ Global.getDefaultTokens().find((t) => t.symbol === "WBTC"),
16606
+ Global.getDefaultTokens().find((t) => t.symbol === "ETH")
16607
+ ],
16608
+ risk: mediumRisk
16609
+ },
16610
+ {
16611
+ ...ETHUSDCRe7Strategy,
16612
+ name: "Ekubo WBTC/STRK",
16613
+ description: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}),
16614
+ address: ContractAddr.from(
16615
+ "0x1248e385c23a929a015ec298a26560fa7745bbd6e41a886550e337b02714b1b"
16616
+ ),
16617
+ launchBlock: 1501766,
16618
+ // must be same order as poolKey token0 and token1
16619
+ depositTokens: [
16620
+ Global.getDefaultTokens().find((t) => t.symbol === "WBTC"),
16621
+ Global.getDefaultTokens().find((t) => t.symbol === "STRK")
16622
+ ],
16623
+ risk: highRisk
16488
16624
  }
16489
16625
  ];
16626
+ var EkuboCLVaultStrategies = [
16627
+ xSTRKSTRK,
16628
+ ...RE7Strategies
16629
+ ];
16490
16630
  EkuboCLVaultStrategies.forEach((s) => {
16491
16631
  s.contractDetails = [
16492
16632
  {
16493
16633
  address: s.address,
16494
16634
  name: "Vault",
16495
16635
  sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/tree/main/src/strategies/cl_vault"
16496
- },
16497
- ...COMMON_CONTRACTS
16636
+ }
16637
+ // ...COMMON_CONTRACTS
16498
16638
  ];
16499
16639
  s.docs = "https://docs.troves.fi/p/ekubo-cl-vaults";
16500
16640
  s.description = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
@@ -18465,7 +18605,7 @@ var endurProtocol = {
18465
18605
  name: "Endur",
18466
18606
  logo: "https://app.endur.fi/logo.png"
18467
18607
  };
18468
- var _riskFactor3 = [
18608
+ var _riskFactor2 = [
18469
18609
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25, reason: "Audited by CSC" },
18470
18610
  { type: "Depeg Risk" /* DEPEG_RISK */, value: 0.25, weight: 25, reason: "Depending on prevailing market conditions and trading activity, xSTRK may lose its peg to the underlying asset." },
18471
18611
  { type: "Liquidation Risk" /* LIQUIDATION_RISK */, value: 0.1, weight: 10, reason: "Liquidation risk is low due to the nature of the Re7 Pool on Vesu" },
@@ -18540,9 +18680,9 @@ var SenseiStrategies = [
18540
18680
  protocols: [endurProtocol, vesuProtocol],
18541
18681
  maxTVL: new Web3Number("1500000", 18),
18542
18682
  risk: {
18543
- riskFactor: _riskFactor3,
18544
- netRisk: _riskFactor3.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor3.reduce((acc, curr) => acc + curr.weight, 0),
18545
- notARisks: getNoRiskTags(_riskFactor3)
18683
+ riskFactor: _riskFactor2,
18684
+ netRisk: _riskFactor2.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor2.reduce((acc, curr) => acc + curr.weight, 0),
18685
+ notARisks: getNoRiskTags(_riskFactor2)
18546
18686
  },
18547
18687
  additionalInfo: {
18548
18688
  mainToken: Global.getDefaultTokens().find((t) => t.symbol === "STRK"),
@@ -18569,7 +18709,9 @@ var SenseiStrategies = [
18569
18709
  var import_starknet12 = require("starknet");
18570
18710
 
18571
18711
  // src/strategies/universal-adapters/adapter-utils.ts
18572
- var SIMPLE_SANITIZER = ContractAddr.from("0x3798dc4f83fdfad199e5236e3656cf2fb79bc50c00504d0dd41522e0f042072");
18712
+ var SIMPLE_SANITIZER = ContractAddr.from("0x5a2e3ceb3da368b983a8717898427ab7b6daf04014b70f321e777f9aad940b4");
18713
+ var PRICE_ROUTER = ContractAddr.from("0x05e83Fa38D791d2dba8E6f487758A9687FfEe191A6Cf8a6c5761ab0a110DB837");
18714
+ var AVNU_MIDDLEWARE = ContractAddr.from("0x4a7972ed3f5d1e74a6d6c4a8f467666953d081c8f2270390cc169d50d17cb0d");
18573
18715
  function toBigInt(value) {
18574
18716
  if (typeof value === "string") {
18575
18717
  return BigInt(value);
@@ -18713,6 +18855,66 @@ var CommonAdapter = class extends BaseAdapter {
18713
18855
  };
18714
18856
  };
18715
18857
  }
18858
+ getAvnuAdapter(fromToken, toToken, id) {
18859
+ return () => ({
18860
+ leaf: this.constructSimpleLeafData({
18861
+ id,
18862
+ target: AVNU_MIDDLEWARE,
18863
+ method: "multi_route_swap",
18864
+ packedArguments: [
18865
+ fromToken.toBigInt(),
18866
+ toToken.toBigInt(),
18867
+ this.config.vaultAllocator.toBigInt()
18868
+ ]
18869
+ }),
18870
+ callConstructor: this.getAvnuCall(fromToken, toToken).bind(this)
18871
+ });
18872
+ }
18873
+ getAvnuCall(fromToken, toToken) {
18874
+ return (params) => {
18875
+ return {
18876
+ sanitizer: SIMPLE_SANITIZER,
18877
+ call: {
18878
+ contractAddress: AVNU_MIDDLEWARE,
18879
+ selector: import_starknet13.hash.getSelectorFromName("multi_route_swap"),
18880
+ calldata: [
18881
+ fromToken.toBigInt(),
18882
+ // sell_token_address
18883
+ toBigInt(params.props.token_from_amount.low.toString()),
18884
+ // sell_token_amount low
18885
+ toBigInt(params.props.token_from_amount.high.toString()),
18886
+ // sell_token_amount high
18887
+ toToken.toBigInt(),
18888
+ // buy_token_address
18889
+ toBigInt(params.props.token_to_amount.low.toString()),
18890
+ // buy_token_amount low
18891
+ toBigInt(params.props.token_to_amount.high.toString()),
18892
+ // buy_token_amount high
18893
+ toBigInt(params.props.token_to_min_amount.low.toString()),
18894
+ // buy_token_min_amount low
18895
+ toBigInt(params.props.token_to_min_amount.high.toString()),
18896
+ // buy_token_min_amount high
18897
+ this.config.vaultAllocator.toBigInt(),
18898
+ // beneficiary
18899
+ toBigInt(0),
18900
+ // integrator_fee_amount_bps
18901
+ this.config.vaultAllocator.toBigInt(),
18902
+ // integrator_fee_recipient
18903
+ // unpack routes
18904
+ BigInt(params.props.routes.length),
18905
+ ...params.props.routes.map((r) => [
18906
+ BigInt(import_starknet13.num.hexToDecimalString(r.token_from)),
18907
+ BigInt(import_starknet13.num.hexToDecimalString(r.token_to)),
18908
+ BigInt(import_starknet13.num.hexToDecimalString(r.exchange_address)),
18909
+ BigInt(r.percent),
18910
+ BigInt(r.additional_swap_params.length),
18911
+ ...r.additional_swap_params.map((p) => BigInt(import_starknet13.num.hexToDecimalString(p)))
18912
+ ]).flat()
18913
+ ]
18914
+ }
18915
+ };
18916
+ };
18917
+ }
18716
18918
  };
18717
18919
 
18718
18920
  // src/strategies/universal-adapters/vesu-adapter.ts
@@ -21049,6 +21251,40 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
21049
21251
  }
21050
21252
  };
21051
21253
  };
21254
+ this.getDefispringRewardsAdapter = (id) => {
21255
+ return () => {
21256
+ const packedArguments = [];
21257
+ const output = {
21258
+ id: BigInt(import_starknet14.num.getDecimalString(import_starknet14.shortString.encodeShortString(id))),
21259
+ readableId: id,
21260
+ data: [
21261
+ SIMPLE_SANITIZER.toBigInt(),
21262
+ // sanitizer address
21263
+ VESU_REWARDS_CONTRACT.toBigInt(),
21264
+ // contract
21265
+ toBigInt(import_starknet14.hash.getSelectorFromName("claim")),
21266
+ // method name
21267
+ BigInt(packedArguments.length),
21268
+ ...packedArguments
21269
+ ]
21270
+ };
21271
+ return { leaf: output, callConstructor: this.getDefiSpringClaimCall().bind(this) };
21272
+ };
21273
+ };
21274
+ this.getDefiSpringClaimCall = () => {
21275
+ return (params) => ({
21276
+ sanitizer: SIMPLE_SANITIZER,
21277
+ call: {
21278
+ contractAddress: VESU_REWARDS_CONTRACT,
21279
+ selector: import_starknet14.hash.getSelectorFromName("claim"),
21280
+ calldata: [
21281
+ BigInt(params.amount.toWei()),
21282
+ BigInt(params.proofs.length),
21283
+ ...params.proofs.map((proof) => BigInt(import_starknet14.num.hexToDecimalString(proof)))
21284
+ ]
21285
+ }
21286
+ });
21287
+ };
21052
21288
  this.config = config;
21053
21289
  }
21054
21290
  static getDefaultModifyPositionCallParams(params) {
@@ -23678,7 +23914,7 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
23678
23914
  const aumToken = vesuAum.plus(balance.amount);
23679
23915
  logger.verbose(`${this.getTag()} Actual AUM: ${aumToken}`);
23680
23916
  const netAPY = await this.netAPY();
23681
- const defispringAPY = netAPY.splits.find((s) => s.id === "defispring")?.apy || 0;
23917
+ const defispringAPY = (netAPY.splits.find((s) => s.id === "defispring")?.apy || 0) * 0.8;
23682
23918
  if (!defispringAPY) throw new Error("DefiSpring APY not found");
23683
23919
  const timeDiff = Math.round(Date.now() / 1e3) - Number(lastReportTime);
23684
23920
  const growthRate = timeDiff * defispringAPY / (365 * 24 * 60 * 60);
@@ -23921,6 +24157,51 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
23921
24157
  const manageCall = this.getManageCall(["approve_bring_liquidity" /* APPROVE_BRING_LIQUIDITY */, "bring_liquidity" /* BRING_LIQUIDITY */], [manageCall1, manageCall2]);
23922
24158
  return manageCall;
23923
24159
  }
24160
+ async getHarvestCall() {
24161
+ const vesuHarvest = new VesuHarvests(this.config);
24162
+ const harvestInfo = await vesuHarvest.getUnHarvestedRewards(this.metadata.additionalInfo.vaultAllocator);
24163
+ if (harvestInfo.length != 1) {
24164
+ throw new Error(`Expected 1 harvest info, got ${harvestInfo.length}`);
24165
+ }
24166
+ const amount = harvestInfo[0].claim.amount;
24167
+ const actualReward = harvestInfo[0].actualReward;
24168
+ const proofs = harvestInfo[0].proof;
24169
+ if (actualReward.isZero()) {
24170
+ throw new Error(`Expected non-zero actual reward, got ${harvestInfo[0].actualReward}`);
24171
+ }
24172
+ const manage1Info = this.getProofs("defispring_rewards" /* DEFISPRING_REWARDS */);
24173
+ const manageCall1 = manage1Info.callConstructor({
24174
+ amount,
24175
+ proofs
24176
+ });
24177
+ const proofIds = ["defispring_rewards" /* DEFISPRING_REWARDS */];
24178
+ const manageCalls = [manageCall1];
24179
+ const STRK2 = Global.getDefaultTokens().find((t) => t.symbol === "STRK");
24180
+ if (this.asset().symbol != "STRK") {
24181
+ const manage2Info = this.getProofs("approve_swap_token1" /* APPROVE_SWAP_TOKEN1 */);
24182
+ const manageCall2 = manage2Info.callConstructor({
24183
+ amount: actualReward
24184
+ });
24185
+ const avnuModule = new AvnuWrapper();
24186
+ const quote = await avnuModule.getQuotes(
24187
+ STRK2.address.address,
24188
+ this.asset().address.address,
24189
+ actualReward.toWei(),
24190
+ this.address.address
24191
+ );
24192
+ const swapInfo = await avnuModule.getSwapInfo(quote, this.address.address, 0, this.address.address);
24193
+ const manage3Info = this.getProofs("avnu_swap_rewards" /* AVNU_SWAP_REWARDS */);
24194
+ const manageCall3 = manage3Info.callConstructor({
24195
+ props: swapInfo
24196
+ });
24197
+ proofIds.push("approve_swap_token1" /* APPROVE_SWAP_TOKEN1 */);
24198
+ proofIds.push("avnu_swap_rewards" /* AVNU_SWAP_REWARDS */);
24199
+ manageCalls.push(manageCall2);
24200
+ manageCalls.push(manageCall3);
24201
+ }
24202
+ const manageCall = this.getManageCall(proofIds, manageCalls);
24203
+ return { call: manageCall, reward: actualReward, tokenInfo: STRK2 };
24204
+ }
23924
24205
  async getRebalanceCall(params) {
23925
24206
  let callSet1 = this.getVesuModifyPositionCalls({
23926
24207
  isLeg1: true,
@@ -23957,6 +24238,9 @@ var UNIVERSAL_MANAGE_IDS = /* @__PURE__ */ ((UNIVERSAL_MANAGE_IDS2) => {
23957
24238
  UNIVERSAL_MANAGE_IDS2["APPROVE_TOKEN2"] = "approve_token2";
23958
24239
  UNIVERSAL_MANAGE_IDS2["APPROVE_BRING_LIQUIDITY"] = "approve_bring_liquidity";
23959
24240
  UNIVERSAL_MANAGE_IDS2["BRING_LIQUIDITY"] = "bring_liquidity";
24241
+ UNIVERSAL_MANAGE_IDS2["DEFISPRING_REWARDS"] = "defispring_rewards";
24242
+ UNIVERSAL_MANAGE_IDS2["APPROVE_SWAP_TOKEN1"] = "approve_swap_token1";
24243
+ UNIVERSAL_MANAGE_IDS2["AVNU_SWAP_REWARDS"] = "avnu_swap_rewards";
23960
24244
  return UNIVERSAL_MANAGE_IDS2;
23961
24245
  })(UNIVERSAL_MANAGE_IDS || {});
23962
24246
  var UNIVERSAL_ADAPTERS = /* @__PURE__ */ ((UNIVERSAL_ADAPTERS2) => {
@@ -24006,9 +24290,13 @@ function getLooperSettings(token1Symbol, token2Symbol, vaultSettings, pool1, poo
24006
24290
  vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(ETHToken.address, vesuAdapterETHUSDC.VESU_SINGLETON, "approve_token2" /* APPROVE_TOKEN2 */).bind(commonAdapter));
24007
24291
  vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(USDCToken.address, vaultSettings.vaultAddress, "approve_bring_liquidity" /* APPROVE_BRING_LIQUIDITY */).bind(commonAdapter));
24008
24292
  vaultSettings.leafAdapters.push(commonAdapter.getBringLiquidityAdapter("bring_liquidity" /* BRING_LIQUIDITY */).bind(commonAdapter));
24293
+ vaultSettings.leafAdapters.push(vesuAdapterUSDCETH.getDefispringRewardsAdapter("defispring_rewards" /* DEFISPRING_REWARDS */).bind(vesuAdapterUSDCETH));
24294
+ const STRKToken = Global.getDefaultTokens().find((token) => token.symbol === "STRK");
24295
+ vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(STRKToken.address, AVNU_MIDDLEWARE, "approve_swap_token1" /* APPROVE_SWAP_TOKEN1 */).bind(commonAdapter));
24296
+ vaultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(STRKToken.address, USDCToken.address, "avnu_swap_rewards" /* AVNU_SWAP_REWARDS */).bind(commonAdapter));
24009
24297
  return vaultSettings;
24010
24298
  }
24011
- var _riskFactor4 = [
24299
+ var _riskFactor3 = [
24012
24300
  { type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25, reason: "Audited by Zellic" },
24013
24301
  { type: "Liquidation Risk" /* LIQUIDATION_RISK */, value: 1.5, weight: 50, reason: "Liquidation risk is mitigated by stable price feed on Starknet" },
24014
24302
  { type: "Technical Risk" /* TECHNICAL_RISK */, value: 1, weight: 50, reason: "Technical failures like risk monitoring failures" }
@@ -24212,9 +24500,9 @@ var UniversalStrategies = [
24212
24500
  depositTokens: [Global.getDefaultTokens().find((token) => token.symbol === "USDC")],
24213
24501
  additionalInfo: getLooperSettings("USDC", "ETH", usdcVaultSettings, VesuPools.Genesis, VesuPools.Genesis),
24214
24502
  risk: {
24215
- riskFactor: _riskFactor4,
24216
- netRisk: _riskFactor4.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor4.reduce((acc, curr) => acc + curr.weight, 0),
24217
- notARisks: getNoRiskTags(_riskFactor4)
24503
+ riskFactor: _riskFactor3,
24504
+ netRisk: _riskFactor3.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor3.reduce((acc, curr) => acc + curr.weight, 0),
24505
+ notARisks: getNoRiskTags(_riskFactor3)
24218
24506
  },
24219
24507
  protocols: [Protocols.VESU],
24220
24508
  maxTVL: Web3Number.fromWei(0, 6),
@@ -24231,9 +24519,9 @@ var UniversalStrategies = [
24231
24519
  depositTokens: [Global.getDefaultTokens().find((token) => token.symbol === "WBTC")],
24232
24520
  additionalInfo: getLooperSettings("WBTC", "ETH", wbtcVaultSettings, VesuPools.Genesis, VesuPools.Genesis),
24233
24521
  risk: {
24234
- riskFactor: _riskFactor4,
24235
- netRisk: _riskFactor4.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor4.reduce((acc, curr) => acc + curr.weight, 0),
24236
- notARisks: getNoRiskTags(_riskFactor4)
24522
+ riskFactor: _riskFactor3,
24523
+ netRisk: _riskFactor3.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor3.reduce((acc, curr) => acc + curr.weight, 0),
24524
+ notARisks: getNoRiskTags(_riskFactor3)
24237
24525
  },
24238
24526
  protocols: [Protocols.VESU],
24239
24527
  maxTVL: Web3Number.fromWei(0, 8),
@@ -24250,9 +24538,9 @@ var UniversalStrategies = [
24250
24538
  depositTokens: [Global.getDefaultTokens().find((token) => token.symbol === "ETH")],
24251
24539
  additionalInfo: getLooperSettings("ETH", "WBTC", ethVaultSettings, VesuPools.Genesis, VesuPools.Genesis),
24252
24540
  risk: {
24253
- riskFactor: _riskFactor4,
24254
- netRisk: _riskFactor4.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor4.reduce((acc, curr) => acc + curr.weight, 0),
24255
- notARisks: getNoRiskTags(_riskFactor4)
24541
+ riskFactor: _riskFactor3,
24542
+ netRisk: _riskFactor3.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor3.reduce((acc, curr) => acc + curr.weight, 0),
24543
+ notARisks: getNoRiskTags(_riskFactor3)
24256
24544
  },
24257
24545
  protocols: [Protocols.VESU],
24258
24546
  maxTVL: Web3Number.fromWei(0, 18),
@@ -24269,9 +24557,9 @@ var UniversalStrategies = [
24269
24557
  depositTokens: [Global.getDefaultTokens().find((token) => token.symbol === "STRK")],
24270
24558
  additionalInfo: getLooperSettings("STRK", "ETH", strkVaultSettings, VesuPools.Genesis, VesuPools.Genesis),
24271
24559
  risk: {
24272
- riskFactor: _riskFactor4,
24273
- netRisk: _riskFactor4.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor4.reduce((acc, curr) => acc + curr.weight, 0),
24274
- notARisks: getNoRiskTags(_riskFactor4)
24560
+ riskFactor: _riskFactor3,
24561
+ netRisk: _riskFactor3.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor3.reduce((acc, curr) => acc + curr.weight, 0),
24562
+ notARisks: getNoRiskTags(_riskFactor3)
24275
24563
  },
24276
24564
  protocols: [Protocols.VESU],
24277
24565
  maxTVL: Web3Number.fromWei(0, 18),
@@ -24288,9 +24576,9 @@ var UniversalStrategies = [
24288
24576
  depositTokens: [Global.getDefaultTokens().find((token) => token.symbol === "USDT")],
24289
24577
  additionalInfo: getLooperSettings("USDT", "ETH", usdtVaultSettings, VesuPools.Genesis, VesuPools.Genesis),
24290
24578
  risk: {
24291
- riskFactor: _riskFactor4,
24292
- netRisk: _riskFactor4.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor4.reduce((acc, curr) => acc + curr.weight, 0),
24293
- notARisks: getNoRiskTags(_riskFactor4)
24579
+ riskFactor: _riskFactor3,
24580
+ netRisk: _riskFactor3.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor3.reduce((acc, curr) => acc + curr.weight, 0),
24581
+ notARisks: getNoRiskTags(_riskFactor3)
24294
24582
  },
24295
24583
  protocols: [Protocols.VESU],
24296
24584
  maxTVL: Web3Number.fromWei(0, 6),
@@ -24306,11 +24594,9 @@ var TelegramNotif = class {
24306
24594
  constructor(token, shouldPoll) {
24307
24595
  this.subscribers = [
24308
24596
  // '6820228303',
24309
- "1505578076",
24310
- "1356705582",
24311
- // langs
24312
- "1388729514",
24313
- // hwashere
24597
+ // '1505578076',
24598
+ // '1356705582', // langs
24599
+ // '1388729514', // hwashere
24314
24600
  "985902592"
24315
24601
  ];
24316
24602
  this.bot = new import_node_telegram_bot_api.default(token, { polling: shouldPoll });