@strkfarm/sdk 2.0.0-staging.6 → 2.0.0-staging.60
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 +9 -5
- package/dist/cli.mjs +9 -5
- package/dist/index.browser.global.js +2994 -990
- package/dist/index.browser.mjs +2669 -658
- package/dist/index.d.ts +323 -47
- package/dist/index.js +2772 -746
- package/dist/index.mjs +2680 -663
- package/package.json +4 -4
- package/src/data/universal-vault.abi.json +143 -27
- 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 +48 -1
- package/src/interfaces/common.tsx +83 -26
- package/src/modules/avnu.ts +1 -1
- package/src/modules/erc20.ts +18 -2
- package/src/modules/index.ts +2 -1
- package/src/strategies/base-strategy.ts +153 -8
- package/src/strategies/constants.ts +2 -2
- package/src/strategies/ekubo-cl-vault.tsx +266 -103
- 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 +54 -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 +1461 -580
- package/src/strategies/universal-strategy.tsx +144 -77
- package/src/strategies/vesu-rebalance.tsx +27 -12
- package/src/strategies/yoloVault.ts +1063 -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,50 @@ 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
|
+
return cards;
|
|
455
|
+
}
|
|
456
|
+
|
|
406
457
|
/**
|
|
407
458
|
* Calculates the total TVL of the strategy.
|
|
408
459
|
* @returns Object containing the total amount in token units and USD value
|
|
@@ -424,6 +475,11 @@ export class UniversalStrategy<
|
|
|
424
475
|
};
|
|
425
476
|
}
|
|
426
477
|
|
|
478
|
+
async getMaxTVL(): Promise<Web3Number> {
|
|
479
|
+
// This strategy doesn't have a maxTVL so returning 0 simply
|
|
480
|
+
return new Web3Number('0', 18);
|
|
481
|
+
}
|
|
482
|
+
|
|
427
483
|
async getUnusedBalance(): Promise<SingleTokenInfo> {
|
|
428
484
|
const balance = await (new ERC20(this.config)).balanceOf(this.asset().address, this.metadata.additionalInfo.vaultAllocator, this.asset().decimals);
|
|
429
485
|
const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
@@ -435,7 +491,7 @@ export class UniversalStrategy<
|
|
|
435
491
|
};
|
|
436
492
|
}
|
|
437
493
|
|
|
438
|
-
protected async getVesuAUM(adapter: VesuAdapter) {
|
|
494
|
+
protected async getVesuAUM(adapter: VesuAdapter, _priceType?: LSTPriceType) {
|
|
439
495
|
const legAUM = await adapter.getPositions(this.config);
|
|
440
496
|
const underlying = this.asset();
|
|
441
497
|
let vesuAum = Web3Number.fromWei("0", underlying.decimals);
|
|
@@ -468,7 +524,7 @@ export class UniversalStrategy<
|
|
|
468
524
|
return prevAum;
|
|
469
525
|
}
|
|
470
526
|
|
|
471
|
-
async getAUM(): Promise<{net: SingleTokenInfo, prevAum: Web3Number, splits: {id: string, aum: Web3Number}[]}> {
|
|
527
|
+
async getAUM(unrealizedAUM?: boolean): Promise<{net: SingleTokenInfo, prevAum: Web3Number, splits: {id: string, aum: Web3Number}[]}> {
|
|
472
528
|
const prevAum = await this.getPrevAUM();
|
|
473
529
|
const token1Price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
|
|
474
530
|
|
|
@@ -476,7 +532,9 @@ export class UniversalStrategy<
|
|
|
476
532
|
const vesuAdapters = this.getVesuAdapters();
|
|
477
533
|
let vesuAum = Web3Number.fromWei("0", this.asset().decimals);
|
|
478
534
|
for (const adapter of vesuAdapters) {
|
|
479
|
-
|
|
535
|
+
const priceType = unrealizedAUM ? LSTPriceType.ENDUR_PRICE : LSTPriceType.AVNU_PRICE;
|
|
536
|
+
const aumValue = await this.getVesuAUM(adapter, priceType);
|
|
537
|
+
vesuAum = vesuAum.plus(aumValue);
|
|
480
538
|
}
|
|
481
539
|
|
|
482
540
|
// account unused balance as aum as well (from vault allocator)
|
|
@@ -1095,7 +1153,6 @@ export default function MetaVaultDescription(allowedSources: AllowedSources[]) {
|
|
|
1095
1153
|
const containerStyle = {
|
|
1096
1154
|
maxWidth: "800px",
|
|
1097
1155
|
margin: "0 auto",
|
|
1098
|
-
backgroundColor: "#111",
|
|
1099
1156
|
color: "#eee",
|
|
1100
1157
|
fontFamily: "Arial, sans-serif",
|
|
1101
1158
|
borderRadius: "12px",
|
|
@@ -1122,7 +1179,6 @@ export default function MetaVaultDescription(allowedSources: AllowedSources[]) {
|
|
|
1122
1179
|
<h1 style={{ fontSize: "18px", marginBottom: "10px" }}>Meta Vault — Automated Yield Router</h1>
|
|
1123
1180
|
<p style={{ fontSize: "14px", lineHeight: "1.5", marginBottom: "16px" }}>
|
|
1124
1181
|
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
1182
|
represent a proportional claim on the underlying assets and accrued yield. Allocation shifts are
|
|
1127
1183
|
handled programmatically based on on-chain signals and risk filters, minimizing idle capital and
|
|
1128
1184
|
maximizing net APY.
|
|
@@ -1251,27 +1307,28 @@ const getUniversalRisk = () => ({
|
|
|
1251
1307
|
|
|
1252
1308
|
// Helper to create Universal strategy settings
|
|
1253
1309
|
const createUniversalSettings = (
|
|
1254
|
-
tokenSymbol: string
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
}
|
|
1310
|
+
tokenSymbol: string
|
|
1311
|
+
): StrategySettings => {
|
|
1312
|
+
const isUSDT = tokenSymbol === "USDT";
|
|
1313
|
+
return {
|
|
1314
|
+
isAudited: true,
|
|
1315
|
+
liveStatus: isUSDT ? StrategyLiveStatus.RETIRED : StrategyLiveStatus.ACTIVE,
|
|
1316
|
+
isPaused: isUSDT,
|
|
1317
|
+
isInstantWithdrawal: false,
|
|
1318
|
+
hideHarvestInfo: true,
|
|
1319
|
+
quoteToken: Global.getDefaultTokens().find(
|
|
1320
|
+
(token) => token.symbol === tokenSymbol
|
|
1321
|
+
)!,
|
|
1322
|
+
alerts: [
|
|
1323
|
+
{
|
|
1324
|
+
tab: "withdraw" as const,
|
|
1325
|
+
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.",
|
|
1326
|
+
type: "info" as const
|
|
1327
|
+
}
|
|
1328
|
+
],
|
|
1329
|
+
showWithdrawalWarningModal: true
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1275
1332
|
|
|
1276
1333
|
const EVERGREEN_SECURITY = {
|
|
1277
1334
|
auditStatus: AuditStatus.AUDITED,
|
|
@@ -1281,18 +1338,21 @@ const EVERGREEN_SECURITY = {
|
|
|
1281
1338
|
},
|
|
1282
1339
|
accessControl: {
|
|
1283
1340
|
type: AccessControlType.STANDARD_ACCOUNT,
|
|
1284
|
-
addresses: [ContractAddr.from("
|
|
1285
|
-
timeLock: "2 Days",
|
|
1341
|
+
addresses: [ContractAddr.from("0x03495DD1e4838aa06666aac236036D86E81A6553e222FC02e70C2Cbc0062e8d0")],
|
|
1286
1342
|
},
|
|
1287
1343
|
};
|
|
1288
1344
|
|
|
1289
|
-
const EVERGREEN_REDEMPTION_INFO = {
|
|
1345
|
+
const EVERGREEN_REDEMPTION_INFO: RedemptionInfo = {
|
|
1290
1346
|
instantWithdrawalVault: InstantWithdrawalVault.NO,
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1347
|
+
redemptionsInfo: [{
|
|
1348
|
+
title: "Typical Duration",
|
|
1349
|
+
description: "1-2 hours"
|
|
1350
|
+
}],
|
|
1351
|
+
alerts: [{
|
|
1352
|
+
type: 'info',
|
|
1353
|
+
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.',
|
|
1354
|
+
tab: 'withdraw'
|
|
1355
|
+
}]
|
|
1296
1356
|
};
|
|
1297
1357
|
|
|
1298
1358
|
// Helper to create a Universal strategy
|
|
@@ -1302,38 +1362,50 @@ const createUniversalStrategy = (params: {
|
|
|
1302
1362
|
vaultSettings: UniversalStrategySettings;
|
|
1303
1363
|
token1Symbol: string;
|
|
1304
1364
|
token2Symbol: string;
|
|
1305
|
-
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),
|
|
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
|
[
|
|
@@ -1343,9 +1415,8 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1343
1415
|
vaultSettings: usdcVaultSettings,
|
|
1344
1416
|
token1Symbol: "USDC.e",
|
|
1345
1417
|
token2Symbol: "ETH",
|
|
1346
|
-
maxTVLDecimals: 6,
|
|
1347
1418
|
allowedSources: ["vesu", "extended"],
|
|
1348
|
-
tags: [StrategyTag.
|
|
1419
|
+
tags: [StrategyTag.META_VAULT]
|
|
1349
1420
|
}),
|
|
1350
1421
|
createUniversalStrategy({
|
|
1351
1422
|
tokenSymbol: "WBTC",
|
|
@@ -1353,9 +1424,8 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1353
1424
|
vaultSettings: wbtcVaultSettings,
|
|
1354
1425
|
token1Symbol: "WBTC",
|
|
1355
1426
|
token2Symbol: "ETH",
|
|
1356
|
-
maxTVLDecimals: 8,
|
|
1357
1427
|
allowedSources: ["vesu", "endur", "extended"],
|
|
1358
|
-
tags: [StrategyTag.BTC, StrategyTag.
|
|
1428
|
+
tags: [StrategyTag.BTC, StrategyTag.META_VAULT]
|
|
1359
1429
|
}),
|
|
1360
1430
|
createUniversalStrategy({
|
|
1361
1431
|
tokenSymbol: "ETH",
|
|
@@ -1363,9 +1433,8 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1363
1433
|
vaultSettings: ethVaultSettings,
|
|
1364
1434
|
token1Symbol: "ETH",
|
|
1365
1435
|
token2Symbol: "WBTC",
|
|
1366
|
-
maxTVLDecimals: 18,
|
|
1367
1436
|
allowedSources: ["vesu", "extended"],
|
|
1368
|
-
tags: [StrategyTag.
|
|
1437
|
+
tags: [StrategyTag.META_VAULT]
|
|
1369
1438
|
}),
|
|
1370
1439
|
createUniversalStrategy({
|
|
1371
1440
|
tokenSymbol: "STRK",
|
|
@@ -1373,9 +1442,8 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1373
1442
|
vaultSettings: strkVaultSettings,
|
|
1374
1443
|
token1Symbol: "STRK",
|
|
1375
1444
|
token2Symbol: "ETH",
|
|
1376
|
-
maxTVLDecimals: 18,
|
|
1377
1445
|
allowedSources: ["vesu", "endur", "extended"],
|
|
1378
|
-
tags: [StrategyTag.
|
|
1446
|
+
tags: [StrategyTag.META_VAULT]
|
|
1379
1447
|
}),
|
|
1380
1448
|
createUniversalStrategy({
|
|
1381
1449
|
tokenSymbol: "USDT",
|
|
@@ -1383,8 +1451,7 @@ export const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[]
|
|
|
1383
1451
|
vaultSettings: usdtVaultSettings,
|
|
1384
1452
|
token1Symbol: "USDT",
|
|
1385
1453
|
token2Symbol: "ETH",
|
|
1386
|
-
maxTVLDecimals: 6,
|
|
1387
1454
|
allowedSources: ["vesu"],
|
|
1388
|
-
tags: [StrategyTag.
|
|
1455
|
+
tags: [StrategyTag.META_VAULT]
|
|
1389
1456
|
})
|
|
1390
1457
|
];
|
|
@@ -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
|
|
|
@@ -1031,9 +1032,8 @@ const createVesuRebalanceSettings = (tokenSymbol: string): StrategySettings => {
|
|
|
1031
1032
|
(t) => t.symbol === tokenSymbol
|
|
1032
1033
|
)!;
|
|
1033
1034
|
return {
|
|
1034
|
-
maxTVL: Web3Number.fromWei("0", depositToken.decimals),
|
|
1035
1035
|
isPaused: false,
|
|
1036
|
-
liveStatus: StrategyLiveStatus.
|
|
1036
|
+
liveStatus: StrategyLiveStatus.DEPRECATED,
|
|
1037
1037
|
isAudited: true,
|
|
1038
1038
|
isInstantWithdrawal: true,
|
|
1039
1039
|
quoteToken: depositToken,
|
|
@@ -1043,21 +1043,27 @@ const createVesuRebalanceSettings = (tokenSymbol: string): StrategySettings => {
|
|
|
1043
1043
|
|
|
1044
1044
|
// Helper to create a Vesu Rebalance strategy
|
|
1045
1045
|
const createVesuRebalanceStrategy = (
|
|
1046
|
+
idSymbol: string,
|
|
1046
1047
|
name: string,
|
|
1047
1048
|
tokenSymbol: string,
|
|
1048
1049
|
address: string
|
|
1049
1050
|
): IStrategyMetadata<VesuRebalanceSettings> => ({
|
|
1050
|
-
id: `vesu_fusion_${
|
|
1051
|
+
id: `vesu_fusion_${idSymbol.toLowerCase()}`,
|
|
1051
1052
|
name,
|
|
1052
1053
|
description: _description.replace("{{TOKEN}}", tokenSymbol),
|
|
1053
1054
|
address: ContractAddr.from(address),
|
|
1054
1055
|
launchBlock: 0,
|
|
1055
1056
|
type: "ERC4626" as const,
|
|
1057
|
+
vaultType: {
|
|
1058
|
+
type: VaultType.META_VAULT,
|
|
1059
|
+
description: `Automatically diversify ${tokenSymbol} holdings into different Vesu pools while reducing risk and maximizing yield. Defi spring ${tokenSymbol} Rewards are auto-compounded as well.`
|
|
1060
|
+
},
|
|
1056
1061
|
depositTokens: [
|
|
1057
1062
|
Global.getDefaultTokens().find((t) => t.symbol === tokenSymbol)!
|
|
1058
1063
|
],
|
|
1059
1064
|
protocols: [_protocol],
|
|
1060
1065
|
auditUrl: AUDIT_URL,
|
|
1066
|
+
curator: UnwrapLabsCurator,
|
|
1061
1067
|
settings: createVesuRebalanceSettings(tokenSymbol),
|
|
1062
1068
|
risk: getVesuRebalanceRisk(),
|
|
1063
1069
|
additionalInfo: {
|
|
@@ -1066,10 +1072,14 @@ const createVesuRebalanceStrategy = (
|
|
|
1066
1072
|
faqs,
|
|
1067
1073
|
contractDetails: [],
|
|
1068
1074
|
investmentSteps: [],
|
|
1069
|
-
tags: [
|
|
1070
|
-
category: StrategyCategory.ALL,
|
|
1075
|
+
tags: [],
|
|
1071
1076
|
security: VESU_SECURITY,
|
|
1072
1077
|
redemptionInfo: VESU_REDEMPTION_INFO,
|
|
1078
|
+
discontinuationInfo: {
|
|
1079
|
+
info: "This strategy has been deprecated and is no longer accepting new deposits."
|
|
1080
|
+
},
|
|
1081
|
+
usualTimeToEarnings: null,
|
|
1082
|
+
usualTimeToEarningsDescription: null,
|
|
1073
1083
|
});
|
|
1074
1084
|
|
|
1075
1085
|
// Shared security & redemption metadata for all Vesu strategies
|
|
@@ -1080,7 +1090,7 @@ const VESU_SECURITY = {
|
|
|
1080
1090
|
contractLink: "https://github.com/trovesfi/troves-contracts",
|
|
1081
1091
|
},
|
|
1082
1092
|
accessControl: {
|
|
1083
|
-
type: AccessControlType.
|
|
1093
|
+
type: AccessControlType.ROLE_BASED_ACCESS,
|
|
1084
1094
|
addresses: [ContractAddr.from("0x0")],
|
|
1085
1095
|
timeLock: "2 Days",
|
|
1086
1096
|
},
|
|
@@ -1088,6 +1098,8 @@ const VESU_SECURITY = {
|
|
|
1088
1098
|
|
|
1089
1099
|
const VESU_REDEMPTION_INFO = {
|
|
1090
1100
|
instantWithdrawalVault: InstantWithdrawalVault.YES,
|
|
1101
|
+
redemptionsInfo: [],
|
|
1102
|
+
alerts: [],
|
|
1091
1103
|
};
|
|
1092
1104
|
|
|
1093
1105
|
const faqs: FAQ[] = [
|
|
@@ -1143,21 +1155,25 @@ const faqs: FAQ[] = [
|
|
|
1143
1155
|
export const VesuRebalanceStrategies: IStrategyMetadata<VesuRebalanceSettings>[] =
|
|
1144
1156
|
[
|
|
1145
1157
|
createVesuRebalanceStrategy(
|
|
1158
|
+
'strk',
|
|
1146
1159
|
"Vesu Fusion STRK",
|
|
1147
1160
|
"STRK",
|
|
1148
1161
|
"0x7fb5bcb8525954a60fde4e8fb8220477696ce7117ef264775a1770e23571929"
|
|
1149
1162
|
),
|
|
1150
1163
|
createVesuRebalanceStrategy(
|
|
1164
|
+
'eth',
|
|
1151
1165
|
"Vesu Fusion ETH",
|
|
1152
1166
|
"ETH",
|
|
1153
1167
|
"0x5eaf5ee75231cecf79921ff8ded4b5ffe96be718bcb3daf206690ad1a9ad0ca"
|
|
1154
1168
|
),
|
|
1155
1169
|
createVesuRebalanceStrategy(
|
|
1170
|
+
'usdc',
|
|
1156
1171
|
"Vesu Fusion USDC.e",
|
|
1157
1172
|
"USDC.e",
|
|
1158
1173
|
"0xa858c97e9454f407d1bd7c57472fc8d8d8449a777c822b41d18e387816f29c"
|
|
1159
1174
|
),
|
|
1160
1175
|
createVesuRebalanceStrategy(
|
|
1176
|
+
'usdt',
|
|
1161
1177
|
"Vesu Fusion USDT",
|
|
1162
1178
|
"USDT",
|
|
1163
1179
|
"0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"
|
|
@@ -1171,8 +1187,7 @@ VesuRebalanceStrategies.forEach((s) => {
|
|
|
1171
1187
|
address: s.address,
|
|
1172
1188
|
name: "Vault",
|
|
1173
1189
|
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/tree/main/src/strategies/vesu_rebalance"
|
|
1174
|
-
}
|
|
1175
|
-
...COMMON_CONTRACTS];
|
|
1190
|
+
}];
|
|
1176
1191
|
// set docs link
|
|
1177
1192
|
s.docs = "https://docs.troves.fi/p/strategies/vesu-fusion-rebalancing-vaults"
|
|
1178
1193
|
|