@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
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
IStrategyMetadata,
|
|
11
11
|
RiskFactor,
|
|
12
12
|
RiskType,
|
|
13
|
-
StrategyCategory,
|
|
14
13
|
StrategyTag,
|
|
15
14
|
TokenInfo,
|
|
16
15
|
VaultPosition,
|
|
@@ -18,7 +17,9 @@ import {
|
|
|
18
17
|
SourceCodeType,
|
|
19
18
|
AccessControlType,
|
|
20
19
|
InstantWithdrawalVault,
|
|
20
|
+
VaultType,
|
|
21
21
|
StrategyLiveStatus,
|
|
22
|
+
UnwrapLabsCurator,
|
|
22
23
|
} from "@/interfaces";
|
|
23
24
|
import { PricerBase } from "@/modules/pricerBase";
|
|
24
25
|
import { assert } from "@/utils";
|
|
@@ -36,18 +37,23 @@ import EkuboMathAbi from "@/data/ekubo-math.abi.json";
|
|
|
36
37
|
import ERC4626Abi from "@/data/erc4626.abi.json";
|
|
37
38
|
import { Global } from "@/global";
|
|
38
39
|
import { AvnuWrapper, ERC20, SwapInfo } from "@/modules";
|
|
39
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
BaseStrategy,
|
|
42
|
+
SingleTokenInfo,
|
|
43
|
+
UserPositionCard,
|
|
44
|
+
UserPositionCardsInput,
|
|
45
|
+
} from "./base-strategy";
|
|
40
46
|
import { DualActionAmount } from "./base-strategy";
|
|
41
47
|
import { DualTokenInfo } from "./base-strategy";
|
|
42
48
|
import { log } from "winston";
|
|
43
49
|
import { EkuboHarvests, HarvestInfo } from "@/modules/harvests";
|
|
44
50
|
import { logger } from "@/utils/logger";
|
|
45
|
-
import { COMMON_CONTRACTS } from "./constants";
|
|
46
51
|
import { DepegRiskLevel, ImpermanentLossLevel, MarketRiskLevel, SmartContractRiskLevel } from "@/interfaces/risks";
|
|
47
52
|
import { from, gql } from "@apollo/client";
|
|
48
53
|
import apolloClient from "@/modules/apollo-client";
|
|
49
54
|
import { binarySearch } from "@/utils/math-utils";
|
|
50
55
|
import { Quote } from "@avnu/avnu-sdk";
|
|
56
|
+
import { MY_ACCESS_CONTROL } from "./constants";
|
|
51
57
|
|
|
52
58
|
export interface EkuboPoolKey {
|
|
53
59
|
token0: ContractAddr;
|
|
@@ -124,7 +130,10 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
124
130
|
pricer: PricerBase,
|
|
125
131
|
metadata: IStrategyMetadata<CLVaultStrategySettings>
|
|
126
132
|
) {
|
|
127
|
-
super(config
|
|
133
|
+
super(config, {
|
|
134
|
+
depositInputMode: "dual",
|
|
135
|
+
withdrawInputMode: "dual"
|
|
136
|
+
});
|
|
128
137
|
this.pricer = pricer;
|
|
129
138
|
|
|
130
139
|
assert(
|
|
@@ -302,7 +311,10 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
302
311
|
return [this.contract.populate("handle_fees", [])];
|
|
303
312
|
}
|
|
304
313
|
|
|
305
|
-
async getFeeHistory(
|
|
314
|
+
async getFeeHistory(
|
|
315
|
+
timePeriod: '24h' | '7d' | '30d' | '3m' | '6m' = '24h',
|
|
316
|
+
range?: { startTimestamp?: number; endTimestamp?: number }
|
|
317
|
+
): Promise<{
|
|
306
318
|
summary: DualTokenInfo,
|
|
307
319
|
history: FeeHistory[]
|
|
308
320
|
}> {
|
|
@@ -311,8 +323,15 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
311
323
|
query ContractFeeEarnings(
|
|
312
324
|
$timeframe: String!
|
|
313
325
|
$contract: String!
|
|
326
|
+
$startTimestamp: Float
|
|
327
|
+
$endTimestamp: Float
|
|
314
328
|
) {
|
|
315
|
-
contractFeeEarnings(
|
|
329
|
+
contractFeeEarnings(
|
|
330
|
+
timeframe: $timeframe
|
|
331
|
+
contract: $contract
|
|
332
|
+
startTimestamp: $startTimestamp
|
|
333
|
+
endTimestamp: $endTimestamp
|
|
334
|
+
) {
|
|
316
335
|
contract
|
|
317
336
|
dailyEarnings {
|
|
318
337
|
date
|
|
@@ -325,7 +344,9 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
325
344
|
`,
|
|
326
345
|
variables: {
|
|
327
346
|
timeframe: timePeriod,
|
|
328
|
-
contract: this.address.address
|
|
347
|
+
contract: this.address.address,
|
|
348
|
+
startTimestamp: range?.startTimestamp,
|
|
349
|
+
endTimestamp: range?.endTimestamp
|
|
329
350
|
},
|
|
330
351
|
fetchPolicy: 'no-cache',
|
|
331
352
|
});
|
|
@@ -476,6 +497,17 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
476
497
|
return (apyForGivenBlocks * (365 * 24 * 3600)) / timeDiffSeconds;
|
|
477
498
|
}
|
|
478
499
|
|
|
500
|
+
/**
|
|
501
|
+
* Calculate lifetime earnings for a user
|
|
502
|
+
* Not yet implemented for Ekubo CL Vault strategy
|
|
503
|
+
*/
|
|
504
|
+
getLifetimeEarnings(
|
|
505
|
+
userTVL: SingleTokenInfo,
|
|
506
|
+
investmentFlows: Array<{ amount: string; type: string; timestamp: number; tx_hash: string }>
|
|
507
|
+
): any {
|
|
508
|
+
throw new Error("getLifetimeEarnings is not implemented yet for this strategy");
|
|
509
|
+
}
|
|
510
|
+
|
|
479
511
|
/**
|
|
480
512
|
* Calculates realized APY based on TVL per share growth, always valued in USDC.
|
|
481
513
|
* This is a vault-level metric (same for all users) and works for all strategies,
|
|
@@ -614,6 +646,51 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
614
646
|
*/
|
|
615
647
|
}
|
|
616
648
|
|
|
649
|
+
async getUserPositionCards(input: UserPositionCardsInput): Promise<UserPositionCard[]> {
|
|
650
|
+
const quoteToken = this.metadata.additionalInfo.quoteAsset;
|
|
651
|
+
const [userTVL, quotePrice] = await Promise.all([
|
|
652
|
+
this.getUserTVL(input.user),
|
|
653
|
+
this.pricer.getPrice(quoteToken.symbol),
|
|
654
|
+
]);
|
|
655
|
+
|
|
656
|
+
const token0IsQuote = userTVL.token0.tokenInfo.address.eq(quoteToken.address);
|
|
657
|
+
const token1IsQuote = userTVL.token1.tokenInfo.address.eq(quoteToken.address);
|
|
658
|
+
const token0QuoteAmount = token0IsQuote
|
|
659
|
+
? userTVL.token0.amount.toNumber()
|
|
660
|
+
: userTVL.token0.usdValue / (quotePrice.price || 1);
|
|
661
|
+
const token1QuoteAmount = token1IsQuote
|
|
662
|
+
? userTVL.token1.amount.toNumber()
|
|
663
|
+
: userTVL.token1.usdValue / (quotePrice.price || 1);
|
|
664
|
+
const totalQuoteAmount = token0QuoteAmount + token1QuoteAmount;
|
|
665
|
+
const quoteAmountDisplay = Number.isFinite(totalQuoteAmount)
|
|
666
|
+
? totalQuoteAmount.toLocaleString("en-US", {
|
|
667
|
+
maximumFractionDigits: quoteToken.displayDecimals ?? 2,
|
|
668
|
+
minimumFractionDigits: 0,
|
|
669
|
+
})
|
|
670
|
+
: "0";
|
|
671
|
+
const allocationValue = `${this.formatTokenAmountForCard(userTVL.token0.amount, userTVL.token0.tokenInfo)} / ${this.formatTokenAmountForCard(userTVL.token1.amount, userTVL.token1.tokenInfo)}`;
|
|
672
|
+
const allocationSubValue = `${this.formatUSDForCard(userTVL.token0.usdValue)} / ${this.formatUSDForCard(userTVL.token1.usdValue)}`;
|
|
673
|
+
|
|
674
|
+
const cards: UserPositionCard[] = [
|
|
675
|
+
{
|
|
676
|
+
title: "Your Holdings",
|
|
677
|
+
tooltip: `${quoteToken.symbol} equivalent value of your Ekubo position`,
|
|
678
|
+
value: `${quoteAmountDisplay} ${quoteToken.symbol}`,
|
|
679
|
+
subValue: `≈ ${this.formatUSDForCard(userTVL.usdValue)}`,
|
|
680
|
+
subValueColor: "positive",
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
title: "Holding Allocation",
|
|
684
|
+
tooltip: "Split of your position between token0 and token1",
|
|
685
|
+
value: allocationValue,
|
|
686
|
+
subValue: `≈ ${allocationSubValue}`,
|
|
687
|
+
subValueColor: "default",
|
|
688
|
+
},
|
|
689
|
+
];
|
|
690
|
+
cards.push(await this.createApyCard(input));
|
|
691
|
+
return cards;
|
|
692
|
+
}
|
|
693
|
+
|
|
617
694
|
async feeBasedAPY(
|
|
618
695
|
timeperiod: '24h' | '7d' | '30d' | '3m' = '24h'
|
|
619
696
|
): Promise<number> {
|
|
@@ -2146,7 +2223,12 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
2146
2223
|
}
|
|
2147
2224
|
|
|
2148
2225
|
async getInvestmentFlows() {
|
|
2149
|
-
|
|
2226
|
+
// for LSTs, we use 30d, else 7d for the yield calculation
|
|
2227
|
+
// TODO Make the block compute more dynamic
|
|
2228
|
+
const blocksDiff = this.metadata.additionalInfo.lstContract
|
|
2229
|
+
? 600000
|
|
2230
|
+
: 600000 / 4;
|
|
2231
|
+
const netYield = await this.netAPY("latest", blocksDiff, "7d" as any);
|
|
2150
2232
|
const poolKey = await this.getPoolKey();
|
|
2151
2233
|
|
|
2152
2234
|
const linkedFlow: IInvestmentFlow = {
|
|
@@ -2305,6 +2387,9 @@ function getLSTFAQs(lstSymbol: string): FAQ[] {
|
|
|
2305
2387
|
]
|
|
2306
2388
|
}
|
|
2307
2389
|
|
|
2390
|
+
const vaultTypeDescription = 'Automatically collects fees and rebalances positions on Ekubo to optimize yield';
|
|
2391
|
+
const vaultType = VaultType.AUTOMATED_LP;
|
|
2392
|
+
|
|
2308
2393
|
const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
2309
2394
|
id: "ekubo_cl_xstrkstrk",
|
|
2310
2395
|
name: "Ekubo xSTRK/STRK",
|
|
@@ -2314,6 +2399,10 @@ const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
2314
2399
|
),
|
|
2315
2400
|
launchBlock: 1209881,
|
|
2316
2401
|
type: "Other",
|
|
2402
|
+
vaultType: {
|
|
2403
|
+
type: vaultType,
|
|
2404
|
+
description: vaultTypeDescription
|
|
2405
|
+
},
|
|
2317
2406
|
// must be same order as poolKey token0 and token1
|
|
2318
2407
|
depositTokens: [
|
|
2319
2408
|
Global.getDefaultTokens().find((t) => t.symbol === "xSTRK")!,
|
|
@@ -2321,6 +2410,7 @@ const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
2321
2410
|
],
|
|
2322
2411
|
protocols: [_protocol],
|
|
2323
2412
|
auditUrl: AUDIT_URL,
|
|
2413
|
+
curator: UnwrapLabsCurator,
|
|
2324
2414
|
risk: {
|
|
2325
2415
|
riskFactor: _lstPoolRiskFactors,
|
|
2326
2416
|
netRisk:
|
|
@@ -2330,6 +2420,7 @@ const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
2330
2420
|
},
|
|
2331
2421
|
apyMethodology:
|
|
2332
2422
|
"APY based on 30-day historical performance, including fees and rewards.",
|
|
2423
|
+
realizedApyMethodology: "The realizedAPY is based on past 14 days performance by the vault",
|
|
2333
2424
|
additionalInfo: {
|
|
2334
2425
|
newBounds: {
|
|
2335
2426
|
lower: -1,
|
|
@@ -2387,18 +2478,17 @@ const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
2387
2478
|
tab: "withdraw"
|
|
2388
2479
|
}
|
|
2389
2480
|
],
|
|
2390
|
-
tags: [StrategyTag.
|
|
2481
|
+
tags: [StrategyTag.AUTOMATED_LP]
|
|
2391
2482
|
},
|
|
2392
2483
|
faqs: getLSTFAQs("xSTRK"),
|
|
2393
2484
|
points: [{
|
|
2394
|
-
multiplier:
|
|
2485
|
+
multiplier: 15,
|
|
2395
2486
|
logo: 'https://endur.fi/favicon.ico',
|
|
2396
2487
|
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.",
|
|
2397
2488
|
}],
|
|
2398
2489
|
contractDetails: [],
|
|
2399
2490
|
investmentSteps: [],
|
|
2400
|
-
|
|
2401
|
-
tags: [StrategyTag.EKUBO],
|
|
2491
|
+
tags: [StrategyTag.AUTOMATED_LP],
|
|
2402
2492
|
security: {
|
|
2403
2493
|
auditStatus: AuditStatus.AUDITED,
|
|
2404
2494
|
sourceCode: {
|
|
@@ -2406,14 +2496,17 @@ const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
2406
2496
|
contractLink: "https://github.com/trovesfi/troves-contracts",
|
|
2407
2497
|
},
|
|
2408
2498
|
accessControl: {
|
|
2409
|
-
type: AccessControlType.
|
|
2410
|
-
addresses: [
|
|
2411
|
-
timeLock: "2 Days",
|
|
2499
|
+
type: AccessControlType.ROLE_BASED_ACCESS,
|
|
2500
|
+
addresses: [MY_ACCESS_CONTROL.address],
|
|
2412
2501
|
},
|
|
2413
2502
|
},
|
|
2414
2503
|
redemptionInfo: {
|
|
2415
2504
|
instantWithdrawalVault: InstantWithdrawalVault.YES,
|
|
2505
|
+
redemptionsInfo: [],
|
|
2506
|
+
alerts: [],
|
|
2416
2507
|
},
|
|
2508
|
+
usualTimeToEarnings: null,
|
|
2509
|
+
usualTimeToEarningsDescription: null,
|
|
2417
2510
|
};
|
|
2418
2511
|
|
|
2419
2512
|
// Helper to create common LST alerts
|
|
@@ -2467,7 +2560,7 @@ const getLSTAlerts = () => [
|
|
|
2467
2560
|
];
|
|
2468
2561
|
|
|
2469
2562
|
// Helper to create LST strategy settings
|
|
2470
|
-
const createLSTSettings = (quoteTokenSymbol: string
|
|
2563
|
+
const createLSTSettings = (quoteTokenSymbol: string) => ({
|
|
2471
2564
|
...xSTRKSTRK.settings,
|
|
2472
2565
|
isAudited: true,
|
|
2473
2566
|
liveStatus: StrategyLiveStatus.ACTIVE,
|
|
@@ -2478,8 +2571,7 @@ const createLSTSettings = (quoteTokenSymbol: string, category: StrategyCategory)
|
|
|
2478
2571
|
(t) => t.symbol === quoteTokenSymbol
|
|
2479
2572
|
)!,
|
|
2480
2573
|
alerts: getLSTAlerts(),
|
|
2481
|
-
tags: [StrategyTag.
|
|
2482
|
-
category: category
|
|
2574
|
+
tags: [StrategyTag.AUTOMATED_LP] as StrategyTag[],
|
|
2483
2575
|
});
|
|
2484
2576
|
|
|
2485
2577
|
// Helper to create an LST strategy
|
|
@@ -2492,7 +2584,6 @@ const createLSTStrategy = (params: {
|
|
|
2492
2584
|
depositToken1Symbol: string;
|
|
2493
2585
|
quoteTokenSymbol: string;
|
|
2494
2586
|
lstSymbol: string;
|
|
2495
|
-
category: StrategyCategory;
|
|
2496
2587
|
lstContractAddress?: string;
|
|
2497
2588
|
}): IStrategyMetadata<CLVaultStrategySettings> => ({
|
|
2498
2589
|
...xSTRKSTRK,
|
|
@@ -2502,12 +2593,17 @@ const createLSTStrategy = (params: {
|
|
|
2502
2593
|
// must be same order as poolKey token0 and token1
|
|
2503
2594
|
address: ContractAddr.from(params.address),
|
|
2504
2595
|
launchBlock: params.launchBlock,
|
|
2596
|
+
vaultType: {
|
|
2597
|
+
type: vaultType,
|
|
2598
|
+
description: vaultTypeDescription
|
|
2599
|
+
},
|
|
2505
2600
|
depositTokens: [
|
|
2506
2601
|
Global.getDefaultTokens().find(
|
|
2507
2602
|
(t) => t.symbol === params.depositToken0Symbol
|
|
2508
2603
|
)!,
|
|
2509
2604
|
Global.getDefaultTokens().find((t) => t.symbol === params.depositToken1Symbol)!
|
|
2510
2605
|
],
|
|
2606
|
+
realizedApyMethodology: "The realizedAPY is based on past 14 days performance by the vault",
|
|
2511
2607
|
additionalInfo: {
|
|
2512
2608
|
...xSTRKSTRK.additionalInfo,
|
|
2513
2609
|
quoteAsset: Global.getDefaultTokens().find(
|
|
@@ -2518,13 +2614,12 @@ const createLSTStrategy = (params: {
|
|
|
2518
2614
|
: Global.getDefaultTokens().find((t) => t.symbol === params.lstSymbol)!
|
|
2519
2615
|
.address
|
|
2520
2616
|
},
|
|
2521
|
-
settings: createLSTSettings(params.quoteTokenSymbol
|
|
2617
|
+
settings: createLSTSettings(params.quoteTokenSymbol),
|
|
2522
2618
|
faqs: getLSTFAQs(params.lstSymbol),
|
|
2523
2619
|
points: [],
|
|
2524
2620
|
contractDetails: [],
|
|
2525
2621
|
investmentSteps: [],
|
|
2526
|
-
|
|
2527
|
-
tags: [StrategyTag.EKUBO]
|
|
2622
|
+
tags: params.id.toLowerCase().includes('btc') ? [StrategyTag.BTC, StrategyTag.AUTOMATED_LP] : [StrategyTag.AUTOMATED_LP]
|
|
2528
2623
|
});
|
|
2529
2624
|
|
|
2530
2625
|
const lstStrategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
@@ -2538,10 +2633,9 @@ const lstStrategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2538
2633
|
depositToken1Symbol: "xWBTC",
|
|
2539
2634
|
quoteTokenSymbol: "WBTC",
|
|
2540
2635
|
lstSymbol: "xWBTC",
|
|
2541
|
-
category: StrategyCategory.BTC
|
|
2542
2636
|
}),
|
|
2543
2637
|
createLSTStrategy({
|
|
2544
|
-
id: "
|
|
2638
|
+
id: "ekubo_cl_xtbtctbtc",
|
|
2545
2639
|
name: "Ekubo xtBTC/tBTC",
|
|
2546
2640
|
address: "0x785dc3dfc4e80ef2690a99512481e3ed3a5266180adda5a47e856245d68a4af",
|
|
2547
2641
|
launchBlock: 2415667,
|
|
@@ -2549,7 +2643,6 @@ const lstStrategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2549
2643
|
depositToken1Symbol: "tBTC",
|
|
2550
2644
|
quoteTokenSymbol: "tBTC",
|
|
2551
2645
|
lstSymbol: "xtBTC",
|
|
2552
|
-
category: StrategyCategory.BTC
|
|
2553
2646
|
}),
|
|
2554
2647
|
createLSTStrategy({
|
|
2555
2648
|
id: "ekubo_cl_xsbtcsolvbtc",
|
|
@@ -2560,10 +2653,9 @@ const lstStrategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2560
2653
|
depositToken1Symbol: "solvBTC",
|
|
2561
2654
|
quoteTokenSymbol: "solvBTC",
|
|
2562
2655
|
lstSymbol: "xsBTC",
|
|
2563
|
-
category: StrategyCategory.BTC
|
|
2564
2656
|
}),
|
|
2565
2657
|
createLSTStrategy({
|
|
2566
|
-
id: "
|
|
2658
|
+
id: "ekubo_cl_xlbtclbtc",
|
|
2567
2659
|
name: "Ekubo xLBTC/LBTC",
|
|
2568
2660
|
address: "0x314c4653ab1aa01f5465773cb879f525d7e369a137bc3ae084761aee99a1712",
|
|
2569
2661
|
launchBlock: 2412442,
|
|
@@ -2571,7 +2663,6 @@ const lstStrategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2571
2663
|
depositToken1Symbol: "xLBTC",
|
|
2572
2664
|
quoteTokenSymbol: "LBTC",
|
|
2573
2665
|
lstSymbol: "xLBTC",
|
|
2574
|
-
category: StrategyCategory.BTC
|
|
2575
2666
|
})
|
|
2576
2667
|
];
|
|
2577
2668
|
|
|
@@ -2609,10 +2700,10 @@ const getRe7Alerts = () => [
|
|
|
2609
2700
|
];
|
|
2610
2701
|
|
|
2611
2702
|
// Helper to create Re7 strategy settings
|
|
2612
|
-
const createRe7Settings = (quoteTokenSymbol: string,
|
|
2703
|
+
const createRe7Settings = (quoteTokenSymbol: string, isBTC: boolean, isDeprecated: boolean) => ({
|
|
2613
2704
|
...xSTRKSTRK.settings,
|
|
2614
2705
|
isAudited: true,
|
|
2615
|
-
liveStatus: StrategyLiveStatus.
|
|
2706
|
+
liveStatus: isDeprecated ? StrategyLiveStatus.DEPRECATED : StrategyLiveStatus.ACTIVE,
|
|
2616
2707
|
isInstantWithdrawal: true,
|
|
2617
2708
|
hideNetEarnings: true,
|
|
2618
2709
|
isTransactionHistDisabled: false,
|
|
@@ -2620,8 +2711,14 @@ const createRe7Settings = (quoteTokenSymbol: string, category: StrategyCategory)
|
|
|
2620
2711
|
(t) => t.symbol === quoteTokenSymbol
|
|
2621
2712
|
)!,
|
|
2622
2713
|
alerts: getRe7Alerts(),
|
|
2623
|
-
tags: [StrategyTag.
|
|
2624
|
-
|
|
2714
|
+
tags: isBTC ? [StrategyTag.BTC, StrategyTag.AUTOMATED_LP] : [StrategyTag.AUTOMATED_LP] as StrategyTag[],
|
|
2715
|
+
security: {
|
|
2716
|
+
...xSTRKSTRK.security,
|
|
2717
|
+
accessControl: {
|
|
2718
|
+
...xSTRKSTRK.security.accessControl,
|
|
2719
|
+
addresses: [ContractAddr.from("0x707bf89863473548fb2844c9f3f96d83fe2394453259035a5791e4b1490642")],
|
|
2720
|
+
},
|
|
2721
|
+
},
|
|
2625
2722
|
});
|
|
2626
2723
|
|
|
2627
2724
|
// Helper to create Re7 FAQs
|
|
@@ -2676,55 +2773,64 @@ const createRe7Strategy = (
|
|
|
2676
2773
|
| typeof highRisk
|
|
2677
2774
|
| typeof mediumRisk
|
|
2678
2775
|
| { riskFactor: RiskFactor[]; netRisk: number; notARisks: RiskType[] },
|
|
2679
|
-
|
|
2680
|
-
): IStrategyMetadata<CLVaultStrategySettings> =>
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
],
|
|
2693
|
-
apyMethodology:
|
|
2694
|
-
"Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
|
|
2695
|
-
additionalInfo: {
|
|
2696
|
-
newBounds: "Managed by Re7",
|
|
2697
|
-
truePrice: 1,
|
|
2698
|
-
feeBps: 1000,
|
|
2699
|
-
rebalanceConditions: {
|
|
2700
|
-
customShouldRebalance: async (currentPrice: number) =>
|
|
2701
|
-
currentPrice > 0.99 && currentPrice < 1.01,
|
|
2702
|
-
minWaitHours: 6,
|
|
2703
|
-
direction: "any" as const
|
|
2776
|
+
isBTC: boolean
|
|
2777
|
+
): IStrategyMetadata<CLVaultStrategySettings> => {
|
|
2778
|
+
const isDeprecated = name.toLowerCase().includes('usdc.e');
|
|
2779
|
+
return {
|
|
2780
|
+
...xSTRKSTRK,
|
|
2781
|
+
id,
|
|
2782
|
+
name,
|
|
2783
|
+
description: <></>,
|
|
2784
|
+
address: ContractAddr.from(address),
|
|
2785
|
+
launchBlock,
|
|
2786
|
+
vaultType: {
|
|
2787
|
+
type: vaultType,
|
|
2788
|
+
description: vaultTypeDescription
|
|
2704
2789
|
},
|
|
2705
|
-
|
|
2706
|
-
(
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2790
|
+
depositTokens: [
|
|
2791
|
+
Global.getDefaultTokens().find(
|
|
2792
|
+
(t) => t.symbol === depositToken0Symbol
|
|
2793
|
+
)!,
|
|
2794
|
+
Global.getDefaultTokens().find((t) => t.symbol === depositToken1Symbol)!
|
|
2795
|
+
],
|
|
2796
|
+
apyMethodology:
|
|
2797
|
+
"Annualized fee APY, calculated as fees earned in the last 7d divided by TVL",
|
|
2798
|
+
additionalInfo: {
|
|
2799
|
+
newBounds: "Managed by Re7",
|
|
2800
|
+
truePrice: 1,
|
|
2801
|
+
feeBps: 1000,
|
|
2802
|
+
rebalanceConditions: {
|
|
2803
|
+
customShouldRebalance: async (currentPrice: number) =>
|
|
2804
|
+
currentPrice > 0.99 && currentPrice < 1.01,
|
|
2805
|
+
minWaitHours: 6,
|
|
2806
|
+
direction: "any" as const
|
|
2807
|
+
},
|
|
2808
|
+
quoteAsset: Global.getDefaultTokens().find(
|
|
2809
|
+
(t) => t.symbol === quoteTokenSymbol
|
|
2810
|
+
)!
|
|
2811
|
+
},
|
|
2812
|
+
settings: createRe7Settings(quoteTokenSymbol, isBTC, isDeprecated),
|
|
2813
|
+
faqs: getRe7FAQs(),
|
|
2814
|
+
risk,
|
|
2815
|
+
points: [],
|
|
2816
|
+
curator: { name: "Re7 Labs", logo: "https://www.re7labs.xyz/favicon.ico" },
|
|
2817
|
+
tags: isBTC ? [StrategyTag.BTC, StrategyTag.AUTOMATED_LP] : [StrategyTag.AUTOMATED_LP] as StrategyTag[],
|
|
2818
|
+
discontinuationInfo: isDeprecated ? {
|
|
2819
|
+
info: "This strategy has been deprecated and is no longer accepting new deposits."
|
|
2820
|
+
} : undefined,
|
|
2821
|
+
};
|
|
2822
|
+
};
|
|
2717
2823
|
|
|
2718
2824
|
const ETHUSDCRe7Strategy = createRe7Strategy(
|
|
2719
2825
|
"ekubo_cl_ethusdc",
|
|
2720
|
-
"Ekubo ETH/USDC",
|
|
2826
|
+
"Ekubo ETH/USDC.e",
|
|
2721
2827
|
"0x160d8fa4569ef6a12e6bf47cb943d7b5ebba8a41a69a14c1d943050ba5ff947",
|
|
2722
2828
|
1504232,
|
|
2723
2829
|
"ETH",
|
|
2724
|
-
"USDC",
|
|
2725
|
-
"USDC",
|
|
2830
|
+
"USDC.e",
|
|
2831
|
+
"USDC.e",
|
|
2726
2832
|
highRisk,
|
|
2727
|
-
|
|
2833
|
+
false // isBTC
|
|
2728
2834
|
);
|
|
2729
2835
|
|
|
2730
2836
|
const stableCoinRisk = {
|
|
@@ -2741,18 +2847,18 @@ const stableCoinRisk = {
|
|
|
2741
2847
|
const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
2742
2848
|
ETHUSDCRe7Strategy,
|
|
2743
2849
|
createRe7Strategy(
|
|
2744
|
-
"
|
|
2850
|
+
"ekubo_cl_usdcusdt",
|
|
2745
2851
|
"Ekubo USDC.e/USDT",
|
|
2746
2852
|
"0x3a4f8debaf12af97bb911099bc011d63d6c208d4c5ba8e15d7f437785b0aaa2",
|
|
2747
2853
|
1506139,
|
|
2748
2854
|
"USDC.e",
|
|
2749
2855
|
"USDT",
|
|
2750
|
-
"
|
|
2856
|
+
"USDC.e",
|
|
2751
2857
|
stableCoinRisk,
|
|
2752
|
-
|
|
2858
|
+
false // isBTC
|
|
2753
2859
|
),
|
|
2754
2860
|
createRe7Strategy(
|
|
2755
|
-
"
|
|
2861
|
+
"ekubo_cl_strkusdc",
|
|
2756
2862
|
"Ekubo STRK/USDC.e",
|
|
2757
2863
|
"0x351b36d0d9d8b40010658825adeeddb1397436cd41acd0ff6c6e23aaa8b5b30",
|
|
2758
2864
|
1504079,
|
|
@@ -2760,7 +2866,7 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2760
2866
|
"USDC.e",
|
|
2761
2867
|
"USDC.e",
|
|
2762
2868
|
highRisk,
|
|
2763
|
-
|
|
2869
|
+
false // isBTC
|
|
2764
2870
|
),
|
|
2765
2871
|
createRe7Strategy(
|
|
2766
2872
|
"ekubo_cl_strketh",
|
|
@@ -2769,12 +2875,12 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2769
2875
|
1504149,
|
|
2770
2876
|
"STRK",
|
|
2771
2877
|
"ETH",
|
|
2772
|
-
"
|
|
2878
|
+
"USDC",
|
|
2773
2879
|
highRisk,
|
|
2774
|
-
|
|
2880
|
+
false // isBTC
|
|
2775
2881
|
),
|
|
2776
2882
|
createRe7Strategy(
|
|
2777
|
-
"
|
|
2883
|
+
"ekubo_cl_wbtcusdc",
|
|
2778
2884
|
"Ekubo WBTC/USDC.e",
|
|
2779
2885
|
"0x2bcaef2eb7706875a5fdc6853dd961a0590f850bc3a031c59887189b5e84ba1",
|
|
2780
2886
|
1506144,
|
|
@@ -2782,19 +2888,18 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2782
2888
|
"USDC.e",
|
|
2783
2889
|
"USDC.e",
|
|
2784
2890
|
mediumRisk,
|
|
2785
|
-
|
|
2786
|
-
),
|
|
2787
|
-
createRe7Strategy(
|
|
2788
|
-
"ekubo_cl_tbtcusdce",
|
|
2789
|
-
"Ekubo tBTC/USDC.e",
|
|
2790
|
-
"0x4aad891a2d4432fba06b6558631bb13f6bbd7f6f33ab8c3111e344889ea4456",
|
|
2791
|
-
1501764,
|
|
2792
|
-
"tBTC",
|
|
2793
|
-
"USDC.e",
|
|
2794
|
-
"USDC.e",
|
|
2795
|
-
mediumRisk,
|
|
2796
|
-
StrategyCategory.BTC
|
|
2891
|
+
true // isBTC
|
|
2797
2892
|
),
|
|
2893
|
+
// createRe7Strategy(
|
|
2894
|
+
// "ekubo_cl_tbtcusdce",
|
|
2895
|
+
// "Ekubo tBTC/USDC.e",
|
|
2896
|
+
// "0x4aad891a2d4432fba06b6558631bb13f6bbd7f6f33ab8c3111e344889ea4456",
|
|
2897
|
+
// 1501764,
|
|
2898
|
+
// "tBTC",
|
|
2899
|
+
// "USDC.e",
|
|
2900
|
+
// "USDC.e",
|
|
2901
|
+
// mediumRisk,
|
|
2902
|
+
// ),
|
|
2798
2903
|
createRe7Strategy(
|
|
2799
2904
|
"ekubo_cl_wbtceth",
|
|
2800
2905
|
"Ekubo WBTC/ETH",
|
|
@@ -2802,9 +2907,9 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2802
2907
|
1506145,
|
|
2803
2908
|
"WBTC",
|
|
2804
2909
|
"ETH",
|
|
2805
|
-
"
|
|
2910
|
+
"USDC",
|
|
2806
2911
|
mediumRisk,
|
|
2807
|
-
|
|
2912
|
+
true // isBTC
|
|
2808
2913
|
),
|
|
2809
2914
|
createRe7Strategy(
|
|
2810
2915
|
"ekubo_cl_wbtcstrk",
|
|
@@ -2813,12 +2918,12 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2813
2918
|
1506147,
|
|
2814
2919
|
"WBTC",
|
|
2815
2920
|
"STRK",
|
|
2816
|
-
"
|
|
2921
|
+
"USDC",
|
|
2817
2922
|
highRisk,
|
|
2818
|
-
|
|
2923
|
+
true // isBTC
|
|
2819
2924
|
),
|
|
2820
2925
|
createRe7Strategy(
|
|
2821
|
-
"
|
|
2926
|
+
"ekubo_cl_usdc_v2usdt",
|
|
2822
2927
|
"Ekubo USDC/USDT",
|
|
2823
2928
|
"0x5203a08b471e46bf33990ac83aff577bbe5a5d789e61de2c6531e3c4773d1c9",
|
|
2824
2929
|
3998018,
|
|
@@ -2826,10 +2931,10 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2826
2931
|
"USDT",
|
|
2827
2932
|
"USDC",
|
|
2828
2933
|
stableCoinRisk,
|
|
2829
|
-
|
|
2934
|
+
false // isBTC
|
|
2830
2935
|
),
|
|
2831
2936
|
createRe7Strategy(
|
|
2832
|
-
"
|
|
2937
|
+
"ekubo_cl_ethusdc_v2",
|
|
2833
2938
|
"Ekubo ETH/USDC",
|
|
2834
2939
|
"0x4d00c7423b3c0fae3640f6099ac97acbfd8708f099e09bfe3a7a6a680399228",
|
|
2835
2940
|
3998025,
|
|
@@ -2837,10 +2942,10 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2837
2942
|
"ETH",
|
|
2838
2943
|
"USDC",
|
|
2839
2944
|
highRisk,
|
|
2840
|
-
|
|
2945
|
+
false // isBTC
|
|
2841
2946
|
),
|
|
2842
2947
|
createRe7Strategy(
|
|
2843
|
-
"
|
|
2948
|
+
"ekubo_cl_strkusdc_v2",
|
|
2844
2949
|
"Ekubo STRK/USDC",
|
|
2845
2950
|
"0x4de22bd0a8eb4d0a18736e66dd36d20ba50bc106346bbfac3dbeaac1ab37ce1",
|
|
2846
2951
|
3998030,
|
|
@@ -2848,10 +2953,10 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2848
2953
|
"STRK",
|
|
2849
2954
|
"USDC",
|
|
2850
2955
|
highRisk,
|
|
2851
|
-
|
|
2956
|
+
false // isBTC
|
|
2852
2957
|
),
|
|
2853
2958
|
createRe7Strategy(
|
|
2854
|
-
"
|
|
2959
|
+
"ekubo_cl_wbtcusdc_v2",
|
|
2855
2960
|
"Ekubo WBTC/USDC",
|
|
2856
2961
|
"0x76101c3b80af1103c9c6d541ca627f61b5ae7ae79d7fce96ccdf7bdb648450d",
|
|
2857
2962
|
3998034,
|
|
@@ -2859,7 +2964,7 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
2859
2964
|
"WBTC",
|
|
2860
2965
|
"USDC",
|
|
2861
2966
|
mediumRisk,
|
|
2862
|
-
|
|
2967
|
+
true // isBTC
|
|
2863
2968
|
)
|
|
2864
2969
|
];
|
|
2865
2970
|
|