@strkfarm/sdk 1.1.37 → 1.1.39
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 +12 -12
- package/dist/index.browser.mjs +12 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/index.mjs +12 -12
- package/package.json +1 -1
- package/src/strategies/universal-lst-muliplier-strategy.tsx +9 -6
- package/src/strategies/universal-strategy.tsx +5 -6
|
@@ -93328,9 +93328,12 @@ spurious results.`);
|
|
|
93328
93328
|
rewardAPYs.push(0);
|
|
93329
93329
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
93330
93330
|
weights.push(unusedBalanceAPY.weight);
|
|
93331
|
-
|
|
93331
|
+
const prevAUM = await this.getPrevAUM();
|
|
93332
|
+
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
93333
|
+
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
93334
|
+
return this.returnNetAPY(baseAPYs, rewardAPYs, weights, prevAUMUSD);
|
|
93332
93335
|
}
|
|
93333
|
-
async returnNetAPY(baseAPYs, rewardAPYs, weights) {
|
|
93336
|
+
async returnNetAPY(baseAPYs, rewardAPYs, weights, prevAUMUSD) {
|
|
93334
93337
|
if (weights.every((p) => p == 0)) {
|
|
93335
93338
|
return { net: 0, splits: [{
|
|
93336
93339
|
apy: 0,
|
|
@@ -93340,9 +93343,6 @@ spurious results.`);
|
|
|
93340
93343
|
id: "defispring"
|
|
93341
93344
|
}] };
|
|
93342
93345
|
}
|
|
93343
|
-
const prevAUM = await this.getPrevAUM();
|
|
93344
|
-
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
93345
|
-
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
93346
93346
|
const baseAPY = this.computeAPY(baseAPYs, weights, prevAUMUSD);
|
|
93347
93347
|
const rewardAPY = this.computeAPY(rewardAPYs, weights, prevAUMUSD);
|
|
93348
93348
|
const netAPY = baseAPY + rewardAPY;
|
|
@@ -94492,13 +94492,16 @@ spurious results.`);
|
|
|
94492
94492
|
const maxNewDeposits = await this.maxNewDeposits();
|
|
94493
94493
|
const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
|
|
94494
94494
|
if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
|
|
94495
|
+
logger2.verbose(`${this.getTag()}::netAPY: unused balance is > max servicable from loan, lstAPY: ${lstAPY}`);
|
|
94495
94496
|
const output = await super.netAPY();
|
|
94496
94497
|
output.splits.push({ apy: lstAPY, id: "lst_apy" });
|
|
94497
94498
|
return output;
|
|
94498
94499
|
} else {
|
|
94500
|
+
logger2.verbose(`${this.getTag()}::netAPY: we can take more deposits, use theoretical max APY`);
|
|
94499
94501
|
const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
|
|
94500
94502
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
94501
|
-
const
|
|
94503
|
+
const aum = weights.reduce((acc, curr) => acc + curr, 0);
|
|
94504
|
+
const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights, new Web3Number(aum.toFixed(9), this.getLSTUnderlyingTokenInfo().decimals));
|
|
94502
94505
|
output.splits.push({ apy: lstAPY, id: "lst_apy" });
|
|
94503
94506
|
return output;
|
|
94504
94507
|
}
|
|
@@ -94673,6 +94676,7 @@ spurious results.`);
|
|
|
94673
94676
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: [
|
|
94674
94677
|
"This vault uses Vesu for lending and borrowing. The oracle used by this pool is a ",
|
|
94675
94678
|
highlightTextWithLinks("conversion rate oracle", [{ highlight: "conversion rate oracle", link: "https://docs.pragma.build/starknet/development#conversion-rate" }]),
|
|
94679
|
+
" ",
|
|
94676
94680
|
"which is resilient to liquidity issues and price volatility, hence reducing the risk of liquidation. However, overtime, if left un-monitored, debt can increase enough to trigger a liquidation. But no worries, our continuous monitoring systems look for situations with reduced health factor and balance collateral/debt to bring it back to safe levels. With Troves, you can have a peaceful sleep."
|
|
94677
94681
|
] }),
|
|
94678
94682
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
@@ -94683,11 +94687,7 @@ spurious results.`);
|
|
|
94683
94687
|
] }) }),
|
|
94684
94688
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
94685
94689
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "Debt limits:" }),
|
|
94686
|
-
" Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors."
|
|
94687
|
-
] }) }),
|
|
94688
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
94689
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "APY assumptions:" }),
|
|
94690
|
-
" APY shown is the max possible value given current LST and borrowing rates. True APY will be subject to the actual leverage, based on above point. More insights on exact APY will be added soon."
|
|
94690
|
+
" Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors. There is no additional fee taken by Troves on LST APY, its only on added gain."
|
|
94691
94691
|
] }) })
|
|
94692
94692
|
] });
|
|
94693
94693
|
}
|
|
@@ -94888,7 +94888,7 @@ spurious results.`);
|
|
|
94888
94888
|
faqs: getFAQs2(lstSymbol, underlyingSymbol),
|
|
94889
94889
|
investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
|
|
94890
94890
|
isPreview,
|
|
94891
|
-
apyMethodology: "Current annualized APY in terms of base asset of the LST"
|
|
94891
|
+
apyMethodology: "Current annualized APY in terms of base asset of the LST. There is no additional fee taken by Troves on LST APY. We charge a 10% performance fee on the additional gain which is already accounted in the APY shown."
|
|
94892
94892
|
};
|
|
94893
94893
|
}
|
|
94894
94894
|
var HyperLSTStrategies = [
|
package/dist/index.browser.mjs
CHANGED
|
@@ -29421,9 +29421,12 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
|
|
|
29421
29421
|
rewardAPYs.push(0);
|
|
29422
29422
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
29423
29423
|
weights.push(unusedBalanceAPY.weight);
|
|
29424
|
-
|
|
29424
|
+
const prevAUM = await this.getPrevAUM();
|
|
29425
|
+
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
29426
|
+
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
29427
|
+
return this.returnNetAPY(baseAPYs, rewardAPYs, weights, prevAUMUSD);
|
|
29425
29428
|
}
|
|
29426
|
-
async returnNetAPY(baseAPYs, rewardAPYs, weights) {
|
|
29429
|
+
async returnNetAPY(baseAPYs, rewardAPYs, weights, prevAUMUSD) {
|
|
29427
29430
|
if (weights.every((p) => p == 0)) {
|
|
29428
29431
|
return { net: 0, splits: [{
|
|
29429
29432
|
apy: 0,
|
|
@@ -29433,9 +29436,6 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
|
|
|
29433
29436
|
id: "defispring"
|
|
29434
29437
|
}] };
|
|
29435
29438
|
}
|
|
29436
|
-
const prevAUM = await this.getPrevAUM();
|
|
29437
|
-
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
29438
|
-
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
29439
29439
|
const baseAPY = this.computeAPY(baseAPYs, weights, prevAUMUSD);
|
|
29440
29440
|
const rewardAPY = this.computeAPY(rewardAPYs, weights, prevAUMUSD);
|
|
29441
29441
|
const netAPY = baseAPY + rewardAPY;
|
|
@@ -30586,13 +30586,16 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
|
|
|
30586
30586
|
const maxNewDeposits = await this.maxNewDeposits();
|
|
30587
30587
|
const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
|
|
30588
30588
|
if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
|
|
30589
|
+
logger.verbose(`${this.getTag()}::netAPY: unused balance is > max servicable from loan, lstAPY: ${lstAPY}`);
|
|
30589
30590
|
const output = await super.netAPY();
|
|
30590
30591
|
output.splits.push({ apy: lstAPY, id: "lst_apy" });
|
|
30591
30592
|
return output;
|
|
30592
30593
|
} else {
|
|
30594
|
+
logger.verbose(`${this.getTag()}::netAPY: we can take more deposits, use theoretical max APY`);
|
|
30593
30595
|
const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
|
|
30594
30596
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
30595
|
-
const
|
|
30597
|
+
const aum = weights.reduce((acc, curr) => acc + curr, 0);
|
|
30598
|
+
const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights, new Web3Number(aum.toFixed(9), this.getLSTUnderlyingTokenInfo().decimals));
|
|
30596
30599
|
output.splits.push({ apy: lstAPY, id: "lst_apy" });
|
|
30597
30600
|
return output;
|
|
30598
30601
|
}
|
|
@@ -30767,6 +30770,7 @@ function VaultDescription(lstSymbol, underlyingSymbol) {
|
|
|
30767
30770
|
/* @__PURE__ */ jsxs4("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: [
|
|
30768
30771
|
"This vault uses Vesu for lending and borrowing. The oracle used by this pool is a ",
|
|
30769
30772
|
highlightTextWithLinks("conversion rate oracle", [{ highlight: "conversion rate oracle", link: "https://docs.pragma.build/starknet/development#conversion-rate" }]),
|
|
30773
|
+
" ",
|
|
30770
30774
|
"which is resilient to liquidity issues and price volatility, hence reducing the risk of liquidation. However, overtime, if left un-monitored, debt can increase enough to trigger a liquidation. But no worries, our continuous monitoring systems look for situations with reduced health factor and balance collateral/debt to bring it back to safe levels. With Troves, you can have a peaceful sleep."
|
|
30771
30775
|
] }),
|
|
30772
30776
|
/* @__PURE__ */ jsx5("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ jsxs4("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
@@ -30777,11 +30781,7 @@ function VaultDescription(lstSymbol, underlyingSymbol) {
|
|
|
30777
30781
|
] }) }),
|
|
30778
30782
|
/* @__PURE__ */ jsx5("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ jsxs4("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
30779
30783
|
/* @__PURE__ */ jsx5("strong", { children: "Debt limits:" }),
|
|
30780
|
-
" Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors."
|
|
30781
|
-
] }) }),
|
|
30782
|
-
/* @__PURE__ */ jsx5("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ jsxs4("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
30783
|
-
/* @__PURE__ */ jsx5("strong", { children: "APY assumptions:" }),
|
|
30784
|
-
" APY shown is the max possible value given current LST and borrowing rates. True APY will be subject to the actual leverage, based on above point. More insights on exact APY will be added soon."
|
|
30784
|
+
" Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors. There is no additional fee taken by Troves on LST APY, its only on added gain."
|
|
30785
30785
|
] }) })
|
|
30786
30786
|
] });
|
|
30787
30787
|
}
|
|
@@ -30982,7 +30982,7 @@ function getStrategySettings(lstSymbol, underlyingSymbol, addresses, isPreview =
|
|
|
30982
30982
|
faqs: getFAQs2(lstSymbol, underlyingSymbol),
|
|
30983
30983
|
investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
|
|
30984
30984
|
isPreview,
|
|
30985
|
-
apyMethodology: "Current annualized APY in terms of base asset of the LST"
|
|
30985
|
+
apyMethodology: "Current annualized APY in terms of base asset of the LST. There is no additional fee taken by Troves on LST APY. We charge a 10% performance fee on the additional gain which is already accounted in the APY shown."
|
|
30986
30986
|
};
|
|
30987
30987
|
}
|
|
30988
30988
|
var HyperLSTStrategies = [
|
package/dist/index.d.ts
CHANGED
|
@@ -1226,7 +1226,7 @@ declare class UniversalStrategy<S extends UniversalStrategySettings> extends Bas
|
|
|
1226
1226
|
id: string;
|
|
1227
1227
|
}[];
|
|
1228
1228
|
}>;
|
|
1229
|
-
protected returnNetAPY(baseAPYs: number[], rewardAPYs: number[], weights: number[]): Promise<{
|
|
1229
|
+
protected returnNetAPY(baseAPYs: number[], rewardAPYs: number[], weights: number[], prevAUMUSD: Web3Number): Promise<{
|
|
1230
1230
|
net: number;
|
|
1231
1231
|
splits: {
|
|
1232
1232
|
apy: number;
|
package/dist/index.js
CHANGED
|
@@ -29420,9 +29420,12 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
|
|
|
29420
29420
|
rewardAPYs.push(0);
|
|
29421
29421
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
29422
29422
|
weights.push(unusedBalanceAPY.weight);
|
|
29423
|
-
|
|
29423
|
+
const prevAUM = await this.getPrevAUM();
|
|
29424
|
+
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
29425
|
+
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
29426
|
+
return this.returnNetAPY(baseAPYs, rewardAPYs, weights, prevAUMUSD);
|
|
29424
29427
|
}
|
|
29425
|
-
async returnNetAPY(baseAPYs, rewardAPYs, weights) {
|
|
29428
|
+
async returnNetAPY(baseAPYs, rewardAPYs, weights, prevAUMUSD) {
|
|
29426
29429
|
if (weights.every((p) => p == 0)) {
|
|
29427
29430
|
return { net: 0, splits: [{
|
|
29428
29431
|
apy: 0,
|
|
@@ -29432,9 +29435,6 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
|
|
|
29432
29435
|
id: "defispring"
|
|
29433
29436
|
}] };
|
|
29434
29437
|
}
|
|
29435
|
-
const prevAUM = await this.getPrevAUM();
|
|
29436
|
-
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
29437
|
-
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
29438
29438
|
const baseAPY = this.computeAPY(baseAPYs, weights, prevAUMUSD);
|
|
29439
29439
|
const rewardAPY = this.computeAPY(rewardAPYs, weights, prevAUMUSD);
|
|
29440
29440
|
const netAPY = baseAPY + rewardAPY;
|
|
@@ -30585,13 +30585,16 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
|
|
|
30585
30585
|
const maxNewDeposits = await this.maxNewDeposits();
|
|
30586
30586
|
const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
|
|
30587
30587
|
if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
|
|
30588
|
+
logger.verbose(`${this.getTag()}::netAPY: unused balance is > max servicable from loan, lstAPY: ${lstAPY}`);
|
|
30588
30589
|
const output = await super.netAPY();
|
|
30589
30590
|
output.splits.push({ apy: lstAPY, id: "lst_apy" });
|
|
30590
30591
|
return output;
|
|
30591
30592
|
} else {
|
|
30593
|
+
logger.verbose(`${this.getTag()}::netAPY: we can take more deposits, use theoretical max APY`);
|
|
30592
30594
|
const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
|
|
30593
30595
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
30594
|
-
const
|
|
30596
|
+
const aum = weights.reduce((acc, curr) => acc + curr, 0);
|
|
30597
|
+
const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights, new Web3Number(aum.toFixed(9), this.getLSTUnderlyingTokenInfo().decimals));
|
|
30595
30598
|
output.splits.push({ apy: lstAPY, id: "lst_apy" });
|
|
30596
30599
|
return output;
|
|
30597
30600
|
}
|
|
@@ -30766,6 +30769,7 @@ function VaultDescription(lstSymbol, underlyingSymbol) {
|
|
|
30766
30769
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: [
|
|
30767
30770
|
"This vault uses Vesu for lending and borrowing. The oracle used by this pool is a ",
|
|
30768
30771
|
highlightTextWithLinks("conversion rate oracle", [{ highlight: "conversion rate oracle", link: "https://docs.pragma.build/starknet/development#conversion-rate" }]),
|
|
30772
|
+
" ",
|
|
30769
30773
|
"which is resilient to liquidity issues and price volatility, hence reducing the risk of liquidation. However, overtime, if left un-monitored, debt can increase enough to trigger a liquidation. But no worries, our continuous monitoring systems look for situations with reduced health factor and balance collateral/debt to bring it back to safe levels. With Troves, you can have a peaceful sleep."
|
|
30770
30774
|
] }),
|
|
30771
30775
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
@@ -30776,11 +30780,7 @@ function VaultDescription(lstSymbol, underlyingSymbol) {
|
|
|
30776
30780
|
] }) }),
|
|
30777
30781
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
30778
30782
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "Debt limits:" }),
|
|
30779
|
-
" Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors."
|
|
30780
|
-
] }) }),
|
|
30781
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
30782
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "APY assumptions:" }),
|
|
30783
|
-
" APY shown is the max possible value given current LST and borrowing rates. True APY will be subject to the actual leverage, based on above point. More insights on exact APY will be added soon."
|
|
30783
|
+
" Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors. There is no additional fee taken by Troves on LST APY, its only on added gain."
|
|
30784
30784
|
] }) })
|
|
30785
30785
|
] });
|
|
30786
30786
|
}
|
|
@@ -30981,7 +30981,7 @@ function getStrategySettings(lstSymbol, underlyingSymbol, addresses, isPreview =
|
|
|
30981
30981
|
faqs: getFAQs2(lstSymbol, underlyingSymbol),
|
|
30982
30982
|
investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
|
|
30983
30983
|
isPreview,
|
|
30984
|
-
apyMethodology: "Current annualized APY in terms of base asset of the LST"
|
|
30984
|
+
apyMethodology: "Current annualized APY in terms of base asset of the LST. There is no additional fee taken by Troves on LST APY. We charge a 10% performance fee on the additional gain which is already accounted in the APY shown."
|
|
30985
30985
|
};
|
|
30986
30986
|
}
|
|
30987
30987
|
var HyperLSTStrategies = [
|
package/dist/index.mjs
CHANGED
|
@@ -29319,9 +29319,12 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
|
|
|
29319
29319
|
rewardAPYs.push(0);
|
|
29320
29320
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
29321
29321
|
weights.push(unusedBalanceAPY.weight);
|
|
29322
|
-
|
|
29322
|
+
const prevAUM = await this.getPrevAUM();
|
|
29323
|
+
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
29324
|
+
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
29325
|
+
return this.returnNetAPY(baseAPYs, rewardAPYs, weights, prevAUMUSD);
|
|
29323
29326
|
}
|
|
29324
|
-
async returnNetAPY(baseAPYs, rewardAPYs, weights) {
|
|
29327
|
+
async returnNetAPY(baseAPYs, rewardAPYs, weights, prevAUMUSD) {
|
|
29325
29328
|
if (weights.every((p) => p == 0)) {
|
|
29326
29329
|
return { net: 0, splits: [{
|
|
29327
29330
|
apy: 0,
|
|
@@ -29331,9 +29334,6 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
|
|
|
29331
29334
|
id: "defispring"
|
|
29332
29335
|
}] };
|
|
29333
29336
|
}
|
|
29334
|
-
const prevAUM = await this.getPrevAUM();
|
|
29335
|
-
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
29336
|
-
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
29337
29337
|
const baseAPY = this.computeAPY(baseAPYs, weights, prevAUMUSD);
|
|
29338
29338
|
const rewardAPY = this.computeAPY(rewardAPYs, weights, prevAUMUSD);
|
|
29339
29339
|
const netAPY = baseAPY + rewardAPY;
|
|
@@ -30484,13 +30484,16 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
|
|
|
30484
30484
|
const maxNewDeposits = await this.maxNewDeposits();
|
|
30485
30485
|
const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
|
|
30486
30486
|
if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
|
|
30487
|
+
logger.verbose(`${this.getTag()}::netAPY: unused balance is > max servicable from loan, lstAPY: ${lstAPY}`);
|
|
30487
30488
|
const output = await super.netAPY();
|
|
30488
30489
|
output.splits.push({ apy: lstAPY, id: "lst_apy" });
|
|
30489
30490
|
return output;
|
|
30490
30491
|
} else {
|
|
30492
|
+
logger.verbose(`${this.getTag()}::netAPY: we can take more deposits, use theoretical max APY`);
|
|
30491
30493
|
const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
|
|
30492
30494
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
30493
|
-
const
|
|
30495
|
+
const aum = weights.reduce((acc, curr) => acc + curr, 0);
|
|
30496
|
+
const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights, new Web3Number(aum.toFixed(9), this.getLSTUnderlyingTokenInfo().decimals));
|
|
30494
30497
|
output.splits.push({ apy: lstAPY, id: "lst_apy" });
|
|
30495
30498
|
return output;
|
|
30496
30499
|
}
|
|
@@ -30665,6 +30668,7 @@ function VaultDescription(lstSymbol, underlyingSymbol) {
|
|
|
30665
30668
|
/* @__PURE__ */ jsxs4("p", { style: { fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }, children: [
|
|
30666
30669
|
"This vault uses Vesu for lending and borrowing. The oracle used by this pool is a ",
|
|
30667
30670
|
highlightTextWithLinks("conversion rate oracle", [{ highlight: "conversion rate oracle", link: "https://docs.pragma.build/starknet/development#conversion-rate" }]),
|
|
30671
|
+
" ",
|
|
30668
30672
|
"which is resilient to liquidity issues and price volatility, hence reducing the risk of liquidation. However, overtime, if left un-monitored, debt can increase enough to trigger a liquidation. But no worries, our continuous monitoring systems look for situations with reduced health factor and balance collateral/debt to bring it back to safe levels. With Troves, you can have a peaceful sleep."
|
|
30669
30673
|
] }),
|
|
30670
30674
|
/* @__PURE__ */ jsx5("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ jsxs4("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
@@ -30675,11 +30679,7 @@ function VaultDescription(lstSymbol, underlyingSymbol) {
|
|
|
30675
30679
|
] }) }),
|
|
30676
30680
|
/* @__PURE__ */ jsx5("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ jsxs4("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
30677
30681
|
/* @__PURE__ */ jsx5("strong", { children: "Debt limits:" }),
|
|
30678
|
-
" Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors."
|
|
30679
|
-
] }) }),
|
|
30680
|
-
/* @__PURE__ */ jsx5("div", { style: { backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }, children: /* @__PURE__ */ jsxs4("p", { style: { fontSize: "13px", color: "#ccc" }, children: [
|
|
30681
|
-
/* @__PURE__ */ jsx5("strong", { children: "APY assumptions:" }),
|
|
30682
|
-
" APY shown is the max possible value given current LST and borrowing rates. True APY will be subject to the actual leverage, based on above point. More insights on exact APY will be added soon."
|
|
30682
|
+
" Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors. There is no additional fee taken by Troves on LST APY, its only on added gain."
|
|
30683
30683
|
] }) })
|
|
30684
30684
|
] });
|
|
30685
30685
|
}
|
|
@@ -30880,7 +30880,7 @@ function getStrategySettings(lstSymbol, underlyingSymbol, addresses, isPreview =
|
|
|
30880
30880
|
faqs: getFAQs2(lstSymbol, underlyingSymbol),
|
|
30881
30881
|
investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
|
|
30882
30882
|
isPreview,
|
|
30883
|
-
apyMethodology: "Current annualized APY in terms of base asset of the LST"
|
|
30883
|
+
apyMethodology: "Current annualized APY in terms of base asset of the LST. There is no additional fee taken by Troves on LST APY. We charge a 10% performance fee on the additional gain which is already accounted in the APY shown."
|
|
30884
30884
|
};
|
|
30885
30885
|
}
|
|
30886
30886
|
var HyperLSTStrategies = [
|
package/package.json
CHANGED
|
@@ -466,14 +466,17 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
|
|
|
466
466
|
// we also allow accepting little higher deposits (1.5x) to have room for future looping when theres more liquidity or debt cap rises
|
|
467
467
|
if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
|
|
468
468
|
// we have excess, just use real APY
|
|
469
|
+
logger.verbose(`${this.getTag()}::netAPY: unused balance is > max servicable from loan, lstAPY: ${lstAPY}`);
|
|
469
470
|
const output = await super.netAPY();
|
|
470
471
|
output.splits.push({apy: lstAPY, id: 'lst_apy'});
|
|
471
472
|
return output;
|
|
472
473
|
} else {
|
|
473
474
|
// we have little bit room to accept more deposits, we use theoretical max APY
|
|
475
|
+
logger.verbose(`${this.getTag()}::netAPY: we can take more deposits, use theoretical max APY`);
|
|
474
476
|
const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
|
|
475
477
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
476
|
-
const
|
|
478
|
+
const aum = weights.reduce((acc, curr) => acc + curr, 0);
|
|
479
|
+
const output = await this.returnNetAPY(baseAPYs, rewardAPYs, weights, new Web3Number(aum.toFixed(9), this.getLSTUnderlyingTokenInfo().decimals));
|
|
477
480
|
output.splits.push({apy: lstAPY, id: 'lst_apy'});
|
|
478
481
|
return output;
|
|
479
482
|
}
|
|
@@ -680,7 +683,7 @@ export default function VaultDescription(
|
|
|
680
683
|
|
|
681
684
|
<p style={{ fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }}>
|
|
682
685
|
This vault uses Vesu for lending and borrowing. The oracle used by this pool is a {highlightTextWithLinks("conversion rate oracle", [{highlight: "conversion rate oracle", link: "https://docs.pragma.build/starknet/development#conversion-rate"}])}
|
|
683
|
-
which is resilient to liquidity issues and price volatility, hence reducing the risk of liquidation. However, overtime, if left un-monitored, debt can increase enough to trigger a liquidation. But no worries, our continuous monitoring systems look for situations with reduced health factor and balance collateral/debt to bring it back to safe levels. With Troves, you can have a peaceful sleep.
|
|
686
|
+
{" "}which is resilient to liquidity issues and price volatility, hence reducing the risk of liquidation. However, overtime, if left un-monitored, debt can increase enough to trigger a liquidation. But no worries, our continuous monitoring systems look for situations with reduced health factor and balance collateral/debt to bring it back to safe levels. With Troves, you can have a peaceful sleep.
|
|
684
687
|
</p>
|
|
685
688
|
|
|
686
689
|
<div style={{ backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }}>
|
|
@@ -690,14 +693,14 @@ export default function VaultDescription(
|
|
|
690
693
|
</div>
|
|
691
694
|
<div style={{ backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }}>
|
|
692
695
|
<p style={{ fontSize: "13px", color: "#ccc" }}>
|
|
693
|
-
<strong>Debt limits:</strong> Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors.
|
|
696
|
+
<strong>Debt limits:</strong> Pools on Vesu have debt caps that are gradually increased over time. Until caps are raised, deposited LSTs remain in the vault, generating a shared net return for all depositors. There is no additional fee taken by Troves on LST APY, its only on added gain.
|
|
694
697
|
</p>
|
|
695
698
|
</div>
|
|
696
|
-
<div style={{ backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }}>
|
|
699
|
+
{/* <div style={{ backgroundColor: "#222", padding: "10px", borderRadius: "8px", marginBottom: "20px", border: "1px solid #444" }}>
|
|
697
700
|
<p style={{ fontSize: "13px", color: "#ccc" }}>
|
|
698
701
|
<strong>APY assumptions:</strong> APY shown is the max possible value given current LST and borrowing rates. True APY will be subject to the actual leverage, based on above point. More insights on exact APY will be added soon.
|
|
699
702
|
</p>
|
|
700
|
-
</div>
|
|
703
|
+
</div> */}
|
|
701
704
|
</div>
|
|
702
705
|
);
|
|
703
706
|
}
|
|
@@ -949,7 +952,7 @@ function getStrategySettings(lstSymbol: string, underlyingSymbol: string, addres
|
|
|
949
952
|
faqs: getFAQs(lstSymbol, underlyingSymbol),
|
|
950
953
|
investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
|
|
951
954
|
isPreview: isPreview,
|
|
952
|
-
apyMethodology: 'Current annualized APY in terms of base asset of the LST'
|
|
955
|
+
apyMethodology: 'Current annualized APY in terms of base asset of the LST. There is no additional fee taken by Troves on LST APY. We charge a 10% performance fee on the additional gain which is already accounted in the APY shown.'
|
|
953
956
|
}
|
|
954
957
|
}
|
|
955
958
|
|
|
@@ -264,10 +264,13 @@ export class UniversalStrategy<
|
|
|
264
264
|
const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
|
|
265
265
|
weights.push(unusedBalanceAPY.weight);
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
const prevAUM = await this.getPrevAUM();
|
|
268
|
+
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
269
|
+
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
270
|
+
return this.returnNetAPY(baseAPYs, rewardAPYs, weights, prevAUMUSD);
|
|
268
271
|
}
|
|
269
272
|
|
|
270
|
-
protected async returnNetAPY(baseAPYs: number[], rewardAPYs: number[], weights: number[]) {
|
|
273
|
+
protected async returnNetAPY(baseAPYs: number[], rewardAPYs: number[], weights: number[], prevAUMUSD: Web3Number) {
|
|
271
274
|
// If no positions, return 0
|
|
272
275
|
if (weights.every(p => p == 0)) {
|
|
273
276
|
return { net: 0, splits: [{
|
|
@@ -277,10 +280,6 @@ export class UniversalStrategy<
|
|
|
277
280
|
}]};
|
|
278
281
|
}
|
|
279
282
|
|
|
280
|
-
const prevAUM = await this.getPrevAUM();
|
|
281
|
-
|
|
282
|
-
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
283
|
-
const prevAUMUSD = prevAUM.multipliedBy(price.price);
|
|
284
283
|
const baseAPY = this.computeAPY(baseAPYs, weights, prevAUMUSD);
|
|
285
284
|
const rewardAPY = this.computeAPY(rewardAPYs, weights, prevAUMUSD);
|
|
286
285
|
const netAPY = baseAPY + rewardAPY;
|