@strkfarm/sdk 1.0.47 → 1.0.51
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 +161 -128
- package/dist/index.browser.mjs +159 -126
- package/dist/index.d.ts +23 -6
- package/dist/index.js +160 -126
- package/dist/index.mjs +157 -124
- package/package.json +2 -2
- package/src/global.ts +7 -7
- package/src/interfaces/{common.ts → common.tsx} +50 -5
- package/src/modules/pricer-from-api.ts +1 -1
- package/src/strategies/constants.ts +7 -0
- package/src/strategies/ekubo-cl-vault.tsx +93 -109
- package/src/strategies/index.ts +1 -1
- package/src/strategies/vesu-rebalance.tsx +56 -13
package/dist/index.browser.mjs
CHANGED
|
@@ -115,7 +115,7 @@ var FatalError = class extends Error {
|
|
|
115
115
|
var defaultTokens = [{
|
|
116
116
|
name: "Starknet",
|
|
117
117
|
symbol: "STRK",
|
|
118
|
-
logo: "https://assets.
|
|
118
|
+
logo: "https://assets.troves.fi/integrations/tokens/strk.svg",
|
|
119
119
|
address: ContractAddr.from("0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"),
|
|
120
120
|
decimals: 18,
|
|
121
121
|
coingeckId: "starknet",
|
|
@@ -123,7 +123,7 @@ var defaultTokens = [{
|
|
|
123
123
|
}, {
|
|
124
124
|
name: "xSTRK",
|
|
125
125
|
symbol: "xSTRK",
|
|
126
|
-
logo: "https://assets.
|
|
126
|
+
logo: "https://assets.troves.fi/integrations/tokens/xstrk.svg",
|
|
127
127
|
address: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a"),
|
|
128
128
|
decimals: 18,
|
|
129
129
|
coingeckId: void 0,
|
|
@@ -131,7 +131,7 @@ var defaultTokens = [{
|
|
|
131
131
|
}, {
|
|
132
132
|
name: "ETH",
|
|
133
133
|
symbol: "ETH",
|
|
134
|
-
logo: "https://assets.
|
|
134
|
+
logo: "https://assets.troves.fi/integrations/tokens/eth.svg",
|
|
135
135
|
address: ContractAddr.from("0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"),
|
|
136
136
|
decimals: 18,
|
|
137
137
|
coingeckId: void 0,
|
|
@@ -139,7 +139,7 @@ var defaultTokens = [{
|
|
|
139
139
|
}, {
|
|
140
140
|
name: "USDC",
|
|
141
141
|
symbol: "USDC",
|
|
142
|
-
logo: "https://assets.
|
|
142
|
+
logo: "https://assets.troves.fi/integrations/tokens/usdc.svg",
|
|
143
143
|
address: ContractAddr.from("0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"),
|
|
144
144
|
decimals: 6,
|
|
145
145
|
coingeckId: void 0,
|
|
@@ -147,7 +147,7 @@ var defaultTokens = [{
|
|
|
147
147
|
}, {
|
|
148
148
|
name: "USDT",
|
|
149
149
|
symbol: "USDT",
|
|
150
|
-
logo: "https://assets.
|
|
150
|
+
logo: "https://assets.troves.fi/integrations/tokens/usdt.svg",
|
|
151
151
|
address: ContractAddr.from("0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8"),
|
|
152
152
|
decimals: 6,
|
|
153
153
|
coingeckId: void 0,
|
|
@@ -155,7 +155,7 @@ var defaultTokens = [{
|
|
|
155
155
|
}, {
|
|
156
156
|
name: "WBTC",
|
|
157
157
|
symbol: "WBTC",
|
|
158
|
-
logo: "https://assets.
|
|
158
|
+
logo: "https://assets.troves.fi/integrations/tokens/wbtc.svg",
|
|
159
159
|
address: ContractAddr.from("0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac"),
|
|
160
160
|
decimals: 8,
|
|
161
161
|
coingeckId: void 0,
|
|
@@ -179,7 +179,7 @@ var Global = class _Global {
|
|
|
179
179
|
}
|
|
180
180
|
static async getTokens() {
|
|
181
181
|
if (tokens.length) return tokens;
|
|
182
|
-
const data = await axios.get("https://assets.
|
|
182
|
+
const data = await axios.get("https://assets.troves.fi/integrations/tokens.json");
|
|
183
183
|
const tokensData = data.data.content;
|
|
184
184
|
tokensData.forEach((token) => {
|
|
185
185
|
if (!token.tags.includes("AVNU") || !token.tags.includes("Verified")) {
|
|
@@ -714,7 +714,7 @@ var PricerFromApi = class extends PricerBase {
|
|
|
714
714
|
}
|
|
715
715
|
async getPriceFromMyAPI(tokenSymbol) {
|
|
716
716
|
logger.verbose(`getPrice from redis: ${tokenSymbol}`);
|
|
717
|
-
const endpoint = "https://app.
|
|
717
|
+
const endpoint = "https://app.troves.fi";
|
|
718
718
|
const url = `${endpoint}/api/price/${tokenSymbol}`;
|
|
719
719
|
const priceInfoRes = await fetch(url);
|
|
720
720
|
const priceInfo = await priceInfoRes.json();
|
|
@@ -1963,8 +1963,9 @@ var AvnuWrapper = class _AvnuWrapper {
|
|
|
1963
1963
|
}
|
|
1964
1964
|
};
|
|
1965
1965
|
|
|
1966
|
-
// src/interfaces/common.
|
|
1966
|
+
// src/interfaces/common.tsx
|
|
1967
1967
|
import { RpcProvider as RpcProvider2 } from "starknet";
|
|
1968
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
1968
1969
|
var RiskType = /* @__PURE__ */ ((RiskType2) => {
|
|
1969
1970
|
RiskType2["MARKET_RISK"] = "Market Risk";
|
|
1970
1971
|
RiskType2["IMPERMANENT_LOSS"] = "Impermanent Loss Risk";
|
|
@@ -2020,8 +2021,8 @@ var getRiskExplaination = (riskType) => {
|
|
|
2020
2021
|
};
|
|
2021
2022
|
var getRiskColor = (risk) => {
|
|
2022
2023
|
const value = risk.value;
|
|
2023
|
-
if (value
|
|
2024
|
-
if (value <
|
|
2024
|
+
if (value <= 1) return "light_green_2";
|
|
2025
|
+
if (value < 3) return "yellow";
|
|
2025
2026
|
return "red";
|
|
2026
2027
|
};
|
|
2027
2028
|
var getNoRiskTags = (risks) => {
|
|
@@ -2030,8 +2031,20 @@ var getNoRiskTags = (risks) => {
|
|
|
2030
2031
|
(risk) => !risks.map((risk2) => risk2.type).includes(risk)
|
|
2031
2032
|
);
|
|
2032
2033
|
const mergedUnique = [.../* @__PURE__ */ new Set([...noRisks1, ...noRisks2])];
|
|
2033
|
-
return mergedUnique
|
|
2034
|
+
return mergedUnique;
|
|
2034
2035
|
};
|
|
2036
|
+
function highlightTextWithLinks(put, highlights) {
|
|
2037
|
+
const escapeRegExp = (text) => text.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
2038
|
+
const pattern = new RegExp(
|
|
2039
|
+
`(${highlights.map((m) => escapeRegExp(m.highlight)).join("|")})`,
|
|
2040
|
+
"gi"
|
|
2041
|
+
);
|
|
2042
|
+
const parts = put.split(pattern);
|
|
2043
|
+
return /* @__PURE__ */ jsx(Fragment, { children: parts.map((part, i) => {
|
|
2044
|
+
const match = highlights.find((m) => m.highlight.toLowerCase() === part.toLowerCase());
|
|
2045
|
+
return match ? /* @__PURE__ */ jsx("a", { href: match.link, target: "_blank", style: { color: "var(--chakra-colors-white)", background: "var(--chakra-colors-highlight)" }, children: part }, i) : /* @__PURE__ */ jsx("span", { children: part }, i);
|
|
2046
|
+
}) });
|
|
2047
|
+
}
|
|
2035
2048
|
|
|
2036
2049
|
// src/interfaces/initializable.ts
|
|
2037
2050
|
var Initializable = class {
|
|
@@ -9153,8 +9166,15 @@ var vesu_pools_default = {
|
|
|
9153
9166
|
]
|
|
9154
9167
|
};
|
|
9155
9168
|
|
|
9169
|
+
// src/strategies/constants.ts
|
|
9170
|
+
var COMMON_CONTRACTS = [{
|
|
9171
|
+
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
9172
|
+
name: "Access Controller",
|
|
9173
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
9174
|
+
}];
|
|
9175
|
+
|
|
9156
9176
|
// src/strategies/vesu-rebalance.tsx
|
|
9157
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9177
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
9158
9178
|
var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
9159
9179
|
// 10000 bps = 100%
|
|
9160
9180
|
/**
|
|
@@ -9795,11 +9815,11 @@ var _protocol = {
|
|
|
9795
9815
|
logo: "https://static-assets-8zct.onrender.com/integrations/vesu/logo.png"
|
|
9796
9816
|
};
|
|
9797
9817
|
var _riskFactor = [
|
|
9798
|
-
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 },
|
|
9799
|
-
{ type: "Counterparty Risk" /* COUNTERPARTY_RISK */, value: 1, weight: 50 },
|
|
9800
|
-
{ type: "Oracle Risk" /* ORACLE_RISK */, value: 0.5, weight: 25 }
|
|
9818
|
+
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25, reason: "Audited by CSC" },
|
|
9819
|
+
{ type: "Counterparty Risk" /* COUNTERPARTY_RISK */, value: 1, weight: 50, reason: "Reasonable max LTV ratios and Curated by well-known risk managers like Re7" },
|
|
9820
|
+
{ type: "Oracle Risk" /* ORACLE_RISK */, value: 0.5, weight: 25, reason: "Uses Pragma price feeds, Most reputable price feed on Starknet" }
|
|
9801
9821
|
];
|
|
9802
|
-
var AUDIT_URL = "https://assets.
|
|
9822
|
+
var AUDIT_URL = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
|
|
9803
9823
|
var faqs = [
|
|
9804
9824
|
{
|
|
9805
9825
|
question: "What is the Vesu Rebalancing Strategy?",
|
|
@@ -9837,7 +9857,7 @@ var faqs = [
|
|
|
9837
9857
|
question: "Is the strategy audited?",
|
|
9838
9858
|
answer: /* @__PURE__ */ jsxs("div", { children: [
|
|
9839
9859
|
"Yes, the strategy has been audited. You can review the audit report in our docs ",
|
|
9840
|
-
/* @__PURE__ */
|
|
9860
|
+
/* @__PURE__ */ jsx2("a", { href: "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
|
|
9841
9861
|
"."
|
|
9842
9862
|
] })
|
|
9843
9863
|
}
|
|
@@ -9845,7 +9865,7 @@ var faqs = [
|
|
|
9845
9865
|
var VesuRebalanceStrategies = [
|
|
9846
9866
|
{
|
|
9847
9867
|
name: "Vesu Fusion STRK",
|
|
9848
|
-
description: _description
|
|
9868
|
+
description: _description,
|
|
9849
9869
|
address: ContractAddr.from(
|
|
9850
9870
|
"0x7fb5bcb8525954a60fde4e8fb8220477696ce7117ef264775a1770e23571929"
|
|
9851
9871
|
),
|
|
@@ -9865,7 +9885,9 @@ var VesuRebalanceStrategies = [
|
|
|
9865
9885
|
additionalInfo: {
|
|
9866
9886
|
feeBps: 1e3
|
|
9867
9887
|
},
|
|
9868
|
-
faqs
|
|
9888
|
+
faqs,
|
|
9889
|
+
contractDetails: [],
|
|
9890
|
+
investmentSteps: []
|
|
9869
9891
|
},
|
|
9870
9892
|
{
|
|
9871
9893
|
name: "Vesu Fusion ETH",
|
|
@@ -9889,7 +9911,9 @@ var VesuRebalanceStrategies = [
|
|
|
9889
9911
|
additionalInfo: {
|
|
9890
9912
|
feeBps: 1e3
|
|
9891
9913
|
},
|
|
9892
|
-
faqs
|
|
9914
|
+
faqs,
|
|
9915
|
+
contractDetails: [],
|
|
9916
|
+
investmentSteps: []
|
|
9893
9917
|
},
|
|
9894
9918
|
{
|
|
9895
9919
|
name: "Vesu Fusion USDC",
|
|
@@ -9913,7 +9937,9 @@ var VesuRebalanceStrategies = [
|
|
|
9913
9937
|
additionalInfo: {
|
|
9914
9938
|
feeBps: 1e3
|
|
9915
9939
|
},
|
|
9916
|
-
faqs
|
|
9940
|
+
faqs,
|
|
9941
|
+
contractDetails: [],
|
|
9942
|
+
investmentSteps: []
|
|
9917
9943
|
},
|
|
9918
9944
|
{
|
|
9919
9945
|
name: "Vesu Fusion USDT",
|
|
@@ -9937,7 +9963,9 @@ var VesuRebalanceStrategies = [
|
|
|
9937
9963
|
additionalInfo: {
|
|
9938
9964
|
feeBps: 1e3
|
|
9939
9965
|
},
|
|
9940
|
-
faqs
|
|
9966
|
+
faqs,
|
|
9967
|
+
contractDetails: [],
|
|
9968
|
+
investmentSteps: []
|
|
9941
9969
|
// }, {
|
|
9942
9970
|
// name: 'Vesu Fusion WBTC',
|
|
9943
9971
|
// description: _description.replace('{{TOKEN}}', 'WBTC'),
|
|
@@ -9956,6 +9984,32 @@ var VesuRebalanceStrategies = [
|
|
|
9956
9984
|
// },
|
|
9957
9985
|
}
|
|
9958
9986
|
];
|
|
9987
|
+
VesuRebalanceStrategies.forEach((s) => {
|
|
9988
|
+
s.contractDetails = [
|
|
9989
|
+
{
|
|
9990
|
+
address: s.address,
|
|
9991
|
+
name: "Vault",
|
|
9992
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/tree/main/src/strategies/vesu_rebalance"
|
|
9993
|
+
},
|
|
9994
|
+
...COMMON_CONTRACTS
|
|
9995
|
+
];
|
|
9996
|
+
s.docs = "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults";
|
|
9997
|
+
s.description = highlightTextWithLinks(
|
|
9998
|
+
_description.replace("{{TOKEN}}", s.depositTokens[0].symbol),
|
|
9999
|
+
[{
|
|
10000
|
+
highlight: "Vesu pools",
|
|
10001
|
+
link: "https://vesu.xyz/pools"
|
|
10002
|
+
}, {
|
|
10003
|
+
highlight: "Defi spring STRK Rewards",
|
|
10004
|
+
link: "https://defispring.starknet.io/"
|
|
10005
|
+
}]
|
|
10006
|
+
);
|
|
10007
|
+
s.investmentSteps = [
|
|
10008
|
+
"Split the amount and Supply to configured Vesu pools",
|
|
10009
|
+
"Monitor and Rebalance funds across multiple Vesu pools to maximize yield",
|
|
10010
|
+
"Harvest and supply Defi Spring STRK rewards every week (Auto-compound)"
|
|
10011
|
+
];
|
|
10012
|
+
});
|
|
9959
10013
|
|
|
9960
10014
|
// src/strategies/ekubo-cl-vault.tsx
|
|
9961
10015
|
import {
|
|
@@ -14864,7 +14918,7 @@ var erc4626_abi_default = [
|
|
|
14864
14918
|
];
|
|
14865
14919
|
|
|
14866
14920
|
// src/strategies/ekubo-cl-vault.tsx
|
|
14867
|
-
import { jsx as
|
|
14921
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
14868
14922
|
var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
|
|
14869
14923
|
/**
|
|
14870
14924
|
* Creates a new VesuRebalance strategy instance.
|
|
@@ -15274,17 +15328,13 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
|
|
|
15274
15328
|
const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
|
|
15275
15329
|
const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
|
|
15276
15330
|
const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
|
|
15277
|
-
const tick =
|
|
15278
|
-
price,
|
|
15279
|
-
true,
|
|
15280
|
-
Number(poolKey.tick_spacing)
|
|
15281
|
-
);
|
|
15331
|
+
const tick = priceInfo.tick;
|
|
15282
15332
|
console.log(
|
|
15283
15333
|
`EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, price: ${price}, tick: ${tick.mag}, ${tick.sign}`
|
|
15284
15334
|
);
|
|
15285
15335
|
return {
|
|
15286
15336
|
price,
|
|
15287
|
-
tick: tick.mag * (tick.sign
|
|
15337
|
+
tick: Number(tick.mag) * (tick.sign ? -1 : 1),
|
|
15288
15338
|
sqrtRatio: priceInfo.sqrt_ratio.toString()
|
|
15289
15339
|
};
|
|
15290
15340
|
}
|
|
@@ -15931,19 +15981,20 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
|
|
|
15931
15981
|
return [baseFlow, rebalanceFlow];
|
|
15932
15982
|
}
|
|
15933
15983
|
};
|
|
15934
|
-
var _description2 = "Deploys your {{POOL_NAME}} into an Ekubo liquidity pool, automatically rebalancing positions around the current price to optimize yield and reduce the need for manual adjustments. Trading fees and DeFi Spring rewards are automatically compounded back into the strategy. In return, you receive an ERC-20 token representing your share of the strategy
|
|
15984
|
+
var _description2 = "Deploys your {{POOL_NAME}} into an Ekubo liquidity pool, automatically rebalancing positions around the current price to optimize yield and reduce the need for manual adjustments. Trading fees and DeFi Spring rewards are automatically compounded back into the strategy. In return, you receive an ERC-20 token representing your share of the strategy";
|
|
15935
15985
|
var _protocol2 = {
|
|
15936
15986
|
name: "Ekubo",
|
|
15937
15987
|
logo: "https://app.ekubo.org/favicon.ico"
|
|
15938
15988
|
};
|
|
15939
15989
|
var _riskFactor2 = [
|
|
15940
|
-
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight:
|
|
15941
|
-
{ type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value:
|
|
15990
|
+
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 34, reason: "Audited smart contracts" },
|
|
15991
|
+
{ type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value: 0.75, weight: 33, reason: "Low risk due to co-related assets" },
|
|
15992
|
+
{ type: "Market Risk" /* MARKET_RISK */, value: 0.75, weight: 33, reason: "Low risk due to co-related assets" }
|
|
15942
15993
|
];
|
|
15943
15994
|
var _riskFactorStable = [
|
|
15944
15995
|
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 }
|
|
15945
15996
|
];
|
|
15946
|
-
var AUDIT_URL2 = "https://assets.
|
|
15997
|
+
var AUDIT_URL2 = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
|
|
15947
15998
|
var faqs2 = [
|
|
15948
15999
|
{
|
|
15949
16000
|
question: "What is the Ekubo CL Vault strategy?",
|
|
@@ -15962,10 +16013,10 @@ var faqs2 = [
|
|
|
15962
16013
|
answer: /* @__PURE__ */ jsxs2("div", { children: [
|
|
15963
16014
|
"Yes, the strategy has been audited. You can review the audit report in our docs",
|
|
15964
16015
|
" ",
|
|
15965
|
-
/* @__PURE__ */
|
|
16016
|
+
/* @__PURE__ */ jsx3(
|
|
15966
16017
|
"a",
|
|
15967
16018
|
{
|
|
15968
|
-
href: "https://docs.
|
|
16019
|
+
href: "https://docs.troves.fi/p/ekubo-cl-vaults#technical-details",
|
|
15969
16020
|
style: { textDecoration: "underline", marginLeft: "5px" },
|
|
15970
16021
|
children: "Here"
|
|
15971
16022
|
}
|
|
@@ -15976,23 +16027,7 @@ var faqs2 = [
|
|
|
15976
16027
|
];
|
|
15977
16028
|
var xSTRKSTRK = {
|
|
15978
16029
|
name: "Ekubo xSTRK/STRK",
|
|
15979
|
-
description: /* @__PURE__ */
|
|
15980
|
-
/* @__PURE__ */ jsx2("p", { children: _description2.replace("{{POOL_NAME}}", "xSTRK/STRK") }),
|
|
15981
|
-
/* @__PURE__ */ jsxs2(
|
|
15982
|
-
"ul",
|
|
15983
|
-
{
|
|
15984
|
-
style: {
|
|
15985
|
-
marginLeft: "20px",
|
|
15986
|
-
listStyle: "circle",
|
|
15987
|
-
fontSize: "12px"
|
|
15988
|
-
},
|
|
15989
|
-
children: [
|
|
15990
|
-
/* @__PURE__ */ jsx2("li", { style: { marginTop: "10px" }, children: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." }),
|
|
15991
|
-
/* @__PURE__ */ jsx2("li", { style: { marginTop: "10px" }, children: "Sometimes you might see a negative APY \u2014 this is usually not a big deal. It happens when xSTRK's price drops on DEXes, but things typically bounce back within a few days or a week." })
|
|
15992
|
-
]
|
|
15993
|
-
}
|
|
15994
|
-
)
|
|
15995
|
-
] }),
|
|
16030
|
+
description: /* @__PURE__ */ jsx3(Fragment2, {}),
|
|
15996
16031
|
address: ContractAddr.from(
|
|
15997
16032
|
"0x01f083b98674bc21effee29ef443a00c7b9a500fd92cf30341a3da12c73f2324"
|
|
15998
16033
|
),
|
|
@@ -16038,48 +16073,25 @@ var xSTRKSTRK = {
|
|
|
16038
16073
|
multiplier: 1,
|
|
16039
16074
|
logo: "https://endur.fi/favicon.ico",
|
|
16040
16075
|
toolTip: "This strategy holds xSTRK and STRK tokens. Earn 1x Endur points on your xSTRK portion of Liquidity. STRK portion will earn Endur's DEX Bonus points. Points can be found on endur.fi."
|
|
16041
|
-
}]
|
|
16076
|
+
}],
|
|
16077
|
+
contractDetails: [],
|
|
16078
|
+
investmentSteps: []
|
|
16042
16079
|
};
|
|
16043
16080
|
var EkuboCLVaultStrategies = [
|
|
16044
16081
|
xSTRKSTRK,
|
|
16045
16082
|
{
|
|
16083
|
+
...xSTRKSTRK,
|
|
16046
16084
|
name: "Ekubo USDC/USDT",
|
|
16047
|
-
description: /* @__PURE__ */
|
|
16048
|
-
/* @__PURE__ */ jsx2("p", { children: _description2.replace("{{POOL_NAME}}", "USDC/USDT") }),
|
|
16049
|
-
/* @__PURE__ */ jsx2(
|
|
16050
|
-
"ul",
|
|
16051
|
-
{
|
|
16052
|
-
style: {
|
|
16053
|
-
marginLeft: "20px",
|
|
16054
|
-
listStyle: "circle",
|
|
16055
|
-
fontSize: "12px"
|
|
16056
|
-
},
|
|
16057
|
-
children: /* @__PURE__ */ jsx2("li", { style: { marginTop: "10px" }, children: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." })
|
|
16058
|
-
}
|
|
16059
|
-
)
|
|
16060
|
-
] }),
|
|
16085
|
+
description: /* @__PURE__ */ jsx3(Fragment2, {}),
|
|
16061
16086
|
address: ContractAddr.from(
|
|
16062
16087
|
"0xd647ed735f0db52f2a5502b6e06ed21dc4284a43a36af4b60d3c80fbc56c91"
|
|
16063
16088
|
),
|
|
16064
16089
|
launchBlock: 1385576,
|
|
16065
|
-
type: "Other",
|
|
16066
16090
|
// must be same order as poolKey token0 and token1
|
|
16067
16091
|
depositTokens: [
|
|
16068
16092
|
Global.getDefaultTokens().find((t) => t.symbol === "USDC"),
|
|
16069
16093
|
Global.getDefaultTokens().find((t) => t.symbol === "USDT")
|
|
16070
16094
|
],
|
|
16071
|
-
protocols: [_protocol2],
|
|
16072
|
-
auditUrl: AUDIT_URL2,
|
|
16073
|
-
maxTVL: Web3Number.fromWei("0", 6),
|
|
16074
|
-
risk: {
|
|
16075
|
-
riskFactor: _riskFactorStable,
|
|
16076
|
-
netRisk: _riskFactorStable.reduce(
|
|
16077
|
-
(acc, curr) => acc + curr.value * curr.weight,
|
|
16078
|
-
0
|
|
16079
|
-
) / _riskFactorStable.reduce((acc, curr) => acc + curr.weight, 0),
|
|
16080
|
-
notARisks: getNoRiskTags(_riskFactorStable)
|
|
16081
|
-
},
|
|
16082
|
-
apyMethodology: "APY based on 7-day historical performance, including fees and rewards.",
|
|
16083
16095
|
additionalInfo: {
|
|
16084
16096
|
newBounds: {
|
|
16085
16097
|
lower: -1,
|
|
@@ -16092,51 +16104,71 @@ var EkuboCLVaultStrategies = [
|
|
|
16092
16104
|
minWaitHours: 6,
|
|
16093
16105
|
direction: "any"
|
|
16094
16106
|
}
|
|
16095
|
-
}
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16108
|
-
|
|
16109
|
-
|
|
16110
|
-
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
|
|
16121
|
-
// launchBlock: 1492136,
|
|
16122
|
-
// // must be same order as poolKey token0 and token1
|
|
16123
|
-
// depositTokens: [
|
|
16124
|
-
// Global.getDefaultTokens().find((t) => t.symbol === "STRK")!,
|
|
16125
|
-
// Global.getDefaultTokens().find((t) => t.symbol === "USDC")!,
|
|
16126
|
-
// ],
|
|
16127
|
-
// maxTVL: Web3Number.fromWei("0", 6),
|
|
16128
|
-
// additionalInfo: {
|
|
16129
|
-
// newBounds: "Managed by Re7",
|
|
16130
|
-
// feeBps: 1000,
|
|
16131
|
-
// rebalanceConditions: {
|
|
16132
|
-
// customShouldRebalance: async (currentPrice: number) =>
|
|
16133
|
-
// true,
|
|
16134
|
-
// minWaitHours: 6,
|
|
16135
|
-
// direction: "any",
|
|
16136
|
-
// },
|
|
16137
|
-
// },
|
|
16138
|
-
// },
|
|
16107
|
+
}
|
|
16108
|
+
},
|
|
16109
|
+
{
|
|
16110
|
+
...xSTRKSTRK,
|
|
16111
|
+
name: "Ekubo STRK/USDC",
|
|
16112
|
+
description: /* @__PURE__ */ jsx3(Fragment2, {}),
|
|
16113
|
+
address: ContractAddr.from(
|
|
16114
|
+
"0xb7bd37121041261446d8eedec618955a4490641034942da688e8cbddea7b23"
|
|
16115
|
+
),
|
|
16116
|
+
launchBlock: 1492136,
|
|
16117
|
+
// must be same order as poolKey token0 and token1
|
|
16118
|
+
depositTokens: [
|
|
16119
|
+
Global.getDefaultTokens().find((t) => t.symbol === "STRK"),
|
|
16120
|
+
Global.getDefaultTokens().find((t) => t.symbol === "USDC")
|
|
16121
|
+
],
|
|
16122
|
+
maxTVL: Web3Number.fromWei("0", 6),
|
|
16123
|
+
additionalInfo: {
|
|
16124
|
+
newBounds: "Managed by Re7",
|
|
16125
|
+
feeBps: 1e3,
|
|
16126
|
+
rebalanceConditions: {
|
|
16127
|
+
customShouldRebalance: async (currentPrice) => true,
|
|
16128
|
+
minWaitHours: 6,
|
|
16129
|
+
direction: "any"
|
|
16130
|
+
}
|
|
16131
|
+
}
|
|
16132
|
+
}
|
|
16139
16133
|
];
|
|
16134
|
+
EkuboCLVaultStrategies.forEach((s) => {
|
|
16135
|
+
s.contractDetails = [
|
|
16136
|
+
{
|
|
16137
|
+
address: s.address,
|
|
16138
|
+
name: "Vault",
|
|
16139
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/tree/main/src/strategies/cl_vault"
|
|
16140
|
+
},
|
|
16141
|
+
...COMMON_CONTRACTS
|
|
16142
|
+
];
|
|
16143
|
+
s.docs = "https://docs.troves.fi/p/ekubo-cl-vaults";
|
|
16144
|
+
s.description = /* @__PURE__ */ jsxs2("div", { children: [
|
|
16145
|
+
/* @__PURE__ */ jsx3("p", { children: highlightTextWithLinks(
|
|
16146
|
+
_description2.replace("{{POOL_NAME}}", s.name.split(" ")[1]),
|
|
16147
|
+
[{
|
|
16148
|
+
highlight: "Ekubo liquidity pool",
|
|
16149
|
+
link: "https://app.ekubo.org/positions"
|
|
16150
|
+
}, {
|
|
16151
|
+
highlight: "DeFi Spring rewards",
|
|
16152
|
+
link: "https://defispring.starknet.io/"
|
|
16153
|
+
}, {
|
|
16154
|
+
highlight: "ERC-20 token",
|
|
16155
|
+
link: "https://www.investopedia.com/news/what-erc20-and-what-does-it-mean-ethereum/"
|
|
16156
|
+
}]
|
|
16157
|
+
) }),
|
|
16158
|
+
/* @__PURE__ */ jsxs2("div", { style: { padding: "16px 16px", background: "var(--chakra-colors-mycard_light)", marginTop: "16px", borderRadius: "16px" }, children: [
|
|
16159
|
+
/* @__PURE__ */ jsx3("h4", { style: { fontWeight: "bold" }, children: "Key points to note:" }),
|
|
16160
|
+
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", gap: "10px", color: "var(--chakra-colors-text_secondary)" }, children: [
|
|
16161
|
+
/* @__PURE__ */ jsx3("p", { style: {}, children: "1. During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." }),
|
|
16162
|
+
s.name.includes("xSTRK/STRK") && /* @__PURE__ */ jsx3("p", { style: {}, children: "2. Sometimes you might see a negative APY \u2014 this is usually not a big deal. It happens when xSTRK's price drops on DEXes, but things typically bounce back within a few days or a week." })
|
|
16163
|
+
] })
|
|
16164
|
+
] })
|
|
16165
|
+
] });
|
|
16166
|
+
s.investmentSteps = [
|
|
16167
|
+
"Supply tokens to Ekubo's pool",
|
|
16168
|
+
"Monitor and Rebalance position to optimize yield",
|
|
16169
|
+
"Harvest and supply Defi Spring STRK rewards every week (Auto-compound)"
|
|
16170
|
+
];
|
|
16171
|
+
});
|
|
16140
16172
|
export {
|
|
16141
16173
|
AutoCompounderSTRK,
|
|
16142
16174
|
AvnuWrapper,
|
|
@@ -16163,5 +16195,6 @@ export {
|
|
|
16163
16195
|
getMainnetConfig,
|
|
16164
16196
|
getNoRiskTags,
|
|
16165
16197
|
getRiskColor,
|
|
16166
|
-
getRiskExplaination
|
|
16198
|
+
getRiskExplaination,
|
|
16199
|
+
highlightTextWithLinks
|
|
16167
16200
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import * as starknet from 'starknet';
|
|
3
3
|
import { RpcProvider, BlockIdentifier, Contract, Uint256, Call, Account } from 'starknet';
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { ReactNode } from 'react';
|
|
5
5
|
import { Quote } from '@avnu/avnu-sdk';
|
|
6
6
|
import TelegramBot from 'node-telegram-bot-api';
|
|
7
7
|
|
|
@@ -54,6 +54,7 @@ interface RiskFactor {
|
|
|
54
54
|
type: RiskType;
|
|
55
55
|
value: number;
|
|
56
56
|
weight: number;
|
|
57
|
+
reason?: string;
|
|
57
58
|
}
|
|
58
59
|
interface TokenInfo {
|
|
59
60
|
name: string;
|
|
@@ -105,16 +106,23 @@ interface IStrategyMetadata<T> {
|
|
|
105
106
|
risk: {
|
|
106
107
|
riskFactor: RiskFactor[];
|
|
107
108
|
netRisk: number;
|
|
108
|
-
notARisks:
|
|
109
|
+
notARisks: RiskType[];
|
|
109
110
|
};
|
|
110
111
|
apyMethodology?: string;
|
|
111
112
|
additionalInfo: T;
|
|
113
|
+
contractDetails: {
|
|
114
|
+
address: ContractAddr;
|
|
115
|
+
name: string;
|
|
116
|
+
sourceCodeUrl?: string;
|
|
117
|
+
}[];
|
|
112
118
|
faqs: FAQ[];
|
|
113
119
|
points?: {
|
|
114
120
|
multiplier: number;
|
|
115
121
|
logo: string;
|
|
116
122
|
toolTip?: string;
|
|
117
123
|
}[];
|
|
124
|
+
docs?: string;
|
|
125
|
+
investmentSteps: string[];
|
|
118
126
|
}
|
|
119
127
|
interface IInvestmentFlow {
|
|
120
128
|
id?: string;
|
|
@@ -128,8 +136,13 @@ interface IInvestmentFlow {
|
|
|
128
136
|
}
|
|
129
137
|
declare function getMainnetConfig(rpcUrl?: string, blockIdentifier?: BlockIdentifier): IConfig;
|
|
130
138
|
declare const getRiskExplaination: (riskType: RiskType) => "The risk of the market moving against the position." | "The temporary loss of value experienced by liquidity providers in AMMs when asset prices diverge compared to simply holding them." | "The risk of losing funds due to the position being liquidated." | "The risk of low liquidity in the pool, which can lead to high slippages or reduced in-abilities to quickly exit the position." | "The risk of the oracle being manipulated or incorrect." | "The risk of the smart contract being vulnerable to attacks." | "The risk of technical issues e.g. backend failure." | "The risk of the counterparty defaulting e.g. bad debt on lending platforms.";
|
|
131
|
-
declare const getRiskColor: (risk: RiskFactor) => "
|
|
132
|
-
declare const getNoRiskTags: (risks: RiskFactor[]) =>
|
|
139
|
+
declare const getRiskColor: (risk: RiskFactor) => "light_green_2" | "yellow" | "red";
|
|
140
|
+
declare const getNoRiskTags: (risks: RiskFactor[]) => RiskType[];
|
|
141
|
+
interface HighlightLink {
|
|
142
|
+
highlight: string;
|
|
143
|
+
link: string;
|
|
144
|
+
}
|
|
145
|
+
declare function highlightTextWithLinks(put: string, highlights: HighlightLink[]): ReactNode;
|
|
133
146
|
|
|
134
147
|
interface ILendingMetadata {
|
|
135
148
|
name: string;
|
|
@@ -665,7 +678,11 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
|
|
|
665
678
|
tick: number;
|
|
666
679
|
sqrtRatio: any;
|
|
667
680
|
}>;
|
|
668
|
-
|
|
681
|
+
_getCurrentPrice(poolKey: EkuboPoolKey, blockIdentifier?: BlockIdentifier): Promise<{
|
|
682
|
+
price: number;
|
|
683
|
+
tick: number;
|
|
684
|
+
sqrtRatio: any;
|
|
685
|
+
}>;
|
|
669
686
|
getCurrentBounds(blockIdentifier?: BlockIdentifier): Promise<EkuboBounds>;
|
|
670
687
|
static div2Power128(num: BigInt): number;
|
|
671
688
|
static priceToTick(price: number, isRoundDown: boolean, tickSpacing: number): {
|
|
@@ -859,4 +876,4 @@ declare class PasswordJsonCryptoUtil {
|
|
|
859
876
|
decrypt(encryptedData: string, password: string): any;
|
|
860
877
|
}
|
|
861
878
|
|
|
862
|
-
export { type AccountInfo, type AllAccountsStore, AutoCompounderSTRK, AvnuWrapper, BaseStrategy, type CLVaultStrategySettings, ContractAddr, type DualActionAmount, type DualTokenInfo, ERC20, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey, type FAQ, FatalError, FlowChartColors, Global, type IConfig, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, Initializable, type LendingToken, MarginType, Network, PasswordJsonCryptoUtil, Pragma, type PriceInfo, Pricer, PricerFromApi, PricerRedis, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, RiskType, type Route, type SingleActionAmount, type SingleTokenInfo, Store, type StoreConfig, type SwapInfo, TelegramNotif, type TokenInfo, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, Web3Number, ZkLend, assert, getAPIUsingHeadlessBrowser, getDefaultStoreConfig, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, logger };
|
|
879
|
+
export { type AccountInfo, type AllAccountsStore, AutoCompounderSTRK, AvnuWrapper, BaseStrategy, type CLVaultStrategySettings, ContractAddr, type DualActionAmount, type DualTokenInfo, ERC20, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey, type FAQ, FatalError, FlowChartColors, Global, type IConfig, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, Initializable, type LendingToken, MarginType, Network, PasswordJsonCryptoUtil, Pragma, type PriceInfo, Pricer, PricerFromApi, PricerRedis, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, RiskType, type Route, type SingleActionAmount, type SingleTokenInfo, Store, type StoreConfig, type SwapInfo, TelegramNotif, type TokenInfo, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, Web3Number, ZkLend, assert, getAPIUsingHeadlessBrowser, getDefaultStoreConfig, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, highlightTextWithLinks, logger };
|