@strkfarm/sdk 1.1.40 → 1.1.42

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.
@@ -55722,7 +55722,8 @@ ${JSON.stringify(data, null, 2)}`;
55722
55722
  sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
55723
55723
  }];
55724
55724
  var ENDPOINTS = {
55725
- VESU_BASE: "https://proxy.api.troves.fi/vesu-staging"
55725
+ VESU_BASE: "https://proxy.api.troves.fi/vesu",
55726
+ VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
55726
55727
  };
55727
55728
 
55728
55729
  // src/modules/harvests.ts
@@ -79691,7 +79692,24 @@ spurious results.`);
79691
79692
  async feeBasedAPY(timeperiod = "24h") {
79692
79693
  const feeInfo = await this.getFeeHistory(timeperiod);
79693
79694
  const tvlNow = await this.getTVL("latest");
79694
- return feeInfo.summary.usdValue * 365 / tvlNow.usdValue;
79695
+ let days = 356;
79696
+ switch (timeperiod) {
79697
+ case "24h":
79698
+ days = 365;
79699
+ break;
79700
+ case "7d":
79701
+ days = 365 / 7;
79702
+ break;
79703
+ case "30d":
79704
+ days = 365 / 30;
79705
+ break;
79706
+ case "3m":
79707
+ days = 365 / (3 * 30);
79708
+ break;
79709
+ default:
79710
+ throw new Error(`Invalid timeperiod: ${timeperiod}`);
79711
+ }
79712
+ return feeInfo.summary.usdValue * days / tvlNow.usdValue;
79695
79713
  }
