@strkfarm/sdk 2.0.0-staging.4 → 2.0.0-staging.41
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 +10 -6
- package/dist/cli.mjs +10 -6
- package/dist/index.browser.global.js +29277 -26655
- package/dist/index.browser.mjs +4037 -1224
- package/dist/index.d.ts +287 -45
- package/dist/index.js +4316 -1489
- package/dist/index.mjs +4256 -1437
- package/package.json +4 -4
- package/src/data/yoloVault.abi.json +1109 -0
- package/src/dataTypes/_bignumber.ts +5 -0
- package/src/dataTypes/bignumber.browser.ts +5 -0
- package/src/dataTypes/bignumber.node.ts +5 -0
- package/src/global.ts +27 -0
- package/src/interfaces/common.tsx +68 -25
- package/src/modules/avnu.ts +1 -1
- package/src/modules/erc20.ts +18 -2
- package/src/strategies/base-strategy.ts +216 -6
- package/src/strategies/constants.ts +2 -2
- package/src/strategies/ekubo-cl-vault.tsx +210 -105
- package/src/strategies/factory.ts +21 -1
- package/src/strategies/index.ts +2 -0
- package/src/strategies/registry.ts +15 -30
- package/src/strategies/sensei.ts +156 -11
- package/src/strategies/types.ts +4 -0
- package/src/strategies/universal-adapters/vesu-adapter.ts +48 -27
- package/src/strategies/universal-lst-muliplier-strategy.tsx +1473 -574
- package/src/strategies/universal-strategy.tsx +141 -69
- package/src/strategies/vesu-rebalance.tsx +27 -11
- package/src/strategies/yoloVault.ts +747 -0
- package/src/utils/logger.node.ts +11 -4
- package/src/utils/strategy-utils.ts +6 -2
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { ContractAddr, Web3Number } from "@/dataTypes";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
BaseStrategy,
|
|
4
|
+
SingleActionAmount,
|
|
5
|
+
SingleTokenInfo,
|
|
6
|
+
UserPositionCard,
|
|
7
|
+
UserPositionCardsInput,
|
|
8
|
+
} from "./base-strategy";
|
|
3
9
|
import { PricerBase } from "@/modules/pricerBase";
|
|
4
|
-
import { FAQ, getNoRiskTags, IConfig, IStrategyMetadata, Protocols, RiskFactor, RiskType,
|
|
10
|
+
import { FAQ, getNoRiskTags, IConfig, IStrategyMetadata, Protocols, RiskFactor, RiskType, StrategyTag, VaultPosition, AuditStatus, SourceCodeType, AccessControlType, InstantWithdrawalVault, StrategyLiveStatus, StrategySettings, VaultType, RedemptionInfo, UnwrapLabsCurator } from "@/interfaces";
|
|
5
11
|
import { BlockIdentifier, Call, CallData, Contract, num, uint256 } from "starknet";
|
|
6
12
|
import { VesuRebalanceSettings } from "./vesu-rebalance";
|
|
7
13
|
import { assert, LeafData, logger, StandardMerkleTree } from "@/utils";
|
|
@@ -11,6 +17,7 @@ import { ApproveCallParams, AvnuSwapCallParams, BaseAdapter, CommonAdapter, Flas
|
|
|
11
17
|
import { Global } from "@/global";
|
|
12
18
|
import { AvnuWrapper, ERC20 } from "@/modules";
|
|
13
19
|
import { AVNU_MIDDLEWARE, VESU_SINGLETON } from "./universal-adapters/adapter-utils";
|
|
20
|
+
import { LSTPriceType } from "./types";
|
|
14
21
|
import { HarvestInfo, VesuHarvests } from "@/modules/harvests";
|
|
15
22
|
|
|
16
23
|
export interface UniversalManageCall {
|
|
@@ -212,7 +219,7 @@ export class UniversalStrategy<
|
|
|
212
219
|
});
|
|
213
220
|
logger.verbose(`${this.metadata.name}::netAPY: vesu-pools: ${JSON.stringify(pools)}`);
|
|
214
221
|
if (pools.some(p => !p)) {
|
|
215
|
-
throw new Error(
|
|
222
|
+
throw new Error(`Pool not found`);
|
|
216
223
|
};
|
|
217
224
|
const positions = await this.getVesuPositions();
|
|
218
225
|
logger.verbose(`${this.metadata.name}::netAPY: positions: ${JSON.stringify(positions)}`);
|
|
@@ -403,6 +410,52 @@ export class UniversalStrategy<
|
|
|
403
410
|
return (apyForGivenBlocks * (365 * 24 * 3600)) / timeDiffSeconds;
|
|
404
411
|
}
|
|
405
412
|
|
|
413
|
+
async getUserPositionCards(input: UserPositionCardsInput): Promise<UserPositionCard[]> {
|
|
414
|
+
const { user, investmentFlows = [] } = input;
|
|
415
|
+
const [userTVL] = await Promise.all([
|
|
416
|
+
this.getUserTVL(user),
|
|
417
|
+
]);
|
|
418
|
+
const cards: UserPositionCard[] = [
|
|
419
|
+
{
|
|
420
|
+
title: "Your Holdings",
|
|
421
|
+
tooltip: "Your Holdings",
|
|
422
|
+
value: this.formatTokenAmountForCard(userTVL.amount, userTVL.tokenInfo),
|
|
423
|
+
subValue: `≈ ${this.formatUSDForCard(userTVL.usdValue)}`,
|
|
424
|
+
subValueColor: "positive",
|
|
425
|
+
},
|
|
426
|
+
];
|
|
427
|
+
|
|
428
|
+
let lifetimeAmount = userTVL.amount.multipliedBy(0);
|
|
429
|
+
let lifetimeTokenInfo = userTVL.tokenInfo;
|
|
430
|
+
let lifetimeUsdValue = 0;
|
|
431
|
+
if (investmentFlows.length > 0) {
|
|
432
|
+
try {
|
|
433
|
+
const earningsResult = this.getLifetimeEarnings(userTVL, investmentFlows);
|
|
434
|
+
lifetimeAmount = earningsResult.lifetimeEarnings;
|
|
435
|
+
lifetimeTokenInfo = earningsResult.tokenInfo.tokenInfo;
|
|
436
|
+
const userAmount = userTVL.amount.toNumber();
|
|
437
|
+
if (Number.isFinite(userAmount) && userAmount > 0) {
|
|
438
|
+
const pricePerToken = userTVL.usdValue / userAmount;
|
|
439
|
+
lifetimeUsdValue = lifetimeAmount.toNumber() * pricePerToken;
|
|
440
|
+
}
|
|
441
|
+
} catch (error) {
|
|
442
|
+
logger.warn(`${this.getTag()}::getUserPositionCards lifetime earnings fallback`, error);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
cards.push({
|
|
447
|
+
title: "Lifetime Earnings",
|
|
448
|
+
tooltip: "Lifetime Earnings",
|
|
449
|
+
value: this.formatTokenAmountForCard(lifetimeAmount, lifetimeTokenInfo),
|
|
450
|
+
subValue: `≈ ${this.formatUSDForCard(lifetimeUsdValue)}`,
|
|
451
|
+
subValueColor: this.getSubValueColorFromSignedNumber(lifetimeUsdValue),
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
cards.push(await this.createApyCard(input));
|
|
455
|
+
|
|
456
|
+
return cards;
|
|
457
|
+
}
|
|
458
|
+
|
|
406
459
|
/**
|
|
407
460
|
* Calculates the total TVL of the strategy.
|
|
408
461
|
* @returns Object containing the total amount in token units and USD value
|
|
@@ -435,7 +488,7 @@ export class UniversalStrategy<
|
|
|
435
488
|
};
|
|
436
489
|
}
|
|
437
490
|
|
|
438
|
-
protected async getVesuAUM(adapter: VesuAdapter) {
|
|
491
|
+
protected async getVesuAUM(adapter: VesuAdapter, _priceType?: LSTPriceType) {
|
|
439
492
|
const legAUM = await adapter.getPositions(this.config);
|
|
440
493
|
const underlying = this.asset();
|
|
441
494
|
let vesuAum = Web3Number.fromWei("0", underlying.decimals);
|
|
@@ -468,7 +521,7 @@ export class UniversalStrategy<
|
|
|
468
521
|
return prevAum;
|
|
469
522
|
}
|
|
470
523
|
|
|
471
|
-
async getAUM(): Promise<{net: SingleTokenInfo, prevAum: Web3Number, splits: {id: string, aum: Web3Number}[]}> {
|
|
524
|
+
async getAUM(unrealizedAUM?: boolean): Promise<{net: SingleTokenInfo, prevAum: Web3Number, splits: {id: string, aum: Web3Number}[]}> {
|
|
472
525
|
const prevAum = await this.getPrevAUM();
|
|
473
526
|
const token1Price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
474
527
|
|
|
@@ -476,7 +529,9 @@ export class UniversalStrategy<
|
|
|
476
529
|
const vesuAdapters = this.getVesuAdapters();
|
|
477
530
|
let vesuAum = Web3Number.fromWei("0", this.asset().decimals);
|
|
478
531
|
for (const adapter of vesuAdapters) {
|
|
479
|
-
|
|
532
|
+
const priceType = unrealizedAUM ? LSTPriceType.ENDUR_PRICE : LSTPriceType.AVNU_PRICE;
|
|
533
|
+
const aumValue = await this.getVesuAUM(adapter, priceType);
|
|
534
|
+
vesuAum = vesuAum.plus(aumValue);
|
|
480
535
|
}
|
|
481
536
|
|
|
482
537
|
// account unused balance as aum as well (from vault allocator)
|
|
@@ -1095,7 +1150,6 @@ export default function MetaVaultDescription(allowedSources: AllowedSources[]) {
|
|
|
1095
1150
|
const containerStyle = {
|
|
1096
1151
|
maxWidth: "800px",
|
|
1097
1152
|
margin: "0 auto",
|
|
1098
|
-
backgroundColor: "#111",
|
|
1099
1153
|
color: "#eee",
|
|
1100
1154
|
fontFamily: "Arial, sans-serif",
|
|
1101
1155
|
borderRadius: "12px",
|
|
@@ -1122,7 +1176,6 @@ export default function MetaVaultDescription(allowedSources: AllowedSources[]) {
|
|
|
1122
1176
|
<h1 style={{ fontSize: "18px", marginBottom: "10px" }}>Meta Vault — Automated Yield Router</h1>
|
|
1123
1177
|
<p style={{ fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }}>
|
|
1124
1178
|
This Evergreen vault is a tokenized Meta Vault, auto-compounding strategy that continuously allocates your deposited
|
|
1125
|
-
asset to the best available yield source in the ecosystem. Depositors receive vault shares that
|
|
1126
1179
|
represent a proportional claim on the underlying assets and accrued yield. Allocation shifts are
|
|
1127
1180
|
handled programmatically based on on-chain signals and risk filters, minimizing idle capital and
|
|
1128
1181
|
maximizing net APY.
|
|
@@ -1253,25 +1306,28 @@ const getUniversalRisk = () => ({
|
|
|
1253
1306
|
const createUniversalSettings = (
|
|
1254
1307
|
tokenSymbol: string,
|
|
1255
1308
|
maxTVLDecimals: number
|
|
1256
|
-
): StrategySettings =>
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1309
|
+
): StrategySettings => {
|
|
1310
|
+
const isUSDT = tokenSymbol === "USDT";
|
|
1311
|
+
return {
|
|
1312
|
+
maxTVL: Web3Number.fromWei(0, maxTVLDecimals),
|
|
1313
|
+
isAudited: true,
|
|
1314
|
+
liveStatus: isUSDT ? StrategyLiveStatus.RETIRED : StrategyLiveStatus.ACTIVE,
|
|
1315
|
+
isPaused: isUSDT,
|
|
1316
|
+
isInstantWithdrawal: false,
|
|
1317
|
+
hideHarvestInfo: true,
|
|
1318
|
+
quoteToken: Global.getDefaultTokens().find(
|
|
1319
|
+
(token) => token.symbol === tokenSymbol
|
|
1320
|
+
)!,
|
|
1321
|
+
alerts: [
|
|
1322
|
+
{
|
|
1323
|
+
tab: "withdraw" as const,
|
|
1324
|
+
text: "On withdrawal, you will receive an NFT representing your withdrawal request. The funds will be automatically sent to your wallet (NFT owner) in 1-2 hours. You can monitor the status in transactions tab.",
|
|
1325
|
+
type: "info" as const
|
|
1326
|
+
}
|
|
1327
|
+
],
|
|
1328
|
+
showWithdrawalWarningModal: true
|
|
1329
|
+
};
|
|
1330
|
+
};
|
|
1275
1331
|
|
|
1276
1332
|
const EVERGREEN_SECURITY = {
|
|
1277
1333
|
auditStatus: AuditStatus.AUDITED,
|
|
@@ -1281,18 +1337,21 @@ const EVERGREEN_SECURITY = {
|
|
|
1281
1337
|
},
|
|
1282
1338
|
accessControl: {
|
|
1283
1339
|
type: AccessControlType.STANDARD_ACCOUNT,
|
|
1284
|
-
addresses: [ContractAddr.from("
|
|
1285
|
-
timeLock: "2 Days",
|
|
1340
|
+
addresses: [ContractAddr.from("0x03495DD1e4838aa06666aac236036D86E81A6553e222FC02e70C2Cbc0062e8d0")],
|
|
1286
1341
|
},
|
|
1287
1342
|
};
|
|
1288
1343
|
|
|
1289
|
-
const EVERGREEN_REDEMPTION_INFO = {
|
|
1344
|
+
const EVERGREEN_REDEMPTION_INFO: RedemptionInfo = {
|
|
1290
1345
|
instantWithdrawalVault: InstantWithdrawalVault.NO,
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1346
|
+
redemptionsInfo: [{
|
|
1347
|
+
title: "Typical Duration",
|
|
1348
|
+
description: "1-2 hours"
|
|
1349
|
+
}],
|
|
1350
|
+
alerts: [{
|
|
1351
|
+
type: 'info',
|
|
1352
|
+
text: 'In cases of low liquidity, high slippages, the redemptions can take longer time. Redemption times are estimates and may vary based on network conditions and liquidity requirements.',
|
|
1353
|
+
tab: 'withdraw'
|
|
1354
|
+
}]
|
|
1296
1355
|
};
|
|
1297
1356
|
|
|
1298
1357
|
// Helper to create a Universal strategy
|
|
@@ -1305,35 +1364,48 @@ const createUniversalStrategy = (params: {
|
|
|
1305
1364
|
maxTVLDecimals: number;
|
|
1306
1365
|
allowedSources: AllowedSources[];
|
|
1307
1366
|
tags: StrategyTag[];
|
|
1308
|
-
}): IStrategyMetadata<UniversalStrategySettings> =>
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1367
|
+
}): IStrategyMetadata<UniversalStrategySettings> => {
|
|
1368
|
+
const isUSDT = params.tokenSymbol === "USDT";
|
|
1369
|
+
return {
|
|
1370
|
+
id: `evergreen_${params.tokenSymbol.toLowerCase()}`,
|
|
1371
|
+
name: `${params.tokenSymbol} Evergreen`,
|
|
1372
|
+
description: getDescription(params.tokenSymbol, params.allowedSources),
|
|
1373
|
+
address: ContractAddr.from(params.address),
|
|
1374
|
+
launchBlock: 0,
|
|
1375
|
+
type: "ERC4626" as const,
|
|
1376
|
+
vaultType: {
|
|
1377
|
+
type: VaultType.META_VAULT,
|
|
1378
|
+
description: "Automatically allocates funds to the best available yield source in the ecosystem"
|
|
1379
|
+
},
|
|
1380
|
+
depositTokens: [
|
|
1381
|
+
Global.getDefaultTokens().find((token) => token.symbol === params.tokenSymbol)!
|
|
1382
|
+
],
|
|
1383
|
+
additionalInfo: getLooperSettings(
|
|
1384
|
+
params.token1Symbol,
|
|
1385
|
+
params.token2Symbol,
|
|
1386
|
+
params.vaultSettings,
|
|
1387
|
+
VesuPools.Genesis,
|
|
1388
|
+
VesuPools.Genesis
|
|
1389
|
+
),
|
|
1390
|
+
risk: getUniversalRisk(),
|
|
1391
|
+
auditUrl: AUDIT_URL,
|
|
1392
|
+
protocols: [Protocols.VESU],
|
|
1393
|
+
realizedApyMethodology: "The realizedAPY is based on past 14 days performance by the vault",
|
|
1394
|
+
curator: UnwrapLabsCurator,
|
|
1395
|
+
settings: createUniversalSettings(params.tokenSymbol, params.maxTVLDecimals),
|
|
1396
|
+
contractDetails: getContractDetails(params.vaultSettings),
|
|
1397
|
+
faqs: getFAQs(),
|
|
1398
|
+
investmentSteps: investmentSteps,
|
|
1399
|
+
tags: params.tags,
|
|
1400
|
+
security: EVERGREEN_SECURITY,
|
|
1401
|
+
redemptionInfo: EVERGREEN_REDEMPTION_INFO,
|
|
1402
|
+
discontinuationInfo: isUSDT ? {
|
|
1403
|
+
info: "This strategy has been retired and is no longer accepting new deposits."
|
|
1404
|
+
} : undefined,
|
|
1405
|
+
usualTimeToEarnings: null,
|
|
1406
|
+
usualTimeToEarningsDescription: null,
|
|
1407
|
+
};
|
|
1408
|
+
};
|
|
1337
1409
|
|
|
1338
1410
|
export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[] =
|
|
1339
1411
|
[
|
|
@@ -1345,7 +1417,7 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1345
1417
|
token2Symbol: "ETH",
|
|
1346
1418
|
maxTVLDecimals: 6,
|
|
1347
1419
|
allowedSources: ["vesu", "extended"],
|
|
1348
|
-
tags: [StrategyTag.
|
|
1420
|
+
tags: [StrategyTag.META_VAULT]
|
|
1349
1421
|
}),
|
|
1350
1422
|
createUniversalStrategy({
|
|
1351
1423
|
tokenSymbol: "WBTC",
|
|
@@ -1355,7 +1427,7 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1355
1427
|
token2Symbol: "ETH",
|
|
1356
1428
|
maxTVLDecimals: 8,
|
|
1357
1429
|
allowedSources: ["vesu", "endur", "extended"],
|
|
1358
|
-
tags: [StrategyTag.BTC, StrategyTag.
|
|
1430
|
+
tags: [StrategyTag.BTC, StrategyTag.META_VAULT]
|
|
1359
1431
|
}),
|
|
1360
1432
|
createUniversalStrategy({
|
|
1361
1433
|
tokenSymbol: "ETH",
|
|
@@ -1365,7 +1437,7 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1365
1437
|
token2Symbol: "WBTC",
|
|
1366
1438
|
maxTVLDecimals: 18,
|
|
1367
1439
|
allowedSources: ["vesu", "extended"],
|
|
1368
|
-
tags: [StrategyTag.
|
|
1440
|
+
tags: [StrategyTag.META_VAULT]
|
|
1369
1441
|
}),
|
|
1370
1442
|
createUniversalStrategy({
|
|
1371
1443
|
tokenSymbol: "STRK",
|
|
@@ -1375,7 +1447,7 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1375
1447
|
token2Symbol: "ETH",
|
|
1376
1448
|
maxTVLDecimals: 18,
|
|
1377
1449
|
allowedSources: ["vesu", "endur", "extended"],
|
|
1378
|
-
tags: [StrategyTag.
|
|
1450
|
+
tags: [StrategyTag.META_VAULT]
|
|
1379
1451
|
}),
|
|
1380
1452
|
createUniversalStrategy({
|
|
1381
1453
|
tokenSymbol: "USDT",
|
|
@@ -1385,6 +1457,6 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1385
1457
|
token2Symbol: "ETH",
|
|
1386
1458
|
maxTVLDecimals: 6,
|
|
1387
1459
|
allowedSources: ["vesu"],
|
|
1388
|
-
tags: [StrategyTag.
|
|
1460
|
+
tags: [StrategyTag.META_VAULT]
|
|
1389
1461
|
})
|
|
1390
1462
|
];
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
IStrategyMetadata,
|
|
11
11
|
RiskFactor,
|
|
12
12
|
RiskType,
|
|
13
|
-
StrategyCategory,
|
|
14
13
|
StrategyTag,
|
|
15
14
|
AuditStatus,
|
|
16
15
|
SourceCodeType,
|
|
@@ -18,6 +17,8 @@ import {
|
|
|
18
17
|
InstantWithdrawalVault,
|
|
19
18
|
StrategySettings,
|
|
20
19
|
StrategyLiveStatus,
|
|
20
|
+
VaultType,
|
|
21
|
+
UnwrapLabsCurator,
|
|
21
22
|
} from "@/interfaces";
|
|
22
23
|
import { AvnuWrapper, Pricer, SwapInfo } from "@/modules";
|
|
23
24
|
import { Account, CairoCustomEnum, Contract, num, uint256, BlockIdentifier } from "starknet";
|
|
@@ -35,7 +36,7 @@ import {
|
|
|
35
36
|
import { getAPIUsingHeadlessBrowser } from "@/node/headless";
|
|
36
37
|
import { HarvestInfo, VesuHarvests } from "@/modules/harvests";
|
|
37
38
|
import VesuPoolIDs from "@/data/vesu_pools.json";
|
|
38
|
-
import {
|
|
39
|
+
import { ENDPOINTS } from "./constants";
|
|
39
40
|
|
|
40
41
|
interface PoolProps {
|
|
41
42
|
pool_id: ContractAddr;
|
|
@@ -334,7 +335,7 @@ export class VesuRebalance extends BaseStrategy<
|
|
|
334
335
|
}
|
|
335
336
|
|
|
336
337
|
static async getAllPossibleVerifiedPools(asset: ContractAddr) {
|
|
337
|
-
const data = await getAPIUsingHeadlessBrowser(`${ENDPOINTS.
|
|
338
|
+
const data = await getAPIUsingHeadlessBrowser(`${ENDPOINTS.VESU_BASE}/pools`);
|
|
338
339
|
const verifiedPools = data.data.filter((d: any) => d.isVerified);
|
|
339
340
|
const pools = verifiedPools
|
|
340
341
|
.map((p: any) => {
|
|
@@ -600,7 +601,7 @@ export class VesuRebalance extends BaseStrategy<
|
|
|
600
601
|
let pools: any[] = [];
|
|
601
602
|
try {
|
|
602
603
|
const data = await getAPIUsingHeadlessBrowser(
|
|
603
|
-
`${ENDPOINTS.
|
|
604
|
+
`${ENDPOINTS.VESU_BASE}/pools`
|
|
604
605
|
);
|
|
605
606
|
pools = data.data;
|
|
606
607
|
|
|
@@ -1033,7 +1034,7 @@ const createVesuRebalanceSettings = (tokenSymbol: string): StrategySettings => {
|
|
|
1033
1034
|
return {
|
|
1034
1035
|
maxTVL: Web3Number.fromWei("0", depositToken.decimals),
|
|
1035
1036
|
isPaused: false,
|
|
1036
|
-
liveStatus: StrategyLiveStatus.
|
|
1037
|
+
liveStatus: StrategyLiveStatus.DEPRECATED,
|
|
1037
1038
|
isAudited: true,
|
|
1038
1039
|
isInstantWithdrawal: true,
|
|
1039
1040
|
quoteToken: depositToken,
|
|
@@ -1043,21 +1044,27 @@ const createVesuRebalanceSettings = (tokenSymbol: string): StrategySettings => {
|
|
|
1043
1044
|
|
|
1044
1045
|
// Helper to create a Vesu Rebalance strategy
|
|
1045
1046
|
const createVesuRebalanceStrategy = (
|
|
1047
|
+
idSymbol: string,
|
|
1046
1048
|
name: string,
|
|
1047
1049
|
tokenSymbol: string,
|
|
1048
1050
|
address: string
|
|
1049
1051
|
): IStrategyMetadata<VesuRebalanceSettings> => ({
|
|
1050
|
-
id: `vesu_fusion_${
|
|
1052
|
+
id: `vesu_fusion_${idSymbol.toLowerCase()}`,
|
|
1051
1053
|
name,
|
|
1052
1054
|
description: _description.replace("{{TOKEN}}", tokenSymbol),
|
|
1053
1055
|
address: ContractAddr.from(address),
|
|
1054
1056
|
launchBlock: 0,
|
|
1055
1057
|
type: "ERC4626" as const,
|
|
1058
|
+
vaultType: {
|
|
1059
|
+
type: VaultType.META_VAULT,
|
|
1060
|
+
description: `Automatically diversify ${tokenSymbol} holdings into different Vesu pools while reducing risk and maximizing yield. Defi spring ${tokenSymbol} Rewards are auto-compounded as well.`
|
|
1061
|
+
},
|
|
1056
1062
|
depositTokens: [
|
|
1057
1063
|
Global.getDefaultTokens().find((t) => t.symbol === tokenSymbol)!
|
|
1058
1064
|
],
|
|
1059
1065
|
protocols: [_protocol],
|
|
1060
1066
|
auditUrl: AUDIT_URL,
|
|
1067
|
+
curator: UnwrapLabsCurator,
|
|
1061
1068
|
settings: createVesuRebalanceSettings(tokenSymbol),
|
|
1062
1069
|
risk: getVesuRebalanceRisk(),
|
|
1063
1070
|
additionalInfo: {
|
|
@@ -1066,10 +1073,14 @@ const createVesuRebalanceStrategy = (
|
|
|
1066
1073
|
faqs,
|
|
1067
1074
|
contractDetails: [],
|
|
1068
1075
|
investmentSteps: [],
|
|
1069
|
-
tags: [
|
|
1070
|
-
category: StrategyCategory.ALL,
|
|
1076
|
+
tags: [],
|
|
1071
1077
|
security: VESU_SECURITY,
|
|
1072
1078
|
redemptionInfo: VESU_REDEMPTION_INFO,
|
|
1079
|
+
discontinuationInfo: {
|
|
1080
|
+
info: "This strategy has been deprecated and is no longer accepting new deposits."
|
|
1081
|
+
},
|
|
1082
|
+
usualTimeToEarnings: null,
|
|
1083
|
+
usualTimeToEarningsDescription: null,
|
|
1073
1084
|
});
|
|
1074
1085
|
|
|
1075
1086
|
// Shared security & redemption metadata for all Vesu strategies
|
|
@@ -1080,7 +1091,7 @@ const VESU_SECURITY = {
|
|
|
1080
1091
|
contractLink: "https://github.com/trovesfi/troves-contracts",
|
|
1081
1092
|
},
|
|
1082
1093
|
accessControl: {
|
|
1083
|
-
type: AccessControlType.
|
|
1094
|
+
type: AccessControlType.ROLE_BASED_ACCESS,
|
|
1084
1095
|
addresses: [ContractAddr.from("0x0")],
|
|
1085
1096
|
timeLock: "2 Days",
|
|
1086
1097
|
},
|
|
@@ -1088,6 +1099,8 @@ const VESU_SECURITY = {
|
|
|
1088
1099
|
|
|
1089
1100
|
const VESU_REDEMPTION_INFO = {
|
|
1090
1101
|
instantWithdrawalVault: InstantWithdrawalVault.YES,
|
|
1102
|
+
redemptionsInfo: [],
|
|
1103
|
+
alerts: [],
|
|
1091
1104
|
};
|
|
1092
1105
|
|
|
1093
1106
|
const faqs: FAQ[] = [
|
|
@@ -1143,21 +1156,25 @@ const faqs: FAQ[] = [
|
|
|
1143
1156
|
export const VesuRebalanceStrategies: IStrategyMetadata<VesuRebalanceSettings>[] =
|
|
1144
1157
|
[
|
|
1145
1158
|
createVesuRebalanceStrategy(
|
|
1159
|
+
'strk',
|
|
1146
1160
|
"Vesu Fusion STRK",
|
|
1147
1161
|
"STRK",
|
|
1148
1162
|
"0x7fb5bcb8525954a60fde4e8fb8220477696ce7117ef264775a1770e23571929"
|
|
1149
1163
|
),
|
|
1150
1164
|
createVesuRebalanceStrategy(
|
|
1165
|
+
'eth',
|
|
1151
1166
|
"Vesu Fusion ETH",
|
|
1152
1167
|
"ETH",
|
|
1153
1168
|
"0x5eaf5ee75231cecf79921ff8ded4b5ffe96be718bcb3daf206690ad1a9ad0ca"
|
|
1154
1169
|
),
|
|
1155
1170
|
createVesuRebalanceStrategy(
|
|
1171
|
+
'usdc',
|
|
1156
1172
|
"Vesu Fusion USDC.e",
|
|
1157
1173
|
"USDC.e",
|
|
1158
1174
|
"0xa858c97e9454f407d1bd7c57472fc8d8d8449a777c822b41d18e387816f29c"
|
|
1159
1175
|
),
|
|
1160
1176
|
createVesuRebalanceStrategy(
|
|
1177
|
+
'usdt',
|
|
1161
1178
|
"Vesu Fusion USDT",
|
|
1162
1179
|
"USDT",
|
|
1163
1180
|
"0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"
|
|
@@ -1171,8 +1188,7 @@ VesuRebalanceStrategies.forEach((s) => {
|
|
|
1171
1188
|
address: s.address,
|
|
1172
1189
|
name: "Vault",
|
|
1173
1190
|
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/tree/main/src/strategies/vesu_rebalance"
|
|
1174
|
-
}
|
|
1175
|
-
...COMMON_CONTRACTS];
|
|
1191
|
+
}];
|
|
1176
1192
|
// set docs link
|
|
1177
1193
|
s.docs = "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults"
|
|
1178
1194
|
|