@strkfarm/sdk 1.1.41 → 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.
- package/dist/index.browser.global.js +23 -5
- package/dist/index.browser.mjs +23 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +23 -5
- package/dist/index.mjs +23 -5
- package/package.json +1 -1
- package/src/strategies/constants.ts +2 -1
- package/src/strategies/ekubo-cl-vault.tsx +23 -5
- package/src/strategies/universal-strategy.tsx +1 -1
|
@@ -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
|
|
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
|
-
|
|
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
|
|
@@ -81031,7 +81049,7 @@ spurious results.`);
|
|
|
81031
81049
|
Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
|
|
81032
81050
|
Global.getDefaultTokens().find((t) => t.symbol === "USDC")
|
|
81033
81051
|
],
|
|
81034
|
-
apyMethodology: "Annualized fee APY, calculated as fees earned in the last
|
|
81052
|
+
apyMethodology: "Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
|
|
81035
81053
|
additionalInfo: {
|
|
81036
81054
|
newBounds: "Managed by Re7",
|
|
81037
81055
|
truePrice: 1,
|
|
@@ -94413,8 +94431,8 @@ spurious results.`);
|
|
|
94413
94431
|
{ address: settings2.vaultAddress, name: "Vault" },
|
|
94414
94432
|
{ address: settings2.manager, name: "Vault Manager" },
|
|
94415
94433
|
{ address: settings2.vaultAllocator, name: "Vault Allocator" },
|
|
94416
|
-
{ address: settings2.redeemRequestNFT, name: "Redeem Request NFT" }
|
|
94417
|
-
{ address:
|
|
94434
|
+
{ address: settings2.redeemRequestNFT, name: "Redeem Request NFT" }
|
|
94435
|
+
// { address: settings.aumOracle, name: "AUM Oracle" },
|
|
94418
94436
|
];
|
|
94419
94437
|
}
|
|
94420
94438
|
var investmentSteps = [
|
package/dist/index.browser.mjs
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
|
@@ -17110,7 +17128,7 @@ var ETHUSDCRe7Strategy = {
|
|
|
17110
17128
|
Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
|
|
17111
17129
|
Global.getDefaultTokens().find((t) => t.symbol === "USDC")
|
|
17112
17130
|
],
|
|
17113
|
-
apyMethodology: "Annualized fee APY, calculated as fees earned in the last
|
|
17131
|
+
apyMethodology: "Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
|
|
17114
17132
|
additionalInfo: {
|
|
17115
17133
|
newBounds: "Managed by Re7",
|
|
17116
17134
|
truePrice: 1,
|
|
@@ -30505,8 +30523,8 @@ function getContractDetails(settings) {
|
|
|
30505
30523
|
{ address: settings.vaultAddress, name: "Vault" },
|
|
30506
30524
|
{ address: settings.manager, name: "Vault Manager" },
|
|
30507
30525
|
{ address: settings.vaultAllocator, name: "Vault Allocator" },
|
|
30508
|
-
{ address: settings.redeemRequestNFT, name: "Redeem Request NFT" }
|
|
30509
|
-
{ address: settings.aumOracle, name: "AUM Oracle" }
|
|
30526
|
+
{ address: settings.redeemRequestNFT, name: "Redeem Request NFT" }
|
|
30527
|
+
// { address: settings.aumOracle, name: "AUM Oracle" },
|
|
30510
30528
|
];
|
|
30511
30529
|
}
|
|
30512
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
|
|
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
|
-
|
|
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
|
|
@@ -17110,7 +17128,7 @@ var ETHUSDCRe7Strategy = {
|
|
|
17110
17128
|
Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
|
|
17111
17129
|
Global.getDefaultTokens().find((t) => t.symbol === "USDC")
|
|
17112
17130
|
],
|
|
17113
|
-
apyMethodology: "Annualized fee APY, calculated as fees earned in the last
|
|
17131
|
+
apyMethodology: "Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
|
|
17114
17132
|
additionalInfo: {
|
|
17115
17133
|
newBounds: "Managed by Re7",
|
|
17116
17134
|
truePrice: 1,
|
|
@@ -30505,8 +30523,8 @@ function getContractDetails(settings) {
|
|
|
30505
30523
|
{ address: settings.vaultAddress, name: "Vault" },
|
|
30506
30524
|
{ address: settings.manager, name: "Vault Manager" },
|
|
30507
30525
|
{ address: settings.vaultAllocator, name: "Vault Allocator" },
|
|
30508
|
-
{ address: settings.redeemRequestNFT, name: "Redeem Request NFT" }
|
|
30509
|
-
{ address: settings.aumOracle, name: "AUM Oracle" }
|
|
30526
|
+
{ address: settings.redeemRequestNFT, name: "Redeem Request NFT" }
|
|
30527
|
+
// { address: settings.aumOracle, name: "AUM Oracle" },
|
|
30510
30528
|
];
|
|
30511
30529
|
}
|
|
30512
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
|
|
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
|
-
|
|
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
|
|
@@ -17008,7 +17026,7 @@ var ETHUSDCRe7Strategy = {
|
|
|
17008
17026
|
Global.getDefaultTokens().find((t) => t.symbol === "ETH"),
|
|
17009
17027
|
Global.getDefaultTokens().find((t) => t.symbol === "USDC")
|
|
17010
17028
|
],
|
|
17011
|
-
apyMethodology: "Annualized fee APY, calculated as fees earned in the last
|
|
17029
|
+
apyMethodology: "Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
|
|
17012
17030
|
additionalInfo: {
|
|
17013
17031
|
newBounds: "Managed by Re7",
|
|
17014
17032
|
truePrice: 1,
|
|
@@ -30403,8 +30421,8 @@ function getContractDetails(settings) {
|
|
|
30403
30421
|
{ address: settings.vaultAddress, name: "Vault" },
|
|
30404
30422
|
{ address: settings.manager, name: "Vault Manager" },
|
|
30405
30423
|
{ address: settings.vaultAllocator, name: "Vault Allocator" },
|
|
30406
|
-
{ address: settings.redeemRequestNFT, name: "Redeem Request NFT" }
|
|
30407
|
-
{ address: settings.aumOracle, name: "AUM Oracle" }
|
|
30424
|
+
{ address: settings.redeemRequestNFT, name: "Redeem Request NFT" }
|
|
30425
|
+
// { address: settings.aumOracle, name: "AUM Oracle" },
|
|
30408
30426
|
];
|
|
30409
30427
|
}
|
|
30410
30428
|
var investmentSteps = [
|
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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) {
|
|
@@ -2182,7 +2200,7 @@ const ETHUSDCRe7Strategy: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
2182
2200
|
Global.getDefaultTokens().find((t) => t.symbol === "USDC")!
|
|
2183
2201
|
],
|
|
2184
2202
|
apyMethodology:
|
|
2185
|
-
"Annualized fee APY, calculated as fees earned in the last
|
|
2203
|
+
"Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
|
|
2186
2204
|
additionalInfo: {
|
|
2187
2205
|
newBounds: "Managed by Re7",
|
|
2188
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
|
|