@strkfarm/sdk 1.0.18 → 1.0.19
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/cli.js +276 -90
- package/dist/cli.mjs +270 -84
- package/dist/index.browser.global.js +28402 -19296
- package/dist/index.browser.mjs +8064 -1366
- package/dist/index.d.ts +201 -24
- package/dist/index.js +7946 -1219
- package/dist/index.mjs +8096 -1377
- package/package.json +3 -1
- package/src/data/cl-vault.abi.json +1434 -0
- package/src/data/ekubo-math.abi.json +333 -0
- package/src/data/ekubo-positions.abi.json +1594 -0
- package/src/data/erc20.abi.json +1122 -0
- package/src/data/erc4626.abi.json +1530 -0
- package/src/dataTypes/_bignumber.ts +53 -0
- package/src/dataTypes/address.ts +4 -0
- package/src/dataTypes/bignumber.browser.ts +8 -0
- package/src/dataTypes/bignumber.node.ts +22 -0
- package/src/dataTypes/bignumber.ts +1 -55
- package/src/dataTypes/index.ts +1 -1
- package/src/global.ts +54 -4
- package/src/interfaces/common.ts +56 -9
- package/src/interfaces/lending.ts +1 -1
- package/src/modules/avnu.ts +93 -0
- package/src/modules/erc20.ts +23 -0
- package/src/modules/index.ts +2 -0
- package/src/modules/pricer.ts +1 -1
- package/src/modules/zkLend.ts +2 -2
- package/src/node/headless.browser.ts +9 -0
- package/src/node/headless.node.ts +36 -0
- package/src/node/headless.ts +1 -0
- package/src/node/index.ts +2 -1
- package/src/strategies/base-strategy.ts +47 -0
- package/src/strategies/ekubo-cl-vault.ts +535 -0
- package/src/strategies/index.ts +2 -1
- package/src/strategies/vesu-rebalance.ts +111 -25
package/dist/cli.mjs
CHANGED
|
@@ -63,6 +63,101 @@ import axios2 from "axios";
|
|
|
63
63
|
|
|
64
64
|
// src/global.ts
|
|
65
65
|
import axios from "axios";
|
|
66
|
+
|
|
67
|
+
// src/dataTypes/bignumber.node.ts
|
|
68
|
+
import util from "util";
|
|
69
|
+
|
|
70
|
+
// src/dataTypes/_bignumber.ts
|
|
71
|
+
import BigNumber from "bignumber.js";
|
|
72
|
+
var _Web3Number = class extends BigNumber {
|
|
73
|
+
constructor(value, decimals) {
|
|
74
|
+
super(value);
|
|
75
|
+
this.decimals = decimals;
|
|
76
|
+
}
|
|
77
|
+
toWei() {
|
|
78
|
+
return this.mul(10 ** this.decimals).toFixed(0);
|
|
79
|
+
}
|
|
80
|
+
multipliedBy(value) {
|
|
81
|
+
let _value = Number(value).toFixed(13);
|
|
82
|
+
return this.construct(this.mul(_value).toString(), this.decimals);
|
|
83
|
+
}
|
|
84
|
+
dividedBy(value) {
|
|
85
|
+
let _value = Number(value).toFixed(13);
|
|
86
|
+
return this.construct(this.div(_value).toString(), this.decimals);
|
|
87
|
+
}
|
|
88
|
+
plus(value) {
|
|
89
|
+
const _value = Number(value).toFixed(13);
|
|
90
|
+
return this.construct(this.add(_value).toString(), this.decimals);
|
|
91
|
+
}
|
|
92
|
+
minus(n, base) {
|
|
93
|
+
const _value = Number(n).toFixed(13);
|
|
94
|
+
return this.construct(super.minus(_value, base).toString(), this.decimals);
|
|
95
|
+
}
|
|
96
|
+
construct(value, decimals) {
|
|
97
|
+
return new this.constructor(value, decimals);
|
|
98
|
+
}
|
|
99
|
+
toString(base) {
|
|
100
|
+
return super.toString(base);
|
|
101
|
+
}
|
|
102
|
+
toJSON() {
|
|
103
|
+
return this.toString();
|
|
104
|
+
}
|
|
105
|
+
valueOf() {
|
|
106
|
+
return this.toString();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
BigNumber.config({ DECIMAL_PLACES: 18 });
|
|
110
|
+
_Web3Number.config({ DECIMAL_PLACES: 18 });
|
|
111
|
+
|
|
112
|
+
// src/dataTypes/bignumber.node.ts
|
|
113
|
+
var Web3Number = class _Web3Number2 extends _Web3Number {
|
|
114
|
+
static fromWei(weiNumber, decimals) {
|
|
115
|
+
const bn = new _Web3Number2(weiNumber, decimals).dividedBy(10 ** decimals);
|
|
116
|
+
return new _Web3Number2(bn.toString(), decimals);
|
|
117
|
+
}
|
|
118
|
+
[util.inspect.custom](depth, opts) {
|
|
119
|
+
return this.toString();
|
|
120
|
+
}
|
|
121
|
+
[Symbol.for("nodejs.util.inspect.custom")](depth, inspectOptions, inspect) {
|
|
122
|
+
return this.toString();
|
|
123
|
+
}
|
|
124
|
+
inspect(depth, opts) {
|
|
125
|
+
return this.toString();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// src/dataTypes/address.ts
|
|
130
|
+
import { num } from "starknet";
|
|
131
|
+
var ContractAddr = class _ContractAddr {
|
|
132
|
+
constructor(address) {
|
|
133
|
+
this.address = _ContractAddr.standardise(address);
|
|
134
|
+
}
|
|
135
|
+
static from(address) {
|
|
136
|
+
return new _ContractAddr(address);
|
|
137
|
+
}
|
|
138
|
+
eq(other) {
|
|
139
|
+
return this.address === other.address;
|
|
140
|
+
}
|
|
141
|
+
eqString(other) {
|
|
142
|
+
return this.address === _ContractAddr.standardise(other);
|
|
143
|
+
}
|
|
144
|
+
static standardise(address) {
|
|
145
|
+
let _a = address;
|
|
146
|
+
if (!address) {
|
|
147
|
+
_a = "0";
|
|
148
|
+
}
|
|
149
|
+
const a = num.getHexString(num.getDecimalString(_a.toString()));
|
|
150
|
+
return a;
|
|
151
|
+
}
|
|
152
|
+
static eqString(a, b) {
|
|
153
|
+
return _ContractAddr.standardise(a) === _ContractAddr.standardise(b);
|
|
154
|
+
}
|
|
155
|
+
toString() {
|
|
156
|
+
return this.address;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// src/global.ts
|
|
66
161
|
var logger = {
|
|
67
162
|
...console,
|
|
68
163
|
verbose(message) {
|
|
@@ -78,15 +173,51 @@ var FatalError = class extends Error {
|
|
|
78
173
|
this.name = "FatalError";
|
|
79
174
|
}
|
|
80
175
|
};
|
|
81
|
-
var
|
|
176
|
+
var defaultTokens = [{
|
|
82
177
|
name: "Starknet",
|
|
83
178
|
symbol: "STRK",
|
|
84
179
|
logo: "https://assets.coingecko.com/coins/images/26433/small/starknet.png",
|
|
85
|
-
address: "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
|
|
180
|
+
address: ContractAddr.from("0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"),
|
|
86
181
|
decimals: 18,
|
|
87
182
|
coingeckId: "starknet"
|
|
183
|
+
}, {
|
|
184
|
+
name: "xSTRK",
|
|
185
|
+
symbol: "xSTRK",
|
|
186
|
+
logo: "https://dashboard.endur.fi/endur-fi.svg",
|
|
187
|
+
address: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a"),
|
|
188
|
+
decimals: 18,
|
|
189
|
+
coingeckId: void 0
|
|
190
|
+
}, {
|
|
191
|
+
name: "ETH",
|
|
192
|
+
symbol: "ETH",
|
|
193
|
+
logo: "https://opbnb.bscscan.com/token/images/ether.svg",
|
|
194
|
+
address: ContractAddr.from("0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"),
|
|
195
|
+
decimals: 18,
|
|
196
|
+
coingeckId: void 0
|
|
197
|
+
}, {
|
|
198
|
+
name: "USDC",
|
|
199
|
+
symbol: "USDC",
|
|
200
|
+
logo: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
|
|
201
|
+
address: ContractAddr.from("0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"),
|
|
202
|
+
decimals: 6,
|
|
203
|
+
coingeckId: void 0
|
|
204
|
+
}, {
|
|
205
|
+
name: "USDT",
|
|
206
|
+
symbol: "USDT",
|
|
207
|
+
logo: "https://assets.coingecko.com/coins/images/325/small/Tether.png",
|
|
208
|
+
address: ContractAddr.from("0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8"),
|
|
209
|
+
decimals: 6,
|
|
210
|
+
coingeckId: void 0
|
|
211
|
+
}, {
|
|
212
|
+
name: "WBTC",
|
|
213
|
+
symbol: "WBTC",
|
|
214
|
+
logo: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",
|
|
215
|
+
address: ContractAddr.from("0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac"),
|
|
216
|
+
decimals: 8,
|
|
217
|
+
coingeckId: void 0
|
|
88
218
|
}];
|
|
89
|
-
var
|
|
219
|
+
var tokens = defaultTokens;
|
|
220
|
+
var Global = class _Global {
|
|
90
221
|
static fatalError(message, err) {
|
|
91
222
|
logger.error(message);
|
|
92
223
|
console.error(message, err);
|
|
@@ -112,7 +243,7 @@ var Global = class {
|
|
|
112
243
|
tokens.push({
|
|
113
244
|
name: token.name,
|
|
114
245
|
symbol: token.symbol,
|
|
115
|
-
address: token.address,
|
|
246
|
+
address: ContractAddr.from(token.address),
|
|
116
247
|
decimals: token.decimals,
|
|
117
248
|
logo: token.logoUri,
|
|
118
249
|
coingeckId: token.extensions.coingeckoId
|
|
@@ -126,71 +257,15 @@ var Global = class {
|
|
|
126
257
|
throw new FatalError(message);
|
|
127
258
|
}
|
|
128
259
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
import BigNumber from "bignumber.js";
|
|
133
|
-
var Web3Number = class _Web3Number extends BigNumber {
|
|
134
|
-
constructor(value, decimals) {
|
|
135
|
-
super(value);
|
|
136
|
-
this.decimals = decimals;
|
|
137
|
-
}
|
|
138
|
-
static fromWei(weiNumber, decimals) {
|
|
139
|
-
const bn = new _Web3Number(weiNumber, decimals).dividedBy(10 ** decimals);
|
|
140
|
-
return new _Web3Number(bn.toString(), decimals);
|
|
141
|
-
}
|
|
142
|
-
toWei() {
|
|
143
|
-
return this.mul(10 ** this.decimals).toFixed(0);
|
|
144
|
-
}
|
|
145
|
-
multipliedBy(value) {
|
|
146
|
-
let _value = Number(value).toFixed(6);
|
|
147
|
-
return new _Web3Number(this.mul(_value).toString(), this.decimals);
|
|
148
|
-
}
|
|
149
|
-
dividedBy(value) {
|
|
150
|
-
let _value = Number(value).toFixed(6);
|
|
151
|
-
return new _Web3Number(this.div(_value).toString(), this.decimals);
|
|
152
|
-
}
|
|
153
|
-
plus(value) {
|
|
154
|
-
return new _Web3Number(this.add(value).toString(), this.decimals);
|
|
155
|
-
}
|
|
156
|
-
minus(n, base) {
|
|
157
|
-
return new _Web3Number(super.minus(n, base).toString(), this.decimals);
|
|
158
|
-
}
|
|
159
|
-
toString(base) {
|
|
160
|
-
return super.toString(base);
|
|
161
|
-
}
|
|
162
|
-
// [customInspectSymbol](depth: any, inspectOptions: any, inspect: any) {
|
|
163
|
-
// return this.toString();
|
|
164
|
-
// }
|
|
165
|
-
};
|
|
166
|
-
BigNumber.config({ DECIMAL_PLACES: 18 });
|
|
167
|
-
Web3Number.config({ DECIMAL_PLACES: 18 });
|
|
168
|
-
|
|
169
|
-
// src/dataTypes/address.ts
|
|
170
|
-
import { num } from "starknet";
|
|
171
|
-
var ContractAddr = class _ContractAddr {
|
|
172
|
-
constructor(address) {
|
|
173
|
-
this.address = _ContractAddr.standardise(address);
|
|
174
|
-
}
|
|
175
|
-
static from(address) {
|
|
176
|
-
return new _ContractAddr(address);
|
|
177
|
-
}
|
|
178
|
-
eq(other) {
|
|
179
|
-
return this.address === other.address;
|
|
180
|
-
}
|
|
181
|
-
eqString(other) {
|
|
182
|
-
return this.address === _ContractAddr.standardise(other);
|
|
183
|
-
}
|
|
184
|
-
static standardise(address) {
|
|
185
|
-
let _a = address;
|
|
186
|
-
if (!address) {
|
|
187
|
-
_a = "0";
|
|
260
|
+
static async getTokenInfoFromAddr(addr) {
|
|
261
|
+
if (tokens.length == defaultTokens.length) {
|
|
262
|
+
await _Global.getTokens();
|
|
188
263
|
}
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return
|
|
264
|
+
const token = tokens.find((token2) => addr.eq(token2.address));
|
|
265
|
+
if (!token) {
|
|
266
|
+
throw new FatalError(`Token not found: ${addr.address}`);
|
|
267
|
+
}
|
|
268
|
+
return token;
|
|
194
269
|
}
|
|
195
270
|
};
|
|
196
271
|
|
|
@@ -200,6 +275,14 @@ import { Contract } from "starknet";
|
|
|
200
275
|
// src/modules/zkLend.ts
|
|
201
276
|
import axios3 from "axios";
|
|
202
277
|
|
|
278
|
+
// src/dataTypes/bignumber.browser.ts
|
|
279
|
+
var Web3Number2 = class _Web3Number2 extends _Web3Number {
|
|
280
|
+
static fromWei(weiNumber, decimals) {
|
|
281
|
+
const bn = new _Web3Number2(weiNumber, decimals).dividedBy(10 ** decimals);
|
|
282
|
+
return new _Web3Number2(bn.toString(), decimals);
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
203
286
|
// src/interfaces/lending.ts
|
|
204
287
|
var ILending = class {
|
|
205
288
|
constructor(config, metadata) {
|
|
@@ -241,18 +324,18 @@ var _ZkLend = class _ZkLend extends ILending {
|
|
|
241
324
|
const data = result.data;
|
|
242
325
|
const savedTokens = await Global.getTokens();
|
|
243
326
|
data.forEach((pool) => {
|
|
244
|
-
let collareralFactor = new
|
|
327
|
+
let collareralFactor = new Web3Number2(0, 0);
|
|
245
328
|
if (pool.collateral_factor) {
|
|
246
|
-
collareralFactor =
|
|
329
|
+
collareralFactor = Web3Number2.fromWei(pool.collateral_factor.value, pool.collateral_factor.decimals);
|
|
247
330
|
}
|
|
248
331
|
const savedTokenInfo = savedTokens.find((t) => t.symbol == pool.token.symbol);
|
|
249
332
|
const token = {
|
|
250
333
|
name: pool.token.name,
|
|
251
334
|
symbol: pool.token.symbol,
|
|
252
|
-
address: savedTokenInfo?.address || "",
|
|
335
|
+
address: savedTokenInfo?.address || ContractAddr.from(""),
|
|
253
336
|
logo: "",
|
|
254
337
|
decimals: pool.token.decimals,
|
|
255
|
-
borrowFactor:
|
|
338
|
+
borrowFactor: Web3Number2.fromWei(pool.borrow_factor.value, pool.borrow_factor.decimals),
|
|
256
339
|
collareralFactor
|
|
257
340
|
};
|
|
258
341
|
this.tokens.push(token);
|
|
@@ -273,7 +356,7 @@ var _ZkLend = class _ZkLend extends ILending {
|
|
|
273
356
|
async get_health_factor_tokenwise(lending_tokens, debt_tokens, user) {
|
|
274
357
|
const positions = await this.getPositions(user);
|
|
275
358
|
logger.verbose(`${this.metadata.name}:: Positions: ${JSON.stringify(positions)}`);
|
|
276
|
-
let effectiveDebt = new
|
|
359
|
+
let effectiveDebt = new Web3Number2(0, 6);
|
|
277
360
|
positions.filter((pos) => {
|
|
278
361
|
return debt_tokens.find((t) => t.symbol === pos.tokenSymbol);
|
|
279
362
|
}).forEach((pos) => {
|
|
@@ -287,7 +370,7 @@ var _ZkLend = class _ZkLend extends ILending {
|
|
|
287
370
|
if (effectiveDebt.isZero()) {
|
|
288
371
|
return Infinity;
|
|
289
372
|
}
|
|
290
|
-
let effectiveCollateral = new
|
|
373
|
+
let effectiveCollateral = new Web3Number2(0, 6);
|
|
291
374
|
positions.filter((pos) => {
|
|
292
375
|
const exp1 = lending_tokens.find((t) => t.symbol === pos.tokenSymbol);
|
|
293
376
|
const exp2 = pos.marginType === "shared" /* SHARED */;
|
|
@@ -340,8 +423,8 @@ var _ZkLend = class _ZkLend extends ILending {
|
|
|
340
423
|
if (!token) {
|
|
341
424
|
throw new FatalError(`Token ${pool.token_symbol} not found in ${this.metadata.name}`);
|
|
342
425
|
}
|
|
343
|
-
const debtAmount =
|
|
344
|
-
const supplyAmount =
|
|
426
|
+
const debtAmount = Web3Number2.fromWei(pool.data.debt_amount, token.decimals);
|
|
427
|
+
const supplyAmount = Web3Number2.fromWei(pool.data.supply_amount, token.decimals);
|
|
345
428
|
const price = (await this.pricer.getPrice(token.symbol)).price;
|
|
346
429
|
lendingPosition.push({
|
|
347
430
|
tokenName: token.name,
|
|
@@ -363,33 +446,136 @@ var ZkLend = _ZkLend;
|
|
|
363
446
|
// src/modules/pricer-from-api.ts
|
|
364
447
|
import axios4 from "axios";
|
|
365
448
|
|
|
449
|
+
// src/modules/erc20.ts
|
|
450
|
+
import { Contract as Contract2 } from "starknet";
|
|
451
|
+
|
|
452
|
+
// src/modules/avnu.ts
|
|
453
|
+
import { uint256 } from "starknet";
|
|
454
|
+
import { fetchBuildExecuteTransaction, fetchQuotes } from "@avnu/avnu-sdk";
|
|
455
|
+
|
|
366
456
|
// src/interfaces/common.ts
|
|
367
457
|
import { RpcProvider as RpcProvider2 } from "starknet";
|
|
368
458
|
|
|
369
459
|
// src/strategies/autoCompounderStrk.ts
|
|
370
|
-
import { Contract as
|
|
460
|
+
import { Contract as Contract3, uint256 as uint2562 } from "starknet";
|
|
371
461
|
|
|
372
462
|
// src/strategies/vesu-rebalance.ts
|
|
373
|
-
import { CairoCustomEnum, Contract as
|
|
463
|
+
import { CairoCustomEnum, Contract as Contract4, num as num2, uint256 as uint2563 } from "starknet";
|
|
464
|
+
|
|
465
|
+
// src/node/headless.browser.ts
|
|
374
466
|
import axios5 from "axios";
|
|
467
|
+
|
|
468
|
+
// src/strategies/vesu-rebalance.ts
|
|
375
469
|
var _description = "Automatically diversify {{TOKEN}} holdings into different Vesu pools while reducing risk and maximizing yield. Defi spring STRK Rewards are auto-compounded as well.";
|
|
376
470
|
var _protocol = { name: "Vesu", logo: "https://static-assets-8zct.onrender.com/integrations/vesu/logo.png" };
|
|
377
471
|
var _riskFactor = [
|
|
378
|
-
{ type: "
|
|
379
|
-
{ type: "
|
|
380
|
-
{ type: "
|
|
472
|
+
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 },
|
|
473
|
+
{ type: "Counterparty Risk" /* COUNTERPARTY_RISK */, value: 1, weight: 50 },
|
|
474
|
+
{ type: "Oracle Risk" /* ORACLE_RISK */, value: 0.5, weight: 25 }
|
|
381
475
|
];
|
|
382
476
|
var VesuRebalanceStrategies = [{
|
|
383
|
-
name: "Vesu STRK",
|
|
477
|
+
name: "Vesu Fusion STRK",
|
|
384
478
|
description: _description.replace("{{TOKEN}}", "STRK"),
|
|
385
|
-
address: ContractAddr.from("
|
|
479
|
+
address: ContractAddr.from("0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f"),
|
|
386
480
|
type: "ERC4626",
|
|
387
481
|
depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "STRK")],
|
|
388
482
|
protocols: [_protocol],
|
|
389
483
|
maxTVL: Web3Number.fromWei("0", 18),
|
|
390
484
|
risk: {
|
|
391
485
|
riskFactor: _riskFactor,
|
|
392
|
-
netRisk: _riskFactor.reduce((acc, curr) => acc + curr.value * curr.weight, 0) /
|
|
486
|
+
netRisk: _riskFactor.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor.reduce((acc, curr) => acc + curr.weight, 0)
|
|
487
|
+
},
|
|
488
|
+
additionalInfo: {
|
|
489
|
+
feeBps: 1e3
|
|
490
|
+
}
|
|
491
|
+
}, {
|
|
492
|
+
name: "Vesu Fusion ETH",
|
|
493
|
+
description: _description.replace("{{TOKEN}}", "ETH"),
|
|
494
|
+
address: ContractAddr.from("0x26ea414fdf74ace1df5bc5ac72cbac670d438ef19b31edf9d59f98718fc0ab2"),
|
|
495
|
+
type: "ERC4626",
|
|
496
|
+
depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "ETH")],
|
|
497
|
+
protocols: [_protocol],
|
|
498
|
+
maxTVL: Web3Number.fromWei("0", 18),
|
|
499
|
+
risk: {
|
|
500
|
+
riskFactor: _riskFactor,
|
|
501
|
+
netRisk: _riskFactor.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor.reduce((acc, curr) => acc + curr.weight, 0)
|
|
502
|
+
},
|
|
503
|
+
additionalInfo: {
|
|
504
|
+
feeBps: 1e3
|
|
505
|
+
}
|
|
506
|
+
}, {
|
|
507
|
+
name: "Vesu Fusion USDC",
|
|
508
|
+
description: _description.replace("{{TOKEN}}", "USDC"),
|
|
509
|
+
address: ContractAddr.from("0x3a69adeb993cddb266962d9c995e3d0641dab627df22b825fa31bda460c3c14"),
|
|
510
|
+
type: "ERC4626",
|
|
511
|
+
depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "USDC")],
|
|
512
|
+
protocols: [_protocol],
|
|
513
|
+
maxTVL: Web3Number.fromWei("0", 6),
|
|
514
|
+
risk: {
|
|
515
|
+
riskFactor: _riskFactor,
|
|
516
|
+
netRisk: _riskFactor.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor.reduce((acc, curr) => acc + curr.weight, 0)
|
|
517
|
+
},
|
|
518
|
+
additionalInfo: {
|
|
519
|
+
feeBps: 1e3
|
|
520
|
+
}
|
|
521
|
+
// }, {
|
|
522
|
+
// name: 'Vesu Fusion USDT',
|
|
523
|
+
// description: _description.replace('{{TOKEN}}', 'USDT'),
|
|
524
|
+
// address: ContractAddr.from('0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f'),
|
|
525
|
+
// type: 'ERC4626',
|
|
526
|
+
// depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'USDT')!],
|
|
527
|
+
// protocols: [_protocol],
|
|
528
|
+
// maxTVL: Web3Number.fromWei('0', 6),
|
|
529
|
+
// risk: {
|
|
530
|
+
// riskFactor: _riskFactor,
|
|
531
|
+
// netRisk: _riskFactor.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor.reduce((acc, curr) => acc + curr.weight, 0),
|
|
532
|
+
// },
|
|
533
|
+
// additionalInfo: {
|
|
534
|
+
// feeBps: 1000,
|
|
535
|
+
// },
|
|
536
|
+
// }, {
|
|
537
|
+
// name: 'Vesu Fusion WBTC',
|
|
538
|
+
// description: _description.replace('{{TOKEN}}', 'WBTC'),
|
|
539
|
+
// address: ContractAddr.from('0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f'),
|
|
540
|
+
// type: 'ERC4626',
|
|
541
|
+
// depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'WBTC')!],
|
|
542
|
+
// protocols: [_protocol],
|
|
543
|
+
// maxTVL: Web3Number.fromWei('0', 8),
|
|
544
|
+
// risk: {
|
|
545
|
+
// riskFactor: _riskFactor,
|
|
546
|
+
// netRisk: _riskFactor.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor.reduce((acc, curr) => acc + curr.weight, 0),
|
|
547
|
+
// },
|
|
548
|
+
// additionalInfo: {
|
|
549
|
+
// feeBps: 1000,
|
|
550
|
+
// },
|
|
551
|
+
}];
|
|
552
|
+
|
|
553
|
+
// src/strategies/ekubo-cl-vault.ts
|
|
554
|
+
import { Contract as Contract5, uint256 as uint2564 } from "starknet";
|
|
555
|
+
var _description2 = "Automatically rebalances liquidity near current price to maximize yield while reducing the necessity to manually rebalance positions frequently. Fees earn and Defi spring rewards are automatically re-invested.";
|
|
556
|
+
var _protocol2 = { name: "Ekubo", logo: "https://app.ekubo.org/favicon.ico" };
|
|
557
|
+
var _riskFactor2 = [
|
|
558
|
+
{ type: "Smart Contract Risk" /* SMART_CONTRACT_RISK */, value: 0.5, weight: 25 },
|
|
559
|
+
{ type: "Impermanent Loss Risk" /* IMPERMANENT_LOSS */, value: 1, weight: 75 }
|
|
560
|
+
];
|
|
561
|
+
var EkuboCLVaultStrategies = [{
|
|
562
|
+
name: "Ekubo xSTRK/STRK",
|
|
563
|
+
description: _description2,
|
|
564
|
+
address: ContractAddr.from("0x01f083b98674bc21effee29ef443a00c7b9a500fd92cf30341a3da12c73f2324"),
|
|
565
|
+
type: "Other",
|
|
566
|
+
depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "STRK"), Global.getDefaultTokens().find((t) => t.symbol === "xSTRK")],
|
|
567
|
+
protocols: [_protocol2],
|
|
568
|
+
maxTVL: Web3Number.fromWei("0", 18),
|
|
569
|
+
risk: {
|
|
570
|
+
riskFactor: _riskFactor2,
|
|
571
|
+
netRisk: _riskFactor2.reduce((acc, curr) => acc + curr.value * curr.weight, 0) / _riskFactor2.reduce((acc, curr) => acc + curr.weight, 0)
|
|
572
|
+
},
|
|
573
|
+
additionalInfo: {
|
|
574
|
+
newBounds: {
|
|
575
|
+
lower: -1,
|
|
576
|
+
upper: 1
|
|
577
|
+
},
|
|
578
|
+
lstContract: ContractAddr.from("0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a")
|
|
393
579
|
}
|
|
394
580
|
}];
|
|
395
581
|
|