@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.mjs
CHANGED
|
@@ -156,7 +156,7 @@ var FatalError = class extends Error {
|
|
|
156
156
|
var defaultTokens = [{
|
|
157
157
|
name: "Starknet",
|
|
158
158
|
symbol: "STRK",
|
|
159
|
-
logo: "https://assets.
|
|
159
|
+
logo: "https://assets.troves.fi/integrations/tokens/strk.svg",
|
|
160
160
|
address: ContractAddr.from("0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"),
|
|
161
161
|
decimals: 18,
|
|
162
162
|
coingeckId: "starknet",
|
|
@@ -164,7 +164,7 @@ var defaultTokens = [{
|
|
|
164
164
|
}, {
|
|
165
165
|
name: "xSTRK",
|
|
166
166
|
symbol: "xSTRK",
|
|
167
|
-
logo: "https://assets.
|
|
167
|
+
logo: "https://assets.troves.fi/integrations/tokens/xstrk.svg",
|
|
168
168
|
address: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a"),
|
|
169
169
|
decimals: 18,
|
|
170
170
|
coingeckId: void 0,
|
|
@@ -172,7 +172,7 @@ var defaultTokens = [{
|
|
|
172
172
|
}, {
|
|
173
173
|
name: "ETH",
|
|
174
174
|
symbol: "ETH",
|
|
175
|
-
logo: "https://assets.
|
|
175
|
+
logo: "https://assets.troves.fi/integrations/tokens/eth.svg",
|
|
176
176
|
address: ContractAddr.from("0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"),
|
|
177
177
|
decimals: 18,
|
|
178
178
|
coingeckId: void 0,
|
|
@@ -180,7 +180,7 @@ var defaultTokens = [{
|
|
|
180
180
|
}, {
|
|
181
181
|
name: "USDC",
|
|
182
182
|
symbol: "USDC",
|
|
183
|
-
logo: "https://assets.
|
|
183
|
+
logo: "https://assets.troves.fi/integrations/tokens/usdc.svg",
|
|
184
184
|
address: ContractAddr.from("0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"),
|
|
185
185
|
decimals: 6,
|
|
186
186
|
coingeckId: void 0,
|
|
@@ -188,7 +188,7 @@ var defaultTokens = [{
|
|
|
188
188
|
}, {
|
|
189
189
|
name: "USDT",
|
|
190
190
|
symbol: "USDT",
|
|
191
|
-
logo: "https://assets.
|
|
191
|
+
logo: "https://assets.troves.fi/integrations/tokens/usdt.svg",
|
|
192
192
|
address: ContractAddr.from("0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8"),
|
|
193
193
|
decimals: 6,
|
|
194
194
|
coingeckId: void 0,
|
|
@@ -196,7 +196,7 @@ var defaultTokens = [{
|
|
|
196
196
|
}, {
|
|
197
197
|
name: "WBTC",
|
|
198
198
|
symbol: "WBTC",
|
|
199
|
-
logo: "https://assets.
|
|
199
|
+
logo: "https://assets.troves.fi/integrations/tokens/wbtc.svg",
|
|
200
200
|
address: ContractAddr.from("0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac"),
|
|
201
201
|
decimals: 8,
|
|
202
202
|
coingeckId: void 0,
|
|
@@ -220,7 +220,7 @@ var Global = class _Global {
|
|
|
220
220
|
}
|
|
221
221
|
static async getTokens() {
|
|
222
222
|
if (tokens.length) return tokens;
|
|
223
|
-
const data = await axios.get("https://assets.
|
|
223
|
+
const data = await axios.get("https://assets.troves.fi/integrations/tokens.json");
|
|
224
224
|
const tokensData = data.data.content;
|
|
225
225
|
tokensData.forEach((token) => {
|
|
226
226
|
if (!token.tags.includes("AVNU") || !token.tags.includes("Verified")) {
|
|
@@ -763,7 +763,7 @@ var PricerFromApi = class extends PricerBase {
|
|
|
763
763
|
}
|
|
764
764
|
async getPriceFromMyAPI(tokenSymbol) {
|
|
765
765
|
logger.verbose(`getPrice from redis: ${tokenSymbol}`);
|
|
766
|
-
const endpoint = "https://app.
|
|
766
|
+
const endpoint = "https://app.troves.fi";
|
|
767
767
|
const url = `${endpoint}/api/price/${tokenSymbol}`;
|
|
768
768
|
const priceInfoRes = await fetch(url);
|
|
769
769
|
const priceInfo = await priceInfoRes.json();
|
|
@@ -2012,8 +2012,9 @@ var AvnuWrapper = class _AvnuWrapper {
|
|
|
2012
2012
|
}
|
|
2013
2013
|
};
|
|
2014
2014
|
|
|
2015
|
-
// src/interfaces/common.
|
|
2015
|
+
// src/interfaces/common.tsx
|
|
2016
2016
|
import { RpcProvider as RpcProvider2 } from "starknet";
|
|
2017
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2017
2018
|
var RiskType = /* @__PURE__ */ ((RiskType2) => {
|
|
2018
2019
|
RiskType2["MARKET_RISK"] = "Market Risk";
|
|
2019
2020
|
RiskType2["IMPERMANENT_LOSS"] = "Impermanent Loss Risk";
|
|
@@ -2069,8 +2070,8 @@ var getRiskExplaination = (riskType) => {
|
|
|
2069
2070
|
};
|
|
2070
2071
|
var getRiskColor = (risk) => {
|
|
2071
2072
|
const value = risk.value;
|
|
2072
|
-
if (value
|
|
2073
|
-
if (value <
|
|
2073
|
+
if (value <= 1) return "light_green_2";
|
|
2074
|
+
if (value < 3) return "yellow";
|
|
2074
2075
|
return "red";
|
|
2075
2076
|
};
|
|
2076
2077
|
var getNoRiskTags = (risks) => {
|
|
@@ -2079,8 +2080,20 @@ var getNoRiskTags = (risks) => {
|
|
|
2079
2080
|
(risk) => !risks.map((risk2) => risk2.type).includes(risk)
|
|
2080
2081
|
);
|
|
2081
2082
|
const mergedUnique = [.../* @__PURE__ */ new Set([...noRisks1, ...noRisks2])];
|
|
2082
|
-
return mergedUnique
|
|
2083
|
+
return mergedUnique;
|
|
2083
2084
|
};
|
|
2085
|
+
function highlightTextWithLinks(put, highlights) {
|
|
2086
|
+
const escapeRegExp = (text) => text.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
2087
|
+
const pattern = new RegExp(
|
|
2088
|
+
`(${highlights.map((m) => escapeRegExp(m.highlight)).join("|")})`,
|
|
2089
|
+
"gi"
|
|
2090
|
+
);
|
|
2091
|
+
const parts = put.split(pattern);
|
|
2092
|
+
return /* @__PURE__ */ jsx(Fragment, { children: parts.map((part, i) => {
|
|
2093
|
+
const match = highlights.find((m) => m.highlight.toLowerCase() === part.toLowerCase());
|
|
2094
|
+
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);
|
|
2095
|
+
}) });
|
|
2096
|
+
}
|
|
2084
2097
|
|
|
2085
2098
|
// src/interfaces/initializable.ts
|
|
2086
2099
|
var Initializable = class {
|
|
@@ -9202,8 +9215,15 @@ var vesu_pools_default = {
|
|
|
9202
9215
|
]
|
|
9203
9216
|
};
|
|
9204
9217
|
|
|
9218
|
+
// src/strategies/constants.ts
|
|
9219
|
+
var COMMON_CONTRACTS = [{
|
|
9220
|
+
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
9221
|
+
name: "Access Controller",
|
|
9222
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
9223
|
+
}];
|
|
9224
|
+
|
|
9205
9225
|
// src/strategies/vesu-rebalance.tsx
|
|
9206
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9226
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
9207
9227
|
var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
9208
9228
|
// 10000 bps = 100%
|
|
9209
9229
|
/**
|
|
@@ -9844,11 +9864,11 @@ var _protocol = {
|
|
|
9844
9864
|
logo: "https://static-assets-8zct.onrender.com/integrations/vesu/logo.png"
|
|
9845
9865
|
};
|
|
9846
9866
|
var _riskFactor = [
|
|
9847
|
-
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 },
|
|
9848
|
-
{ type: "Counterparty Risk" /* COUNTERPARTY_RISK */, value: 1, weight: 50 },
|
|
9849
|
-
{ type: "Oracle Risk" /* ORACLE_RISK */, value: 0.5, weight: 25 }
|
|
9867
|
+
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25, reason: "Audited by CSC" },
|
|
9868
|
+
{ type: "Counterparty Risk" /* COUNTERPARTY_RISK */, value: 1, weight: 50, reason: "Reasonable max LTV ratios and Curated by well-known risk managers like Re7" },
|
|
9869
|
+
{ type: "Oracle Risk" /* ORACLE_RISK */, value: 0.5, weight: 25, reason: "Uses Pragma price feeds, Most reputable price feed on Starknet" }
|
|
9850
9870
|
];
|
|
9851
|
-
var AUDIT_URL = "https://assets.
|
|
9871
|
+
var AUDIT_URL = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
|
|
9852
9872
|
var faqs = [
|
|
9853
9873
|
{
|
|
9854
9874
|
question: "What is the Vesu Rebalancing Strategy?",
|
|
@@ -9886,7 +9906,7 @@ var faqs = [
|
|
|
9886
9906
|
question: "Is the strategy audited?",
|
|
9887
9907
|
answer: /* @__PURE__ */ jsxs("div", { children: [
|
|
9888
9908
|
"Yes, the strategy has been audited. You can review the audit report in our docs ",
|
|
9889
|
-
/* @__PURE__ */
|
|
9909
|
+
/* @__PURE__ */ jsx2("a", { href: "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults#technical-details", style: { textDecoration: "underline", marginLeft: "5px" }, children: "Here" }),
|
|
9890
9910
|
"."
|
|
9891
9911
|
] })
|
|
9892
9912
|
}
|
|
@@ -9894,7 +9914,7 @@ var faqs = [
|
|
|
9894
9914
|
var VesuRebalanceStrategies = [
|
|
9895
9915
|
{
|
|
9896
9916
|
name: "Vesu Fusion STRK",
|
|
9897
|
-
description: _description
|
|
9917
|
+
description: _description,
|
|
9898
9918
|
address: ContractAddr.from(
|
|
9899
9919
|
"0x7fb5bcb8525954a60fde4e8fb8220477696ce7117ef264775a1770e23571929"
|
|
9900
9920
|
),
|
|
@@ -9914,7 +9934,9 @@ var VesuRebalanceStrategies = [
|
|
|
9914
9934
|
additionalInfo: {
|
|
9915
9935
|
feeBps: 1e3
|
|
9916
9936
|
},
|
|
9917
|
-
faqs
|
|
9937
|
+
faqs,
|
|
9938
|
+
contractDetails: [],
|
|
9939
|
+
investmentSteps: []
|
|
9918
9940
|
},
|
|
9919
9941
|
{
|
|
9920
9942
|
name: "Vesu Fusion ETH",
|
|
@@ -9938,7 +9960,9 @@ var VesuRebalanceStrategies = [
|
|
|
9938
9960
|
additionalInfo: {
|
|
9939
9961
|
feeBps: 1e3
|
|
9940
9962
|
},
|
|
9941
|
-
faqs
|
|
9963
|
+
faqs,
|
|
9964
|
+
contractDetails: [],
|
|
9965
|
+
investmentSteps: []
|
|
9942
9966
|
},
|
|
9943
9967
|
{
|
|
9944
9968
|
name: "Vesu Fusion USDC",
|
|
@@ -9962,7 +9986,9 @@ var VesuRebalanceStrategies = [
|
|
|
9962
9986
|
additionalInfo: {
|
|
9963
9987
|
feeBps: 1e3
|
|
9964
9988
|
},
|
|
9965
|
-
faqs
|
|
9989
|
+
faqs,
|
|
9990
|
+
contractDetails: [],
|
|
9991
|
+
investmentSteps: []
|
|
9966
9992
|
},
|
|
9967
9993
|
{
|
|
9968
9994
|
name: "Vesu Fusion USDT",
|
|
@@ -9986,7 +10012,9 @@ var VesuRebalanceStrategies = [
|
|
|
9986
10012
|
additionalInfo: {
|
|
9987
10013
|
feeBps: 1e3
|
|
9988
10014
|
},
|
|
9989
|
-
faqs
|
|
10015
|
+
faqs,
|
|
10016
|
+
contractDetails: [],
|
|
10017
|
+
investmentSteps: []
|
|
9990
10018
|
// }, {
|
|
9991
10019
|
// name: 'Vesu Fusion WBTC',
|
|
9992
10020
|
// description: _description.replace('{{TOKEN}}', 'WBTC'),
|
|
@@ -10005,6 +10033,32 @@ var VesuRebalanceStrategies = [
|
|
|
10005
10033
|
// },
|
|
10006
10034
|
}
|
|
10007
10035
|
];
|
|
10036
|
+
VesuRebalanceStrategies.forEach((s) => {
|
|
10037
|
+
s.contractDetails = [
|
|
10038
|
+
{
|
|
10039
|
+
address: s.address,
|
|
10040
|
+
name: "Vault",
|
|
10041
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/tree/main/src/strategies/vesu_rebalance"
|
|
10042
|
+
},
|
|
10043
|
+
...COMMON_CONTRACTS
|
|
10044
|
+
];
|
|
10045
|
+
s.docs = "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults";
|
|
10046
|
+
s.description = highlightTextWithLinks(
|
|
10047
|
+
_description.replace("{{TOKEN}}", s.depositTokens[0].symbol),
|
|
10048
|
+
[{
|
|
10049
|
+
highlight: "Vesu pools",
|
|
10050
|
+
link: "https://vesu.xyz/pools"
|
|
10051
|
+
}, {
|
|
10052
|
+
highlight: "Defi spring STRK Rewards",
|
|
10053
|
+
link: "https://defispring.starknet.io/"
|
|
10054
|
+
}]
|
|
10055
|
+
);
|
|
10056
|
+
s.investmentSteps = [
|
|
10057
|
+
"Split the amount and Supply to configured Vesu pools",
|
|
10058
|
+
"Monitor and Rebalance funds across multiple Vesu pools to maximize yield",
|
|
10059
|
+
"Harvest and supply Defi Spring STRK rewards every week (Auto-compound)"
|
|
10060
|
+
];
|
|
10061
|
+
});
|
|
10008
10062
|
|
|
10009
10063
|
// src/strategies/ekubo-cl-vault.tsx
|
|
10010
10064
|
import {
|
|
@@ -14913,7 +14967,7 @@ var erc4626_abi_default = [
|
|
|
14913
14967
|
];
|
|
14914
14968
|
|
|
14915
14969
|
// src/strategies/ekubo-cl-vault.tsx
|
|
14916
|
-
import { jsx as
|
|
14970
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
14917
14971
|
var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
|
|
14918
14972
|
/**
|
|
14919
14973
|
* Creates a new VesuRebalance strategy instance.
|
|
@@ -15323,17 +15377,13 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
|
|
|
15323
15377
|
const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
|
|
15324
15378
|
const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
|
|
15325
15379
|
const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
|
|
15326
|
-
const tick =
|
|
15327
|
-
price,
|
|
15328
|
-
true,
|
|
15329
|
-
Number(poolKey.tick_spacing)
|
|
15330
|
-
);
|
|
15380
|
+
const tick = priceInfo.tick;
|
|
15331
15381
|
console.log(
|
|
15332
15382
|
`EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, price: ${price}, tick: ${tick.mag}, ${tick.sign}`
|
|
15333
15383
|
);
|
|
15334
15384
|
return {
|
|
15335
15385
|
price,
|
|
15336
|
-
tick: tick.mag * (tick.sign
|
|
15386
|
+
tick: Number(tick.mag) * (tick.sign ? -1 : 1),
|
|
15337
15387
|
sqrtRatio: priceInfo.sqrt_ratio.toString()
|
|
15338
15388
|
};
|
|
15339
15389
|
}
|
|
@@ -15980,19 +16030,20 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
|
|
|
15980
16030
|
return [baseFlow, rebalanceFlow];
|
|
15981
16031
|
}
|
|
15982
16032
|
};
|
|
15983
|
-
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
|
|
16033
|
+
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
16034
|
var _protocol2 = {
|
|
15985
16035
|
name: "Ekubo",
|
|
15986
16036
|
logo: "https://app.ekubo.org/favicon.ico"
|
|
15987
16037
|
};
|
|
15988
16038
|
var _riskFactor2 = [
|
|
15989
|
-
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight:
|
|
15990
|
-
{ type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value:
|
|
16039
|
+
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 34, reason: "Audited smart contracts" },
|
|
16040
|
+
{ type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value: 0.75, weight: 33, reason: "Low risk due to co-related assets" },
|
|
16041
|
+
{ type: "Market Risk" /* MARKET_RISK */, value: 0.75, weight: 33, reason: "Low risk due to co-related assets" }
|
|
15991
16042
|
];
|
|
15992
16043
|
var _riskFactorStable = [
|
|
15993
16044
|
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 }
|
|
15994
16045
|
];
|
|
15995
|
-
var AUDIT_URL2 = "https://assets.
|
|
16046
|
+
var AUDIT_URL2 = "https://assets.troves.fi/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
|
|
15996
16047
|
var faqs2 = [
|
|
15997
16048
|
{
|
|
15998
16049
|
question: "What is the Ekubo CL Vault strategy?",
|
|
@@ -16011,10 +16062,10 @@ var faqs2 = [
|
|
|
16011
16062
|
answer: /* @__PURE__ */ jsxs2("div", { children: [
|
|
16012
16063
|
"Yes, the strategy has been audited. You can review the audit report in our docs",
|
|
16013
16064
|
" ",
|
|
16014
|
-
/* @__PURE__ */
|
|
16065
|
+
/* @__PURE__ */ jsx3(
|
|
16015
16066
|
"a",
|
|
16016
16067
|
{
|
|
16017
|
-
href: "https://docs.
|
|
16068
|
+
href: "https://docs.troves.fi/p/ekubo-cl-vaults#technical-details",
|
|
16018
16069
|
style: { textDecoration: "underline", marginLeft: "5px" },
|
|
16019
16070
|
children: "Here"
|
|
16020
16071
|
}
|
|
@@ -16025,23 +16076,7 @@ var faqs2 = [
|
|
|
16025
16076
|
];
|
|
16026
16077
|
var xSTRKSTRK = {
|
|
16027
16078
|
name: "Ekubo xSTRK/STRK",
|
|
16028
|
-
description: /* @__PURE__ */
|
|
16029
|
-
/* @__PURE__ */ jsx2("p", { children: _description2.replace("{{POOL_NAME}}", "xSTRK/STRK") }),
|
|
16030
|
-
/* @__PURE__ */ jsxs2(
|
|
16031
|
-
"ul",
|
|
16032
|
-
{
|
|
16033
|
-
style: {
|
|
16034
|
-
marginLeft: "20px",
|
|
16035
|
-
listStyle: "circle",
|
|
16036
|
-
fontSize: "12px"
|
|
16037
|
-
},
|
|
16038
|
-
children: [
|
|
16039
|
-
/* @__PURE__ */ jsx2("li", { style: { marginTop: "10px" }, children: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." }),
|
|
16040
|
-
/* @__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." })
|
|
16041
|
-
]
|
|
16042
|
-
}
|
|
16043
|
-
)
|
|
16044
|
-
] }),
|
|
16079
|
+
description: /* @__PURE__ */ jsx3(Fragment2, {}),
|
|
16045
16080
|
address: ContractAddr.from(
|
|
16046
16081
|
"0x01f083b98674bc21effee29ef443a00c7b9a500fd92cf30341a3da12c73f2324"
|
|
16047
16082
|
),
|
|
@@ -16087,48 +16122,25 @@ var xSTRKSTRK = {
|
|
|
16087
16122
|
multiplier: 1,
|
|
16088
16123
|
logo: "https://endur.fi/favicon.ico",
|
|
16089
16124
|
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."
|
|
16090
|
-
}]
|
|
16125
|
+
}],
|
|
16126
|
+
contractDetails: [],
|
|
16127
|
+
investmentSteps: []
|
|
16091
16128
|
};
|
|
16092
16129
|
var EkuboCLVaultStrategies = [
|
|
16093
16130
|
xSTRKSTRK,
|
|
16094
16131
|
{
|
|
16132
|
+
...xSTRKSTRK,
|
|
16095
16133
|
name: "Ekubo USDC/USDT",
|
|
16096
|
-
description: /* @__PURE__ */
|
|
16097
|
-
/* @__PURE__ */ jsx2("p", { children: _description2.replace("{{POOL_NAME}}", "USDC/USDT") }),
|
|
16098
|
-
/* @__PURE__ */ jsx2(
|
|
16099
|
-
"ul",
|
|
16100
|
-
{
|
|
16101
|
-
style: {
|
|
16102
|
-
marginLeft: "20px",
|
|
16103
|
-
listStyle: "circle",
|
|
16104
|
-
fontSize: "12px"
|
|
16105
|
-
},
|
|
16106
|
-
children: /* @__PURE__ */ jsx2("li", { style: { marginTop: "10px" }, children: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." })
|
|
16107
|
-
}
|
|
16108
|
-
)
|
|
16109
|
-
] }),
|
|
16134
|
+
description: /* @__PURE__ */ jsx3(Fragment2, {}),
|
|
16110
16135
|
address: ContractAddr.from(
|
|
16111
16136
|
"0xd647ed735f0db52f2a5502b6e06ed21dc4284a43a36af4b60d3c80fbc56c91"
|
|
16112
16137
|
),
|
|
16113
16138
|
launchBlock: 1385576,
|
|
16114
|
-
type: "Other",
|
|
16115
16139
|
// must be same order as poolKey token0 and token1
|
|
16116
16140
|
depositTokens: [
|
|
16117
16141
|
Global.getDefaultTokens().find((t) => t.symbol === "USDC"),
|
|
16118
16142
|
Global.getDefaultTokens().find((t) => t.symbol === "USDT")
|
|
16119
16143
|
],
|
|
16120
|
-
protocols: [_protocol2],
|
|
16121
|
-
auditUrl: AUDIT_URL2,
|
|
16122
|
-
maxTVL: Web3Number.fromWei("0", 6),
|
|
16123
|
-
risk: {
|
|
16124
|
-
riskFactor: _riskFactorStable,
|
|
16125
|
-
netRisk: _riskFactorStable.reduce(
|
|
16126
|
-
(acc, curr) => acc + curr.value * curr.weight,
|
|
16127
|
-
0
|
|
16128
|
-
) / _riskFactorStable.reduce((acc, curr) => acc + curr.weight, 0),
|
|
16129
|
-
notARisks: getNoRiskTags(_riskFactorStable)
|
|
16130
|
-
},
|
|
16131
|
-
apyMethodology: "APY based on 7-day historical performance, including fees and rewards.",
|
|
16132
16144
|
additionalInfo: {
|
|
16133
16145
|
newBounds: {
|
|
16134
16146
|
lower: -1,
|
|
@@ -16141,51 +16153,71 @@ var EkuboCLVaultStrategies = [
|
|
|
16141
16153
|
minWaitHours: 6,
|
|
16142
16154
|
direction: "any"
|
|
16143
16155
|
}
|
|
16144
|
-
}
|
|
16145
|
-
|
|
16156
|
+
}
|
|
16157
|
+
},
|
|
16158
|
+
{
|
|
16159
|
+
...xSTRKSTRK,
|
|
16160
|
+
name: "Ekubo STRK/USDC",
|
|
16161
|
+
description: /* @__PURE__ */ jsx3(Fragment2, {}),
|
|
16162
|
+
address: ContractAddr.from(
|
|
16163
|
+
"0xb7bd37121041261446d8eedec618955a4490641034942da688e8cbddea7b23"
|
|
16164
|
+
),
|
|
16165
|
+
launchBlock: 1492136,
|
|
16166
|
+
// must be same order as poolKey token0 and token1
|
|
16167
|
+
depositTokens: [
|
|
16168
|
+
Global.getDefaultTokens().find((t) => t.symbol === "STRK"),
|
|
16169
|
+
Global.getDefaultTokens().find((t) => t.symbol === "USDC")
|
|
16170
|
+
],
|
|
16171
|
+
maxTVL: Web3Number.fromWei("0", 6),
|
|
16172
|
+
additionalInfo: {
|
|
16173
|
+
newBounds: "Managed by Re7",
|
|
16174
|
+
feeBps: 1e3,
|
|
16175
|
+
rebalanceConditions: {
|
|
16176
|
+
customShouldRebalance: async (currentPrice) => true,
|
|
16177
|
+
minWaitHours: 6,
|
|
16178
|
+
direction: "any"
|
|
16179
|
+
}
|
|
16180
|
+
}
|
|
16146
16181
|
}
|
|
16147
|
-
// {
|
|
16148
|
-
// ...xSTRKSTRK,
|
|
16149
|
-
// name: "Ekubo STRK/USDC",
|
|
16150
|
-
// description: (
|
|
16151
|
-
// <div>
|
|
16152
|
-
// <p>{_description.replace("{{POOL_NAME}}", "STRK/USDC")}</p>
|
|
16153
|
-
// <ul
|
|
16154
|
-
// style={{
|
|
16155
|
-
// marginLeft: "20px",
|
|
16156
|
-
// listStyle: "circle",
|
|
16157
|
-
// fontSize: "12px",
|
|
16158
|
-
// }}
|
|
16159
|
-
// >
|
|
16160
|
-
// <li style={{ marginTop: "10px" }}>
|
|
16161
|
-
// During withdrawal, you may receive either or both tokens depending
|
|
16162
|
-
// on market conditions and prevailing prices.
|
|
16163
|
-
// </li>
|
|
16164
|
-
// </ul>
|
|
16165
|
-
// </div>
|
|
16166
|
-
// ),
|
|
16167
|
-
// address: ContractAddr.from(
|
|
16168
|
-
// "0xb7bd37121041261446d8eedec618955a4490641034942da688e8cbddea7b23"
|
|
16169
|
-
// ),
|
|
16170
|
-
// launchBlock: 1492136,
|
|
16171
|
-
// // must be same order as poolKey token0 and token1
|
|
16172
|
-
// depositTokens: [
|
|
16173
|
-
// Global.getDefaultTokens().find((t) => t.symbol === "STRK")!,
|
|
16174
|
-
// Global.getDefaultTokens().find((t) => t.symbol === "USDC")!,
|
|
16175
|
-
// ],
|
|
16176
|
-
// maxTVL: Web3Number.fromWei("0", 6),
|
|
16177
|
-
// additionalInfo: {
|
|
16178
|
-
// newBounds: "Managed by Re7",
|
|
16179
|
-
// feeBps: 1000,
|
|
16180
|
-
// rebalanceConditions: {
|
|
16181
|
-
// customShouldRebalance: async (currentPrice: number) =>
|
|
16182
|
-
// true,
|
|
16183
|
-
// minWaitHours: 6,
|
|
16184
|
-
// direction: "any",
|
|
16185
|
-
// },
|
|
16186
|
-
// },
|
|
16187
|
-
// },
|
|
16188
16182
|
];
|
|
16183
|
+
EkuboCLVaultStrategies.forEach((s) => {
|
|
16184
|
+
s.contractDetails = [
|
|
16185
|
+
{
|
|
16186
|
+
address: s.address,
|
|
16187
|
+
name: "Vault",
|
|
16188
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/tree/main/src/strategies/cl_vault"
|
|
16189
|
+
},
|
|
16190
|
+
...COMMON_CONTRACTS
|
|
16191
|
+
];
|
|
16192
|
+
s.docs = "https://docs.troves.fi/p/ekubo-cl-vaults";
|
|
16193
|
+
s.description = /* @__PURE__ */ jsxs2("div", { children: [
|
|
16194
|
+
/* @__PURE__ */ jsx3("p", { children: highlightTextWithLinks(
|
|
16195
|
+
_description2.replace("{{POOL_NAME}}", s.name.split(" ")[1]),
|
|
16196
|
+
[{
|
|
16197
|
+
highlight: "Ekubo liquidity pool",
|
|
16198
|
+
link: "https://app.ekubo.org/positions"
|
|
16199
|
+
}, {
|
|
16200
|
+
highlight: "DeFi Spring rewards",
|
|
16201
|
+
link: "https://defispring.starknet.io/"
|
|
16202
|
+
}, {
|
|
16203
|
+
highlight: "ERC-20 token",
|
|
16204
|
+
link: "https://www.investopedia.com/news/what-erc20-and-what-does-it-mean-ethereum/"
|
|
16205
|
+
}]
|
|
16206
|
+
) }),
|
|
16207
|
+
/* @__PURE__ */ jsxs2("div", { style: { padding: "16px 16px", background: "var(--chakra-colors-mycard_light)", marginTop: "16px", borderRadius: "16px" }, children: [
|
|
16208
|
+
/* @__PURE__ */ jsx3("h4", { style: { fontWeight: "bold" }, children: "Key points to note:" }),
|
|
16209
|
+
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", gap: "10px", color: "var(--chakra-colors-text_secondary)" }, children: [
|
|
16210
|
+
/* @__PURE__ */ jsx3("p", { style: {}, children: "1. During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." }),
|
|
16211
|
+
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." })
|
|
16212
|
+
] })
|
|
16213
|
+
] })
|
|
16214
|
+
] });
|
|
16215
|
+
s.investmentSteps = [
|
|
16216
|
+
"Supply tokens to Ekubo's pool",
|
|
16217
|
+
"Monitor and Rebalance position to optimize yield",
|
|
16218
|
+
"Harvest and supply Defi Spring STRK rewards every week (Auto-compound)"
|
|
16219
|
+
];
|
|
16220
|
+
});
|
|
16189
16221
|
|
|
16190
16222
|
// src/notifs/telegram.ts
|
|
16191
16223
|
import TelegramBot from "node-telegram-bot-api";
|
|
@@ -16482,5 +16514,6 @@ export {
|
|
|
16482
16514
|
getNoRiskTags,
|
|
16483
16515
|
getRiskColor,
|
|
16484
16516
|
getRiskExplaination,
|
|
16517
|
+
highlightTextWithLinks,
|
|
16485
16518
|
logger
|
|
16486
16519
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strkfarm/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.51",
|
|
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",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"axios": "^1.7.2"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@avnu/avnu-sdk": "
|
|
59
|
+
"@avnu/avnu-sdk": "3.0.2",
|
|
60
60
|
"bignumber.js": "4.0.4",
|
|
61
61
|
"browser-assert": "^1.2.1",
|
|
62
62
|
"chalk": "^4.1.2",
|
package/src/global.ts
CHANGED
|
@@ -17,7 +17,7 @@ export class FatalError extends Error {
|
|
|
17
17
|
const defaultTokens: TokenInfo[] = [{
|
|
18
18
|
name: 'Starknet',
|
|
19
19
|
symbol: 'STRK',
|
|
20
|
-
logo: 'https://assets.
|
|
20
|
+
logo: 'https://assets.troves.fi/integrations/tokens/strk.svg',
|
|
21
21
|
address: ContractAddr.from('0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d'),
|
|
22
22
|
decimals: 18,
|
|
23
23
|
coingeckId: 'starknet',
|
|
@@ -25,7 +25,7 @@ const defaultTokens: TokenInfo[] = [{
|
|
|
25
25
|
}, {
|
|
26
26
|
name: 'xSTRK',
|
|
27
27
|
symbol: 'xSTRK',
|
|
28
|
-
logo: 'https://assets.
|
|
28
|
+
logo: 'https://assets.troves.fi/integrations/tokens/xstrk.svg',
|
|
29
29
|
address: ContractAddr.from('0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a'),
|
|
30
30
|
decimals: 18,
|
|
31
31
|
coingeckId: undefined,
|
|
@@ -33,7 +33,7 @@ const defaultTokens: TokenInfo[] = [{
|
|
|
33
33
|
}, {
|
|
34
34
|
name: 'ETH',
|
|
35
35
|
symbol: 'ETH',
|
|
36
|
-
logo: 'https://assets.
|
|
36
|
+
logo: 'https://assets.troves.fi/integrations/tokens/eth.svg',
|
|
37
37
|
address: ContractAddr.from('0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'),
|
|
38
38
|
decimals: 18,
|
|
39
39
|
coingeckId: undefined,
|
|
@@ -41,7 +41,7 @@ const defaultTokens: TokenInfo[] = [{
|
|
|
41
41
|
}, {
|
|
42
42
|
name: 'USDC',
|
|
43
43
|
symbol: 'USDC',
|
|
44
|
-
logo: 'https://assets.
|
|
44
|
+
logo: 'https://assets.troves.fi/integrations/tokens/usdc.svg',
|
|
45
45
|
address: ContractAddr.from('0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8'),
|
|
46
46
|
decimals: 6,
|
|
47
47
|
coingeckId: undefined,
|
|
@@ -49,7 +49,7 @@ const defaultTokens: TokenInfo[] = [{
|
|
|
49
49
|
}, {
|
|
50
50
|
name: 'USDT',
|
|
51
51
|
symbol: 'USDT',
|
|
52
|
-
logo: 'https://assets.
|
|
52
|
+
logo: 'https://assets.troves.fi/integrations/tokens/usdt.svg',
|
|
53
53
|
address: ContractAddr.from('0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8'),
|
|
54
54
|
decimals: 6,
|
|
55
55
|
coingeckId: undefined,
|
|
@@ -57,7 +57,7 @@ const defaultTokens: TokenInfo[] = [{
|
|
|
57
57
|
}, {
|
|
58
58
|
name: 'WBTC',
|
|
59
59
|
symbol: 'WBTC',
|
|
60
|
-
logo: 'https://assets.
|
|
60
|
+
logo: 'https://assets.troves.fi/integrations/tokens/wbtc.svg',
|
|
61
61
|
address: ContractAddr.from('0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac'),
|
|
62
62
|
decimals: 8,
|
|
63
63
|
coingeckId: undefined,
|
|
@@ -90,7 +90,7 @@ export class Global {
|
|
|
90
90
|
if (tokens.length) return tokens;
|
|
91
91
|
|
|
92
92
|
// fetch from avnu API
|
|
93
|
-
const data = await axios.get('https://assets.
|
|
93
|
+
const data = await axios.get('https://assets.troves.fi/integrations/tokens.json');
|
|
94
94
|
const tokensData = data.data.content;
|
|
95
95
|
|
|
96
96
|
// Array of the following is returned
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContractAddr, Web3Number } from "@/dataTypes";
|
|
2
2
|
import { BlockIdentifier, RpcProvider } from "starknet";
|
|
3
|
-
import React from "react";
|
|
3
|
+
import React, { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
export enum RiskType {
|
|
6
6
|
MARKET_RISK = "Market Risk",
|
|
@@ -21,6 +21,7 @@ export interface RiskFactor {
|
|
|
21
21
|
type: RiskType;
|
|
22
22
|
value: number; // 0 to 5
|
|
23
23
|
weight: number; // 0 to 100
|
|
24
|
+
reason?: string; // optional reason for the risk factor
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export interface TokenInfo {
|
|
@@ -79,12 +80,19 @@ export interface IStrategyMetadata<T> {
|
|
|
79
80
|
risk: {
|
|
80
81
|
riskFactor: RiskFactor[];
|
|
81
82
|
netRisk: number;
|
|
82
|
-
notARisks:
|
|
83
|
+
notARisks: RiskType[];
|
|
83
84
|
};
|
|
84
85
|
apyMethodology?: string;
|
|
85
86
|
additionalInfo: T;
|
|
87
|
+
contractDetails: {
|
|
88
|
+
address: ContractAddr;
|
|
89
|
+
name: string;
|
|
90
|
+
sourceCodeUrl?: string;
|
|
91
|
+
}[],
|
|
86
92
|
faqs: FAQ[];
|
|
87
93
|
points?: {multiplier: number, logo: string, toolTip?: string}[];
|
|
94
|
+
docs?: string;
|
|
95
|
+
investmentSteps: string[];
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
export interface IInvestmentFlow {
|
|
@@ -132,8 +140,8 @@ export const getRiskExplaination = (riskType: RiskType) => {
|
|
|
132
140
|
|
|
133
141
|
export const getRiskColor = (risk: RiskFactor) => {
|
|
134
142
|
const value = risk.value;
|
|
135
|
-
if (value
|
|
136
|
-
if (value <
|
|
143
|
+
if (value <= 1) return "light_green_2";
|
|
144
|
+
if (value < 3) return "yellow";
|
|
137
145
|
return "red";
|
|
138
146
|
};
|
|
139
147
|
|
|
@@ -150,5 +158,42 @@ export const getNoRiskTags = (risks: RiskFactor[]) => {
|
|
|
150
158
|
const mergedUnique = [...new Set([...noRisks1, ...noRisks2])];
|
|
151
159
|
|
|
152
160
|
// add `No` to the start of each risk
|
|
153
|
-
return mergedUnique
|
|
161
|
+
return mergedUnique
|
|
154
162
|
};
|
|
163
|
+
|
|
164
|
+
interface HighlightLink {
|
|
165
|
+
highlight: string;
|
|
166
|
+
link: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function highlightTextWithLinks(
|
|
170
|
+
put: string,
|
|
171
|
+
highlights: HighlightLink[],
|
|
172
|
+
): ReactNode {
|
|
173
|
+
// Escape RegExp special characters in highlight strings
|
|
174
|
+
const escapeRegExp = (text: string) =>
|
|
175
|
+
text.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
176
|
+
|
|
177
|
+
// Create a single regex for all highlight terms
|
|
178
|
+
const pattern = new RegExp(
|
|
179
|
+
`(${highlights.map(m => escapeRegExp(m.highlight)).join('|')})`,
|
|
180
|
+
'gi'
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
const parts = put.split(pattern);
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<>
|
|
187
|
+
{parts.map((part, i) => {
|
|
188
|
+
const match = highlights.find(m => m.highlight.toLowerCase() === part.toLowerCase());
|
|
189
|
+
return match ? (
|
|
190
|
+
<a key={i} href={match.link} target="_blank" style={{ color: 'var(--chakra-colors-white)', background: 'var(--chakra-colors-highlight)' }}>
|
|
191
|
+
{part}
|
|
192
|
+
</a>
|
|
193
|
+
) : (
|
|
194
|
+
<span key={i}>{part}</span>
|
|
195
|
+
);
|
|
196
|
+
})}
|
|
197
|
+
</>
|
|
198
|
+
);
|
|
199
|
+
}
|