79696
79714
  /**
79697
79715
  * Calculates assets before and now in a given token of TVL per share to observe growth
@@ -79711,7 +79729,6 @@ spurious results.`);
79711
79729
  for (let i = len - 1; i >= 0; --i) {
79712
79730
  let record = await this.contract.call("get_rewards_info", [i]);
79713
79731
  logger2.verbose(`${_EkuboCLVault.name}: getHarvestRewardShares: ${i}`);
79714
- console.log(record);
79715
79732
  const block2 = Number(record.block_number);
79716
79733
  if (block2 < fromBlock) {
79717
79734
  return shares;
@@ -79911,16 +79928,10 @@ spurious results.`);
79911
79928
  const sqrtRatio = _EkuboCLVault.div2Power128(
79912
79929
  BigInt(priceInfo.sqrt_ratio.toString())
79913
79930
  );
79914
- console.log(
79915
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
79916
- );
79917
79931
  const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
79918
79932
  const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
79919
79933
  const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
79920
79934
  const tick = priceInfo.tick;
79921
- console.log(
79922
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, price: ${price}, tick: ${tick.mag}, ${tick.sign}`
79923
- );
79924
79935
  return {
79925
79936
  price,
79926
79937
  tick: Number(tick.mag) * (tick.sign ? -1 : 1),
@@ -80749,7 +80760,6 @@ spurious results.`);
80749
80760
  const gas = await acc.estimateInvokeFee(harvestCall);
80750
80761
  return "found";
80751
80762
  } catch (err2) {
80752
- console.error(err2);
80753
80763
  if (err2.message.includes("invalid token0 amount")) {
80754
80764
  return "go_low";
80755
80765
  } else if (err2.message.includes("invalid token1 amount")) {
@@ -81039,7 +81049,7 @@ spurious results.`);
81039
81049
  Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
81040
81050
  Global.getDefaultTokens().find((t) => t.symbol === "USDC")
81041
81051
  ],
81042
- apyMethodology: "Annualized fee APY, calculated as fees earned in the last 24h divided by TVL",
81052
+ apyMethodology: "Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
81043
81053
  additionalInfo: {
81044
81054
  newBounds: "Managed by Re7",
81045
81055
  truePrice: 1,
@@ -94421,8 +94431,8 @@ spurious results.`);
94421
94431
  { address: settings2.vaultAddress, name: "Vault" },
94422
94432
  { address: settings2.manager, name: "Vault Manager" },
94423
94433
  { address: settings2.vaultAllocator, name: "Vault Allocator" },
94424
- { address: settings2.redeemRequestNFT, name: "Redeem Request NFT" },
94425
- { address: settings2.aumOracle, name: "AUM Oracle" }
94434
+ { address: settings2.redeemRequestNFT, name: "Redeem Request NFT" }
94435
+ // { address: settings.aumOracle, name: "AUM Oracle" },
94426
94436
  ];
94427
94437
  }
94428
94438
  var investmentSteps = [
@@ -4124,7 +4124,8 @@ var COMMON_CONTRACTS = [{
4124
4124
  sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
4125
4125
  }];
4126
4126
  var ENDPOINTS = {
4127
- VESU_BASE: "https://proxy.api.troves.fi/vesu-staging"
4127
+ VESU_BASE: "https://proxy.api.troves.fi/vesu",
4128
+ VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
4128
4129
  };
4129
4130
 
4130
4131
  // src/modules/harvests.ts
@@ -15770,7 +15771,24 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15770
15771
  async feeBasedAPY(timeperiod = "24h") {
15771
15772
  const feeInfo = await this.getFeeHistory(timeperiod);
15772
15773
  const tvlNow = await this.getTVL("latest");
15773
- return feeInfo.summary.usdValue * 365 / tvlNow.usdValue;
15774
+ let days = 356;
15775
+ switch (timeperiod) {
15776
+ case "24h":
15777
+ days = 365;
15778
+ break;
15779
+ case "7d":
15780
+ days = 365 / 7;
15781
+ break;
15782
+ case "30d":
15783
+ days = 365 / 30;
15784
+ break;
15785
+ case "3m":
15786
+ days = 365 / (3 * 30);
15787
+ break;
15788
+ default:
15789
+ throw new Error(`Invalid timeperiod: ${timeperiod}`);
15790
+ }
15791
+ return feeInfo.summary.usdValue * days / tvlNow.usdValue;
15774
15792
  }
15775
15793
  /**
15776
15794
  * Calculates assets before and now in a given token of TVL per share to observe growth
@@ -15790,7 +15808,6 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15790
15808
  for (let i = len - 1; i >= 0; --i) {
15791
15809
  let record = await this.contract.call("get_rewards_info", [i]);
15792
15810
  logger.verbose(`${_EkuboCLVault.name}: getHarvestRewardShares: ${i}`);
15793
- console.log(record);
15794
15811
  const block = Number(record.block_number);
15795
15812
  if (block < fromBlock) {
15796
15813
  return shares;
@@ -15990,16 +16007,10 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15990
16007
  const sqrtRatio = _EkuboCLVault.div2Power128(
15991
16008
  BigInt(priceInfo.sqrt_ratio.toString())
15992
16009
  );
15993
- console.log(
15994
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
15995
- );
15996
16010
  const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
15997
16011
  const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
15998
16012
  const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
15999
16013
  const tick = priceInfo.tick;
16000
- console.log(
16001
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, price: ${price}, tick: ${tick.mag}, ${tick.sign}`
16002
- );
16003
16014
  return {
16004
16015
  price,
16005
16016
  tick: Number(tick.mag) * (tick.sign ? -1 : 1),
@@ -16828,7 +16839,6 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
16828
16839
  const gas = await acc.estimateInvokeFee(harvestCall);
16829
16840
  return "found";
16830
16841
  } catch (err) {
16831
- console.error(err);
16832
16842
  if (err.message.includes("invalid token0 amount")) {
16833
16843
  return "go_low";
16834
16844
  } else if (err.message.includes("invalid token1 amount")) {
@@ -17118,7 +17128,7 @@ var ETHUSDCRe7Strategy = {
17118
17128
  Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
17119
17129
  Global.getDefaultTokens().find((t) => t.symbol === "USDC")
17120
17130
  ],
17121
- apyMethodology: "Annualized fee APY, calculated as fees earned in the last 24h divided by TVL",
17131
+ apyMethodology: "Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
17122
17132
  additionalInfo: {
17123
17133
  newBounds: "Managed by Re7",
17124
17134
  truePrice: 1,
@@ -30513,8 +30523,8 @@ function getContractDetails(settings) {
30513
30523
  { address: settings.vaultAddress, name: "Vault" },
30514
30524
  { address: settings.manager, name: "Vault Manager" },
30515
30525
  { address: settings.vaultAllocator, name: "Vault Allocator" },
30516
- { address: settings.redeemRequestNFT, name: "Redeem Request NFT" },
30517
- { address: settings.aumOracle, name: "AUM Oracle" }
30526
+ { address: settings.redeemRequestNFT, name: "Redeem Request NFT" }
30527
+ // { address: settings.aumOracle, name: "AUM Oracle" },
30518
30528
  ];
30519
30529
  }
30520
30530
  var investmentSteps = [
package/dist/index.d.ts CHANGED
@@ -715,17 +715,17 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
715
715
  rebalanceCall(newBounds: EkuboBounds, swapParams: SwapInfo): Call[];
716
716
  handleUnusedCall(swapParams: SwapInfo): Call[];
717
717
  handleFeesCall(): Call[];
718
- getFeeHistory(timePeriod?: '24h' | '30d' | '3m'): Promise<{
718
+ getFeeHistory(timePeriod?: '24h' | '7d' | '30d' | '3m'): Promise<{
719
719
  summary: DualTokenInfo;
720
720
  history: FeeHistory[];
721
721
  }>;
722
722
  netSharesBasedTrueAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
723
- feeBasedAPY(timeperiod?: '24h' | '30d' | '3m'): Promise<number>;
723
+ feeBasedAPY(timeperiod?: '24h' | '7d' | '30d' | '3m'): Promise<number>;
724
724
  /**
725
725
  * Calculates assets before and now in a given token of TVL per share to observe growth
726
726
  * @returns {Promise<number>} The weighted average APY across all pools
727
727
  */
728
- netAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number, timeperiod?: '24h' | '30d' | '3m'): Promise<number>;
728
+ netAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number, timeperiod?: '24h' | '7d' | '30d' | '3m'): Promise<number>;
729
729
  getHarvestRewardShares(fromBlock: number, toBlock: number): Promise<Web3Number>;
730
730
  balanceOf(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<Web3Number>;
731
731
  getUserTVL(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<DualTokenInfo>;
package/dist/index.js CHANGED
@@ -4128,7 +4128,8 @@ var COMMON_CONTRACTS = [{
4128
4128
  sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
4129
4129
  }];
4130
4130
  var ENDPOINTS = {
4131
- VESU_BASE: "https://proxy.api.troves.fi/vesu-staging"
4131
+ VESU_BASE: "https://proxy.api.troves.fi/vesu",
4132
+ VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
4132
4133
  };
4133
4134
 
4134
4135
  // src/modules/harvests.ts
@@ -15770,7 +15771,24 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15770
15771
  async feeBasedAPY(timeperiod = "24h") {
15771
15772
  const feeInfo = await this.getFeeHistory(timeperiod);
15772
15773
  const tvlNow = await this.getTVL("latest");
15773
- return feeInfo.summary.usdValue * 365 / tvlNow.usdValue;
15774
+ let days = 356;
15775
+ switch (timeperiod) {
15776
+ case "24h":
15777
+ days = 365;
15778
+ break;
15779
+ case "7d":
15780
+ days = 365 / 7;
15781
+ break;
15782
+ case "30d":
15783
+ days = 365 / 30;
15784
+ break;
15785
+ case "3m":
15786
+ days = 365 / (3 * 30);
15787
+ break;
15788
+ default:
15789
+ throw new Error(`Invalid timeperiod: ${timeperiod}`);
15790
+ }
15791
+ return feeInfo.summary.usdValue * days / tvlNow.usdValue;
15774
15792
  }
15775
15793
  /**
15776
15794
  * Calculates assets before and now in a given token of TVL per share to observe growth
@@ -15790,7 +15808,6 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15790
15808
  for (let i = len - 1; i >= 0; --i) {
15791
15809
  let record = await this.contract.call("get_rewards_info", [i]);
15792
15810
  logger.verbose(`${_EkuboCLVault.name}: getHarvestRewardShares: ${i}`);
15793
- console.log(record);
15794
15811
  const block = Number(record.block_number);
15795
15812
  if (block < fromBlock) {
15796
15813
  return shares;
@@ -15990,16 +16007,10 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15990
16007
  const sqrtRatio = _EkuboCLVault.div2Power128(
15991
16008
  BigInt(priceInfo.sqrt_ratio.toString())
15992
16009
  );
15993
- console.log(
15994
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
15995
- );
15996
16010
  const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
15997
16011
  const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
15998
16012
  const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
15999
16013
  const tick = priceInfo.tick;
16000
- console.log(
16001
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, price: ${price}, tick: ${tick.mag}, ${tick.sign}`
16002
- );
16003
16014
  return {
16004
16015
  price,
16005
16016
  tick: Number(tick.mag) * (tick.sign ? -1 : 1),
@@ -16828,7 +16839,6 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
16828
16839
  const gas = await acc.estimateInvokeFee(harvestCall);
16829
16840
  return "found";
16830
16841
  } catch (err) {
16831
- console.error(err);
16832
16842
  if (err.message.includes("invalid token0 amount")) {
16833
16843
  return "go_low";
16834
16844
  } else if (err.message.includes("invalid token1 amount")) {
@@ -17118,7 +17128,7 @@ var ETHUSDCRe7Strategy = {
17118
17128
  Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
17119
17129
  Global.getDefaultTokens().find((t) => t.symbol === "USDC")
17120
17130
  ],
17121
- apyMethodology: "Annualized fee APY, calculated as fees earned in the last 24h divided by TVL",
17131
+ apyMethodology: "Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
17122
17132
  additionalInfo: {
17123
17133
  newBounds: "Managed by Re7",
17124
17134
  truePrice: 1,
@@ -30513,8 +30523,8 @@ function getContractDetails(settings) {
30513
30523
  { address: settings.vaultAddress, name: "Vault" },
30514
30524
  { address: settings.manager, name: "Vault Manager" },
30515
30525
  { address: settings.vaultAllocator, name: "Vault Allocator" },
30516
- { address: settings.redeemRequestNFT, name: "Redeem Request NFT" },
30517
- { address: settings.aumOracle, name: "AUM Oracle" }
30526
+ { address: settings.redeemRequestNFT, name: "Redeem Request NFT" }
30527
+ // { address: settings.aumOracle, name: "AUM Oracle" },
30518
30528
  ];
30519
30529
  }
30520
30530
  var investmentSteps = [
package/dist/index.mjs CHANGED
@@ -4022,7 +4022,8 @@ var COMMON_CONTRACTS = [{
4022
4022
  sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
4023
4023
  }];
4024
4024
  var ENDPOINTS = {
4025
- VESU_BASE: "https://proxy.api.troves.fi/vesu-staging"
4025
+ VESU_BASE: "https://proxy.api.troves.fi/vesu",
4026
+ VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
4026
4027
  };
4027
4028
 
4028
4029
  // src/modules/harvests.ts
@@ -15668,7 +15669,24 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15668
15669
  async feeBasedAPY(timeperiod = "24h") {
15669
15670
  const feeInfo = await this.getFeeHistory(timeperiod);
15670
15671
  const tvlNow = await this.getTVL("latest");
15671
- return feeInfo.summary.usdValue * 365 / tvlNow.usdValue;
15672
+ let days = 356;
15673
+ switch (timeperiod) {
15674
+ case "24h":
15675
+ days = 365;
15676
+ break;
15677
+ case "7d":
15678
+ days = 365 / 7;
15679
+ break;
15680
+ case "30d":
15681
+ days = 365 / 30;
15682
+ break;
15683
+ case "3m":
15684
+ days = 365 / (3 * 30);
15685
+ break;
15686
+ default:
15687
+ throw new Error(`Invalid timeperiod: ${timeperiod}`);
15688
+ }
15689
+ return feeInfo.summary.usdValue * days / tvlNow.usdValue;
15672
15690
  }
15673
15691
  /**
15674
15692
  * Calculates assets before and now in a given token of TVL per share to observe growth
@@ -15688,7 +15706,6 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15688
15706
  for (let i = len - 1; i >= 0; --i) {
15689
15707
  let record = await this.contract.call("get_rewards_info", [i]);
15690
15708
  logger.verbose(`${_EkuboCLVault.name}: getHarvestRewardShares: ${i}`);
15691
- console.log(record);
15692
15709
  const block = Number(record.block_number);
15693
15710
  if (block < fromBlock) {
15694
15711
  return shares;
@@ -15888,16 +15905,10 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15888
15905
  const sqrtRatio = _EkuboCLVault.div2Power128(
15889
15906
  BigInt(priceInfo.sqrt_ratio.toString())
15890
15907
  );
15891
- console.log(
15892
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
15893
- );
15894
15908
  const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
15895
15909
  const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
15896
15910
  const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
15897
15911
  const tick = priceInfo.tick;
15898
- console.log(
15899
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, price: ${price}, tick: ${tick.mag}, ${tick.sign}`
15900
- );
15901
15912
  return {
15902
15913
  price,
15903
15914
  tick: Number(tick.mag) * (tick.sign ? -1 : 1),
@@ -16726,7 +16737,6 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
16726
16737
  const gas = await acc.estimateInvokeFee(harvestCall);
16727
16738
  return "found";
16728
16739
  } catch (err) {
16729
- console.error(err);
16730
16740
  if (err.message.includes("invalid token0 amount")) {
16731
16741
  return "go_low";
16732
16742
  } else if (err.message.includes("invalid token1 amount")) {
@@ -17016,7 +17026,7 @@ var ETHUSDCRe7Strategy = {
17016
17026
  Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
17017
17027
  Global.getDefaultTokens().find((t) => t.symbol === "USDC")
17018
17028
  ],
17019
- apyMethodology: "Annualized fee APY, calculated as fees earned in the last 24h divided by TVL",
17029
+ apyMethodology: "Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
17020
17030
  additionalInfo: {
17021
17031
  newBounds: "Managed by Re7",
17022
17032
  truePrice: 1,
@@ -30411,8 +30421,8 @@ function getContractDetails(settings) {
30411
30421
  { address: settings.vaultAddress, name: "Vault" },
30412
30422
  { address: settings.manager, name: "Vault Manager" },
30413
30423
  { address: settings.vaultAllocator, name: "Vault Allocator" },
30414
- { address: settings.redeemRequestNFT, name: "Redeem Request NFT" },
30415
- { address: settings.aumOracle, name: "AUM Oracle" }
30424
+ { address: settings.redeemRequestNFT, name: "Redeem Request NFT" }
30425
+ // { address: settings.aumOracle, name: "AUM Oracle" },
30416
30426
  ];
30417
30427
  }
30418
30428
  var investmentSteps = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strkfarm/sdk",
3
- "version": "1.1.40",
3
+ "version": "1.1.42",
4
4
  "description": "STRKFarm TS SDK (Meant for our internal use, but feel free to use it)",
5
5
  "typings": "dist/index.d.ts",
6
6
  "types": "dist/index.d.ts",
@@ -7,5 +7,6 @@ export const COMMON_CONTRACTS = [{
7
7
  }];
8
8
 
9
9
  export const ENDPOINTS = {
10
- VESU_BASE: "https://proxy.api.troves.fi/vesu-staging"
10
+ VESU_BASE: "https://proxy.api.troves.fi/vesu",
11
+ VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
11
12
  }
@@ -294,7 +294,7 @@ export class EkuboCLVault extends BaseStrategy<
294
294
  return [this.contract.populate("handle_fees", [])];
295
295
  }
296
296
 
297
- async getFeeHistory(timePeriod: '24h' | '30d' | '3m' = '24h'): Promise<{
297
+ async getFeeHistory(timePeriod: '24h' | '7d' | '30d' | '3m' = '24h'): Promise<{
298
298
  summary: DualTokenInfo,
299
299
  history: FeeHistory[]
300
300
  }> {
@@ -450,11 +450,29 @@ export class EkuboCLVault extends BaseStrategy<
450
450
  }
451
451
 
452
452
  async feeBasedAPY(
453
- timeperiod: '24h' | '30d' | '3m' = '24h'
453
+ timeperiod: '24h' | '7d' | '30d' | '3m' = '24h'
454
454
  ): Promise<number> {
455
455
  const feeInfo = await this.getFeeHistory(timeperiod);
456
456
  const tvlNow = await this.getTVL('latest');
457
- return feeInfo.summary.usdValue * 365 / tvlNow.usdValue;
457
+
458
+ let days = 356;
459
+ switch (timeperiod) {
460
+ case '24h':
461
+ days = 365;
462
+ break;
463
+ case '7d':
464
+ days = 365 / 7;
465
+ break;
466
+ case '30d':
467
+ days = 365 / 30;
468
+ break;
469
+ case '3m':
470
+ days = 365 / (3 * 30);
471
+ break;
472
+ default:
473
+ throw new Error(`Invalid timeperiod: ${timeperiod}`);
474
+ }
475
+ return feeInfo.summary.usdValue * days / tvlNow.usdValue;
458
476
  }
459
477
 
460
478
  /**
@@ -464,7 +482,7 @@ export class EkuboCLVault extends BaseStrategy<
464
482
  async netAPY(
465
483
  blockIdentifier: BlockIdentifier = "latest",
466
484
  sinceBlocks = 600000,
467
- timeperiod: '24h' | '30d' | '3m' = '24h' // temp thing for fee based APY
485
+ timeperiod: '24h' | '7d' | '30d' | '3m' = '24h' // temp thing for fee based APY
468
486
  ): Promise<number> {
469
487
  const isUSDCQouteToken = this.metadata.additionalInfo.quoteAsset.symbol === "USDC";
470
488
  if (!isUSDCQouteToken) {
@@ -482,7 +500,6 @@ export class EkuboCLVault extends BaseStrategy<
482
500
  for (let i = len - 1; i >= 0; --i) {
483
501
  let record: any = await this.contract.call("get_rewards_info", [i]);
484
502
  logger.verbose(`${EkuboCLVault.name}: getHarvestRewardShares: ${i}`);
485
- console.log(record);
486
503
  const block = Number(record.block_number);
487
504
  if (block < fromBlock) {
488
505
  return shares;
@@ -714,16 +731,10 @@ export class EkuboCLVault extends BaseStrategy<
714
731
  const sqrtRatio = EkuboCLVault.div2Power128(
715
732
  BigInt(priceInfo.sqrt_ratio.toString())
716
733
  );
717
- console.log(
718
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
719
- );
720
734
  const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
721
735
  const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
722
736
  const price = sqrtRatio * sqrtRatio * (10 ** token0Info.decimals) / ( 10 ** token1Info.decimals);
723
737
  const tick = priceInfo.tick;
724
- console.log(
725
- `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, price: ${price}, tick: ${tick.mag}, ${tick.sign}`
726
- );
727
738
  return {
728
739
  price,
729
740
  tick: Number(tick.mag) * (tick.sign ? -1 : 1),
@@ -1851,7 +1862,6 @@ export class EkuboCLVault extends BaseStrategy<
1851
1862
  const gas = await acc.estimateInvokeFee(harvestCall);
1852
1863
  return 'found';
1853
1864
  } catch (err: any) {
1854
- console.error(err);
1855
1865
  if (err.message.includes('invalid token0 amount')) {
1856
1866
  // too much token0 amount left, may be swap less to token0
1857
1867
  return 'go_low';
@@ -2190,7 +2200,7 @@ const ETHUSDCRe7Strategy: IStrategyMetadata<CLVaultStrategySettings> = {
2190
2200
  Global.getDefaultTokens().find((t) => t.symbol === "USDC")!
2191
2201
  ],
2192
2202
  apyMethodology:
2193
- "Annualized fee APY, calculated as fees earned in the last 24h divided by TVL",
2203
+ "Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
2194
2204
  additionalInfo: {
2195
2205
  newBounds: "Managed by Re7",
2196
2206
  truePrice: 1,
@@ -1121,7 +1121,7 @@ export function getContractDetails(settings: UniversalStrategySettings): {addres
1121
1121
  { address: settings.manager, name: "Vault Manager" },
1122
1122
  { address: settings.vaultAllocator, name: "Vault Allocator" },
1123
1123
  { address: settings.redeemRequestNFT, name: "Redeem Request NFT" },
1124
- { address: settings.aumOracle, name: "AUM Oracle" },
1124
+ // { address: settings.aumOracle, name: "AUM Oracle" },
1125
1125
  ];
1126
1126
  }
1127
1127