@strkfarm/sdk 2.0.0-staging.1 → 2.0.0-staging.11
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 +53062 -28963
- package/dist/index.browser.mjs +2429 -1799
- package/dist/index.d.ts +188 -46
- package/dist/index.js +2122 -1479
- package/dist/index.mjs +2698 -2068
- package/package.json +79 -81
- package/src/dataTypes/index.ts +3 -2
- package/src/dataTypes/mynumber.ts +141 -0
- package/src/global.ts +27 -1
- package/src/index.browser.ts +2 -1
- package/src/interfaces/common.tsx +98 -13
- package/src/modules/ekubo-quoter.ts +1 -1
- package/src/modules/harvests.ts +17 -14
- package/src/modules/index.ts +0 -1
- package/src/modules/pricer-lst.ts +1 -1
- package/src/modules/pricer.ts +38 -3
- package/src/strategies/base-strategy.ts +25 -0
- package/src/strategies/ekubo-cl-vault.tsx +547 -269
- package/src/strategies/factory.ts +159 -0
- package/src/strategies/index.ts +1 -0
- package/src/strategies/registry.ts +50 -113
- package/src/strategies/sensei.ts +134 -7
- package/src/strategies/universal-adapters/vesu-adapter.ts +7 -5
- package/src/strategies/universal-lst-muliplier-strategy.tsx +279 -118
- package/src/strategies/universal-strategy.tsx +144 -144
- package/src/strategies/vesu-rebalance.tsx +95 -150
- package/src/utils/index.ts +1 -0
- package/src/utils/logger.node.ts +11 -4
- package/src/utils/strategy-utils.ts +57 -0
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,33 @@ declare class ContractAddr {
|
|
|
53
53
|
toBigInt(): bigint;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
declare const customInspectSymbol: unique symbol;
|
|
57
|
+
declare class MyNumber {
|
|
58
|
+
bigNumber: BigNumber;
|
|
59
|
+
decimals: number;
|
|
60
|
+
constructor(bigNumber: string, decimals: number);
|
|
61
|
+
static fromEther(num: string, decimals: number): MyNumber;
|
|
62
|
+
static fromZero(): MyNumber;
|
|
63
|
+
toString(): string;
|
|
64
|
+
toEtherStr(): string;
|
|
65
|
+
toFixedStr(decimals: number): string;
|
|
66
|
+
toEtherToFixedDecimals(decimals: number): string;
|
|
67
|
+
isZero(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param amountEther in token terms without decimal e.g. 1 for 1 STRK
|
|
71
|
+
* @param command BigNumber compare funds. e.g. gte, gt, lt
|
|
72
|
+
* @returns
|
|
73
|
+
* @dev Add more commands as needed
|
|
74
|
+
*/
|
|
75
|
+
compare(amountEther: string, command: "gte" | "gt" | "lt"): boolean;
|
|
76
|
+
operate(command: "div" | "plus" | "mul", value: string | number): MyNumber;
|
|
77
|
+
subtract(value: MyNumber): MyNumber;
|
|
78
|
+
static min(a: MyNumber, b: MyNumber): MyNumber;
|
|
79
|
+
static max(a: MyNumber, b: MyNumber): MyNumber;
|
|
80
|
+
[customInspectSymbol](depth: any, inspectOptions: any, inspect: any): string;
|
|
81
|
+
}
|
|
82
|
+
|
|
56
83
|
declare enum RiskType {
|
|
57
84
|
MARKET_RISK = "Market Risk",
|
|
58
85
|
IMPERMANENT_LOSS = "Impermanent Loss Risk",
|
|
@@ -96,17 +123,14 @@ interface IProtocol {
|
|
|
96
123
|
name: string;
|
|
97
124
|
logo: string;
|
|
98
125
|
}
|
|
99
|
-
declare enum StrategyCategory {
|
|
100
|
-
ALL = "all",
|
|
101
|
-
BTC = "btc",
|
|
102
|
-
META_VAULTS = "meta-vaults"
|
|
103
|
-
}
|
|
104
126
|
declare enum StrategyTag {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
127
|
+
META_VAULT = "Meta Vaults",
|
|
128
|
+
LEVERED = "Maxx",
|
|
129
|
+
AUTOMATED_LP = "Ekubo",
|
|
130
|
+
BTC = "BTC"
|
|
131
|
+
}
|
|
132
|
+
declare enum VaultType {
|
|
133
|
+
FARMING = "farming"
|
|
110
134
|
}
|
|
111
135
|
declare enum AuditStatus {
|
|
112
136
|
AUDITED = "Audited",
|
|
@@ -156,6 +180,35 @@ interface FAQ {
|
|
|
156
180
|
question: string | React.ReactNode;
|
|
157
181
|
answer: string | React.ReactNode;
|
|
158
182
|
}
|
|
183
|
+
declare enum StrategyLiveStatus {
|
|
184
|
+
ACTIVE = "Active",
|
|
185
|
+
NEW = "New",
|
|
186
|
+
COMING_SOON = "Coming Soon",
|
|
187
|
+
DEPRECATED = "Deprecated",// active but not recommended
|
|
188
|
+
RETIRED = "Retired",// not active anymore
|
|
189
|
+
HOT = "Hot & New \uD83D\uDD25"
|
|
190
|
+
}
|
|
191
|
+
interface StrategyAlert {
|
|
192
|
+
type: "warning" | "info";
|
|
193
|
+
text: string | React.ReactNode;
|
|
194
|
+
tab: "all" | "deposit" | "withdraw";
|
|
195
|
+
}
|
|
196
|
+
interface StrategySettings {
|
|
197
|
+
maxTVL?: Web3Number;
|
|
198
|
+
liveStatus?: StrategyLiveStatus;
|
|
199
|
+
isPaused?: boolean;
|
|
200
|
+
isInMaintenance?: boolean;
|
|
201
|
+
isAudited: boolean;
|
|
202
|
+
isInstantWithdrawal?: boolean;
|
|
203
|
+
hideHarvestInfo?: boolean;
|
|
204
|
+
is_promoted?: boolean;
|
|
205
|
+
isTransactionHistDisabled?: boolean;
|
|
206
|
+
quoteToken: TokenInfo;
|
|
207
|
+
hideNetEarnings?: boolean;
|
|
208
|
+
showWithdrawalWarningModal?: boolean;
|
|
209
|
+
alerts?: StrategyAlert[];
|
|
210
|
+
tags?: StrategyTag[];
|
|
211
|
+
}
|
|
159
212
|
/**
|
|
160
213
|
* @property risk.riskFactor.factor - The risk factors that are considered for the strategy.
|
|
161
214
|
* @property risk.riskFactor.factor - The value of the risk factor from 0 to 10, 0 being the lowest and 10 being the highest.
|
|
@@ -163,15 +216,19 @@ interface FAQ {
|
|
|
163
216
|
* @property redemptionInfo - Redemption information including instant withdrawal availability and expected redemption times.
|
|
164
217
|
*/
|
|
165
218
|
interface IStrategyMetadata<T> {
|
|
219
|
+
id: string;
|
|
166
220
|
name: string;
|
|
167
221
|
description: string | React.ReactNode;
|
|
168
222
|
address: ContractAddr;
|
|
169
223
|
launchBlock: number;
|
|
170
224
|
type: "ERC4626" | "ERC721" | "Other";
|
|
225
|
+
vaultType: {
|
|
226
|
+
type: VaultType;
|
|
227
|
+
description: string;
|
|
228
|
+
};
|
|
171
229
|
depositTokens: TokenInfo[];
|
|
172
230
|
protocols: IProtocol[];
|
|
173
231
|
auditUrl?: string;
|
|
174
|
-
maxTVL: Web3Number;
|
|
175
232
|
risk: {
|
|
176
233
|
riskFactor: RiskFactor[];
|
|
177
234
|
netRisk: number;
|
|
@@ -197,10 +254,29 @@ interface IStrategyMetadata<T> {
|
|
|
197
254
|
logo: string;
|
|
198
255
|
};
|
|
199
256
|
isPreview?: boolean;
|
|
200
|
-
category: StrategyCategory;
|
|
201
257
|
tags?: StrategyTag[];
|
|
202
258
|
security: SecurityMetadata;
|
|
203
259
|
redemptionInfo: RedemptionInfo;
|
|
260
|
+
settings?: StrategySettings;
|
|
261
|
+
actions?: Array<{
|
|
262
|
+
name?: string;
|
|
263
|
+
pool?: {
|
|
264
|
+
protocol?: {
|
|
265
|
+
name: string;
|
|
266
|
+
logo: string;
|
|
267
|
+
};
|
|
268
|
+
pool?: {
|
|
269
|
+
name: string;
|
|
270
|
+
logos?: string[];
|
|
271
|
+
};
|
|
272
|
+
apr?: number;
|
|
273
|
+
borrow?: {
|
|
274
|
+
apr?: number;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
amount?: string | number;
|
|
278
|
+
isDeposit?: boolean;
|
|
279
|
+
}>;
|
|
204
280
|
}
|
|
205
281
|
interface IInvestmentFlow {
|
|
206
282
|
id?: string;
|
|
@@ -213,6 +289,8 @@ interface IInvestmentFlow {
|
|
|
213
289
|
style?: any;
|
|
214
290
|
}
|
|
215
291
|
declare function getMainnetConfig(rpcUrl?: string, blockIdentifier?: BlockIdentifier): IConfig;
|
|
292
|
+
declare const getStrategyTagDesciption: (tag: StrategyTag) => string;
|
|
293
|
+
declare const getAllStrategyTags: () => StrategyTag[];
|
|
216
294
|
declare const getRiskExplaination: (riskType: RiskType) => "The risk of the market moving against the position." | "The temporary loss of value experienced by liquidity providers in AMMs when asset prices diverge compared to simply holding them." | "The risk of losing funds due to the position being liquidated." | "The risk of low liquidity in the pool, which can lead to high slippages or reduced in-abilities to quickly exit the position." | "The risk of the oracle being manipulated or incorrect." | "The risk of the smart contract being vulnerable to attacks." | "The risk of technical issues e.g. backend failure." | "The risk of the counterparty defaulting e.g. bad debt on lending platforms." | "The risk of a token losing its peg to the underlying asset, leading to potential losses for holders.";
|
|
217
295
|
declare const getRiskColor: (risk: RiskFactor) => "light_green_2" | "yellow" | "red";
|
|
218
296
|
declare const getNoRiskTags: (risks: RiskFactor[]) => RiskType[];
|
|
@@ -227,6 +305,27 @@ interface VaultPosition {
|
|
|
227
305
|
token: TokenInfo;
|
|
228
306
|
remarks: string;
|
|
229
307
|
}
|
|
308
|
+
interface AmountInfo {
|
|
309
|
+
amount: Web3Number;
|
|
310
|
+
usdValue: number;
|
|
311
|
+
tokenInfo: TokenInfo;
|
|
312
|
+
}
|
|
313
|
+
interface AmountsInfo {
|
|
314
|
+
usdValue: number;
|
|
315
|
+
amounts: AmountInfo[];
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Strategy capabilities interface
|
|
319
|
+
* Describes what optional methods a strategy instance supports
|
|
320
|
+
*/
|
|
321
|
+
interface StrategyCapabilities {
|
|
322
|
+
hasMatchInputAmounts: boolean;
|
|
323
|
+
hasNetAPY: boolean;
|
|
324
|
+
hasGetInvestmentFlows: boolean;
|
|
325
|
+
hasGetPendingRewards: boolean;
|
|
326
|
+
hasHarvest: boolean;
|
|
327
|
+
hasRebalance: boolean;
|
|
328
|
+
}
|
|
230
329
|
declare const Protocols: {
|
|
231
330
|
VESU: IProtocol;
|
|
232
331
|
ENDUR: IProtocol;
|
|
@@ -303,7 +402,7 @@ declare class Pricer extends PricerBase {
|
|
|
303
402
|
refreshInterval: number;
|
|
304
403
|
staleTime: number;
|
|
305
404
|
protected methodToUse: {
|
|
306
|
-
[tokenSymbol: string]: 'Ekubo' | 'Coinbase' | 'Coinmarketcap';
|
|
405
|
+
[tokenSymbol: string]: 'Ekubo' | 'Coinbase' | 'Coinmarketcap' | 'Avnu';
|
|
307
406
|
};
|
|
308
407
|
/**
|
|
309
408
|
* TOKENA and TOKENB are the two token names to get price of TokenA in terms of TokenB
|
|
@@ -321,6 +420,7 @@ declare class Pricer extends PricerBase {
|
|
|
321
420
|
_getPrice(token: TokenInfo, defaultMethod?: string): Promise<number>;
|
|
322
421
|
_getPriceCoinbase(token: TokenInfo): Promise<number>;
|
|
323
422
|
_getPriceCoinMarketCap(token: TokenInfo): Promise<number>;
|
|
423
|
+
_getAvnuPrice(token: TokenInfo, amountIn?: Web3Number, retry?: number): Promise<number>;
|
|
324
424
|
_getPriceEkubo(token: TokenInfo, amountIn?: Web3Number, retry?: number): Promise<number>;
|
|
325
425
|
}
|
|
326
426
|
|
|
@@ -485,6 +585,14 @@ interface DualTokenInfo {
|
|
|
485
585
|
token0: SingleTokenInfo;
|
|
486
586
|
token1: SingleTokenInfo;
|
|
487
587
|
}
|
|
588
|
+
interface NetAPYSplit {
|
|
589
|
+
apy: number;
|
|
590
|
+
id: string;
|
|
591
|
+
}
|
|
592
|
+
interface NetAPYDetails {
|
|
593
|
+
net: number;
|
|
594
|
+
splits: NetAPYSplit[];
|
|
595
|
+
}
|
|
488
596
|
interface CacheData {
|
|
489
597
|
timestamp: number;
|
|
490
598
|
ttl: number;
|
|
@@ -499,7 +607,9 @@ declare class BaseStrategy<TVLInfo, ActionInfo> extends CacheClass {
|
|
|
499
607
|
depositCall(amountInfo: ActionInfo, receiver: ContractAddr): Promise<Call[]>;
|
|
500
608
|
withdrawCall(amountInfo: ActionInfo, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
|
|
501
609
|
getVaultPositions(): Promise<VaultPosition[]>;
|
|
610
|
+
netAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number, timeperiod?: "24h" | "7d" | "30d" | "3m"): Promise<number | NetAPYDetails>;
|
|
502
611
|
getPendingRewards(): Promise<HarvestInfo[]>;
|
|
612
|
+
getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
|
|
503
613
|
}
|
|
504
614
|
|
|
505
615
|
interface PoolProps {
|
|
@@ -856,7 +966,7 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
|
|
|
856
966
|
usdValue: number;
|
|
857
967
|
};
|
|
858
968
|
}>;
|
|
859
|
-
getSwapInfoToHandleUnused(considerRebalance?: boolean, newBounds?: EkuboBounds | null, maxIterations?: number, priceRatioPrecision?: number): Promise<SwapInfo>;
|
|
969
|
+
getSwapInfoToHandleUnused(considerRebalance?: boolean, newBounds?: EkuboBounds | null, maxIterations?: number, priceRatioPrecision?: number, getQuoteCallback?: (tokenToSell: string, tokenToBuy: string, amountWei: string, beneficiary: string) => Promise<Quote>): Promise<SwapInfo>;
|
|
860
970
|
assertValidBounds(bounds: EkuboBounds): void;
|
|
861
971
|
assertValidAmounts(expectedAmounts: any, token0Bal: Web3Number, token1Bal: Web3Number): void;
|
|
862
972
|
getSwapParams(expectedAmounts: any, poolKey: EkuboPoolKey, token0Bal: Web3Number, token1Bal: Web3Number): {
|
|
@@ -876,7 +986,7 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
|
|
|
876
986
|
* @returns {Promise<SwapInfo>}
|
|
877
987
|
*
|
|
878
988
|
*/
|
|
879
|
-
getSwapInfoGivenAmounts(poolKey: EkuboPoolKey, token0Bal: Web3Number, token1Bal: Web3Number, bounds: EkuboBounds, maxIterations?: number, priceRatioPrecision?: number): Promise<SwapInfo>;
|
|
989
|
+
getSwapInfoGivenAmounts(poolKey: EkuboPoolKey, token0Bal: Web3Number, token1Bal: Web3Number, bounds: EkuboBounds, maxIterations?: number, priceRatioPrecision?: number, getQuoteCallback?: (tokenToSell: string, tokenToBuy: string, amountWei: string, beneficiary: string) => Promise<Quote>): Promise<SwapInfo>;
|
|
880
990
|
/**
|
|
881
991
|
* Attempts to rebalance the vault by iteratively adjusting swap amounts if initial attempt fails.
|
|
882
992
|
* Uses binary search approach to find optimal swap amount.
|
|
@@ -887,10 +997,16 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
|
|
|
887
997
|
* @param retry - Current retry attempt number (default 0)
|
|
888
998
|
* @param adjustmentFactor - Percentage to adjust swap amount by (default 1)
|
|
889
999
|
* @param isToken0Deficit - Whether token0 balance needs increasing (default true)
|
|
1000
|
+
* @param MAX_RETRIES - Maximum number of retries (default 40)
|
|
1001
|
+
* @param sameErrorCount - For certain errors, we just retry with same amount again. This is the count of such retries (default { count: 0, error: null })
|
|
1002
|
+
* @param MAX_SAME_ERROR_COUNT - For certain errors, we just retry with same amount again. This limits such retries (default 10)
|
|
890
1003
|
* @returns Array of contract calls needed for rebalancing
|
|
891
|
-
* @throws Error if max retries reached without successful rebalance
|
|
1004
|
+
* @throws Error if max retries reached without successful rebalance or max same errors reached
|
|
892
1005
|
*/
|
|
893
|
-
rebalanceIter(swapInfo: SwapInfo, acc: Account, estimateCall: (swapInfo: SwapInfo) => Promise<Call[]>, isSellTokenToken0?: boolean, retry?: number, lowerLimit?: bigint, upperLimit?: bigint, MAX_RETRIES?: number
|
|
1006
|
+
rebalanceIter(swapInfo: SwapInfo, acc: Account, estimateCall: (swapInfo: SwapInfo) => Promise<Call[]>, isSellTokenToken0?: boolean, retry?: number, lowerLimit?: bigint, upperLimit?: bigint, MAX_RETRIES?: number, sameErrorCount?: {
|
|
1007
|
+
count: number;
|
|
1008
|
+
error: null | string;
|
|
1009
|
+
}, MAX_SAME_ERROR_COUNT?: number): Promise<Call[]>;
|
|
894
1010
|
static tickToi129(tick: number): {
|
|
895
1011
|
mag: number;
|
|
896
1012
|
sign: number;
|
|
@@ -985,11 +1101,13 @@ declare class SenseiVault extends BaseStrategy<SingleTokenInfo, SingleActionAmou
|
|
|
985
1101
|
}>;
|
|
986
1102
|
getSecondaryTokenPriceRelativeToMain(retry?: number): Promise<number>;
|
|
987
1103
|
getSettings: () => Promise<starknet.CallResult>;
|
|
1104
|
+
netAPY(): Promise<number>;
|
|
988
1105
|
/**
|
|
989
1106
|
* Calculates user realized APY based on position growth accounting for deposits and withdrawals.
|
|
990
1107
|
* Returns the APY as a number.
|
|
1108
|
+
* Not implemented for Sensei Strategy yet.
|
|
991
1109
|
*/
|
|
992
|
-
getUserRealizedAPY(
|
|
1110
|
+
getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
|
|
993
1111
|
}
|
|
994
1112
|
declare const SenseiStrategies: IStrategyMetadata<SenseiVaultSettings>[];
|
|
995
1113
|
|
|
@@ -1026,6 +1144,24 @@ declare class StandardMerkleTree extends MerkleTreeImpl<LeafData> {
|
|
|
1026
1144
|
dump(): StandardMerkleTreeData<LeafData>;
|
|
1027
1145
|
}
|
|
1028
1146
|
|
|
1147
|
+
/**
|
|
1148
|
+
* Convert SDK TVL info (SingleTokenInfo or DualTokenInfo) to client AmountsInfo format
|
|
1149
|
+
*/
|
|
1150
|
+
declare function toAmountsInfo(tvlInfo: SingleTokenInfo | DualTokenInfo): Omit<AmountsInfo, "amounts"> & {
|
|
1151
|
+
amounts: Array<{
|
|
1152
|
+
amount: Web3Number;
|
|
1153
|
+
tokenInfo: TokenInfo;
|
|
1154
|
+
}>;
|
|
1155
|
+
};
|
|
1156
|
+
/**
|
|
1157
|
+
* Detect what capabilities a strategy instance has
|
|
1158
|
+
*/
|
|
1159
|
+
declare function detectCapabilities(strategy: BaseStrategy<any, any>): StrategyCapabilities;
|
|
1160
|
+
/**
|
|
1161
|
+
* Check if a strategy is a dual-token strategy
|
|
1162
|
+
*/
|
|
1163
|
+
declare function isDualTokenStrategy(strategy: BaseStrategy<any, any>): boolean;
|
|
1164
|
+
|
|
1029
1165
|
type RequiredFields<T> = {
|
|
1030
1166
|
[K in keyof T]-?: T[K];
|
|
1031
1167
|
};
|
|
@@ -1227,6 +1363,7 @@ declare const VesuPools: {
|
|
|
1227
1363
|
Genesis: ContractAddr;
|
|
1228
1364
|
Re7xSTRK: ContractAddr;
|
|
1229
1365
|
Re7xBTC: ContractAddr;
|
|
1366
|
+
Prime: ContractAddr;
|
|
1230
1367
|
};
|
|
1231
1368
|
declare const extensionMap: {
|
|
1232
1369
|
[key: string]: ContractAddr;
|
|
@@ -1281,7 +1418,11 @@ declare class VesuAdapter extends BaseAdapter {
|
|
|
1281
1418
|
};
|
|
1282
1419
|
getDebtCap(config: IConfig): Promise<Web3Number>;
|
|
1283
1420
|
getCurrentDebtUtilisationAmount(config: IConfig): Promise<Web3Number>;
|
|
1284
|
-
getMaxBorrowableByInterestRate(config: IConfig, asset: TokenInfo, maxBorrowAPY: number): Promise<
|
|
1421
|
+
getMaxBorrowableByInterestRate(config: IConfig, asset: TokenInfo, maxBorrowAPY: number): Promise<{
|
|
1422
|
+
maxDebtToHave: Web3Number;
|
|
1423
|
+
currentDebt: Web3Number;
|
|
1424
|
+
totalSupply: Web3Number;
|
|
1425
|
+
}>;
|
|
1285
1426
|
getLTVConfig(config: IConfig, blockNumber?: BlockIdentifier): Promise<number>;
|
|
1286
1427
|
getPositions(config: IConfig, blockNumber?: BlockIdentifier): Promise<VaultPosition[]>;
|
|
1287
1428
|
getCollateralization(config: IConfig, blockNumber?: BlockIdentifier): Promise<Omit<VaultPosition, 'amount'>[]>;
|
|
@@ -1332,6 +1473,7 @@ interface UniversalStrategySettings {
|
|
|
1332
1473
|
vaultAllocator: ContractAddr;
|
|
1333
1474
|
redeemRequestNFT: ContractAddr;
|
|
1334
1475
|
aumOracle: ContractAddr;
|
|
1476
|
+
redemptionRouter?: ContractAddr;
|
|
1335
1477
|
leafAdapters: LeafAdapterFn<any>[];
|
|
1336
1478
|
adapters: {
|
|
1337
1479
|
id: string;
|
|
@@ -1497,13 +1639,15 @@ declare const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[
|
|
|
1497
1639
|
interface HyperLSTStrategySettings extends UniversalStrategySettings {
|
|
1498
1640
|
borrowable_assets: TokenInfo[];
|
|
1499
1641
|
underlyingToken: TokenInfo;
|
|
1642
|
+
defaultPoolId: ContractAddr;
|
|
1643
|
+
altSupportedPoolIds: ContractAddr[];
|
|
1500
1644
|
}
|
|
1501
1645
|
declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTStrategySettings> {
|
|
1502
1646
|
private quoteAmountToFetchPrice;
|
|
1503
1647
|
constructor(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<HyperLSTStrategySettings>);
|
|
1504
1648
|
asset(): TokenInfo;
|
|
1505
1649
|
getTag(): string;
|
|
1506
|
-
getVesuSameTokenAdapter(): VesuAdapter;
|
|
1650
|
+
getVesuSameTokenAdapter(poolId: ContractAddr): VesuAdapter;
|
|
1507
1651
|
getVesuAdapters(): VesuAdapter[];
|
|
1508
1652
|
protected getRewardsAUM(prevAum: Web3Number): Promise<Web3Number>;
|
|
1509
1653
|
getLSTDexPrice(): Promise<number>;
|
|
@@ -1543,6 +1687,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
|
|
|
1543
1687
|
isDeposit: boolean;
|
|
1544
1688
|
leg1DepositAmount: Web3Number;
|
|
1545
1689
|
maxEkuboPriceImpact?: number;
|
|
1690
|
+
poolId: ContractAddr;
|
|
1546
1691
|
}): Promise<Call[]>;
|
|
1547
1692
|
getLSTUnderlyingTokenInfo(): TokenInfo;
|
|
1548
1693
|
getMaxBorrowableAmount(params?: {
|
|
@@ -1554,6 +1699,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
|
|
|
1554
1699
|
dexSwappableAmount: Web3Number;
|
|
1555
1700
|
maxBorrowableAmount: Web3Number;
|
|
1556
1701
|
borrowableAsset: TokenInfo;
|
|
1702
|
+
ltv: number;
|
|
1557
1703
|
}[];
|
|
1558
1704
|
}>;
|
|
1559
1705
|
getMaxSwappableWithMaxSlippage(fromToken: TokenInfo, toToken: TokenInfo, maxSlippage: number, maxAmount: Web3Number): Promise<Web3Number>;
|
|
@@ -1593,15 +1739,11 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
|
|
|
1593
1739
|
lstDexPriceInUnderlying: number;
|
|
1594
1740
|
isIncrease: boolean;
|
|
1595
1741
|
maxEkuboPriceImpact: number;
|
|
1742
|
+
poolId: ContractAddr;
|
|
1596
1743
|
}): Promise<Call[]>;
|
|
1597
1744
|
}
|
|
1598
1745
|
declare const HyperLSTStrategies: IStrategyMetadata<HyperLSTStrategySettings>[];
|
|
1599
1746
|
|
|
1600
|
-
/**
|
|
1601
|
-
* Strategy Registry - Centralized strategy metadata and filtering
|
|
1602
|
-
* Provides utilities for getting strategy lists, metadata, and filter options
|
|
1603
|
-
*/
|
|
1604
|
-
|
|
1605
1747
|
/**
|
|
1606
1748
|
* Filter option definition
|
|
1607
1749
|
*/
|
|
@@ -1616,7 +1758,6 @@ interface FilterOption {
|
|
|
1616
1758
|
interface StrategyFilterMetadata {
|
|
1617
1759
|
assets: FilterOption[];
|
|
1618
1760
|
protocols: FilterOption[];
|
|
1619
|
-
categories: FilterOption[];
|
|
1620
1761
|
quickFilters: FilterOption[];
|
|
1621
1762
|
}
|
|
1622
1763
|
/**
|
|
@@ -1638,7 +1779,6 @@ interface StrategyMetadata {
|
|
|
1638
1779
|
type: StrategyType;
|
|
1639
1780
|
assets: string[];
|
|
1640
1781
|
protocols: string[];
|
|
1641
|
-
category: string;
|
|
1642
1782
|
tags: string[];
|
|
1643
1783
|
curator?: {
|
|
1644
1784
|
name: string;
|
|
@@ -1673,16 +1813,27 @@ declare function getLiveStrategies(): StrategyRegistryEntry[];
|
|
|
1673
1813
|
* Get strategies by type
|
|
1674
1814
|
*/
|
|
1675
1815
|
declare function getStrategiesByType(type: StrategyType): StrategyRegistryEntry[];
|
|
1816
|
+
|
|
1817
|
+
declare enum FactoryStrategyType {
|
|
1818
|
+
UNIVERSAL = "UNIVERSAL",
|
|
1819
|
+
EKUBO_CL = "EKUBO_CL",
|
|
1820
|
+
HYPER_LST = "HYPER_LST",
|
|
1821
|
+
VESU_REBALANCE = "VESU_REBALANCE",
|
|
1822
|
+
SENSEI = "SENSEI"
|
|
1823
|
+
}
|
|
1824
|
+
declare function createUniversalStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<UniversalStrategySettings>): UniversalStrategy<UniversalStrategySettings>;
|
|
1825
|
+
declare function createEkuboCLStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<CLVaultStrategySettings>): EkuboCLVault;
|
|
1826
|
+
declare function createHyperLSTStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<HyperLSTStrategySettings>): UniversalLstMultiplierStrategy;
|
|
1827
|
+
declare function createVesuRebalanceStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<VesuRebalanceSettings>): VesuRebalance;
|
|
1828
|
+
declare function createSenseiStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<SenseiVaultSettings>): SenseiVault;
|
|
1676
1829
|
/**
|
|
1677
|
-
*
|
|
1830
|
+
* Determines the strategy type from metadata by inspecting the additionalInfo structure
|
|
1678
1831
|
*/
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
}
|
|
1685
|
-
declare function getFilteredStrategies(criteria: StrategyFilterCriteria): StrategyMetadata[];
|
|
1832
|
+
declare function getStrategyTypeFromMetadata(metadata: IStrategyMetadata<any>): FactoryStrategyType;
|
|
1833
|
+
/**
|
|
1834
|
+
* Generic factory function that creates SDK strategy instances based on type
|
|
1835
|
+
*/
|
|
1836
|
+
declare function createStrategy(type: FactoryStrategyType, config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<any>): VesuRebalance | EkuboCLVault | SenseiVault | UniversalStrategy<UniversalStrategySettings>;
|
|
1686
1837
|
|
|
1687
1838
|
interface EkuboRouteNode {
|
|
1688
1839
|
pool_key: {
|
|
@@ -1726,16 +1877,6 @@ declare class EkuboQuoter {
|
|
|
1726
1877
|
getVesuMultiplyQuote(quote: EkuboQuote, fromTokenInfo: TokenInfo, toTokenInfo: TokenInfo): Swap[];
|
|
1727
1878
|
}
|
|
1728
1879
|
|
|
1729
|
-
declare class EkuboPricer extends PricerBase {
|
|
1730
|
-
EKUBO_PRICE_FETCHER_ADDRESS: string;
|
|
1731
|
-
readonly contract: Contract;
|
|
1732
|
-
private readonly USDC_ADDRESS;
|
|
1733
|
-
private readonly USDC_DECIMALS;
|
|
1734
|
-
constructor(config: IConfig, tokens: TokenInfo[]);
|
|
1735
|
-
private div2Power128;
|
|
1736
|
-
getPrice(tokenAddr: string, blockIdentifier?: BlockIdentifier): Promise<PriceInfo>;
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
1880
|
declare class FatalError extends Error {
|
|
1740
1881
|
constructor(message: string, err?: Error);
|
|
1741
1882
|
}
|
|
@@ -1754,6 +1895,7 @@ declare class Global {
|
|
|
1754
1895
|
static getTokens(): Promise<TokenInfo[]>;
|
|
1755
1896
|
static assert(condition: any, message: string): void;
|
|
1756
1897
|
static getTokenInfoFromAddr(addr: ContractAddr): Promise<TokenInfo>;
|
|
1898
|
+
static getTokenInfoFromName(tokenName: string): Promise<TokenInfo>;
|
|
1757
1899
|
static setGlobalCache(key: string, data: any, ttl?: number): void;
|
|
1758
1900
|
static getGlobalCache<T>(key: string): T | null;
|
|
1759
1901
|
}
|
|
@@ -1967,4 +2109,4 @@ declare class PasswordJsonCryptoUtil {
|
|
|
1967
2109
|
decrypt(encryptedData: string, password: string): any;
|
|
1968
2110
|
}
|
|
1969
2111
|
|
|
1970
|
-
export { APYType, AUMTypes, AVNU_EXCHANGE, AVNU_MIDDLEWARE, type AccessControlInfo, AccessControlType, type AccountInfo, type AdapterLeafType, type AllAccountsStore, type ApproveCallParams, AuditStatus, AutoCompounderSTRK, type AvnuSwapCallParams, AvnuWrapper, BaseAdapter, type BaseAdapterConfig, BaseStrategy, type CLVaultStrategySettings, CommonAdapter, type CommonAdapterConfig, ContractAddr, type DecreaseLeverParams, Deployer, type DualActionAmount, type DualTokenInfo, ERC20, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey,
|
|
2112
|
+
export { APYType, AUMTypes, AVNU_EXCHANGE, AVNU_MIDDLEWARE, type AccessControlInfo, AccessControlType, type AccountInfo, type AdapterLeafType, type AllAccountsStore, type AmountInfo, type AmountsInfo, type ApproveCallParams, AuditStatus, AutoCompounderSTRK, type AvnuSwapCallParams, AvnuWrapper, BaseAdapter, type BaseAdapterConfig, BaseStrategy, type CLVaultStrategySettings, CommonAdapter, type CommonAdapterConfig, ContractAddr, type DecreaseLeverParams, Deployer, type DualActionAmount, type DualTokenInfo, ERC20, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey, type EkuboQuote, EkuboQuoter, type EkuboRouteNode, type EkuboSplit, type FAQ, FactoryStrategyType, FatalError, type FilterOption, type FlashloanCallParams, FlowChartColors, type GenerateCallFn, Global, HyperLSTStrategies, type HyperLSTStrategySettings, type IConfig, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, type IncreaseLeverParams, Initializable, InstantWithdrawalVault, LSTAPRService, type LSTStats, type LeafAdapterFn, type LeafData, type LendingToken, type ManageCall, MarginType, MyNumber, type NetAPYDetails, type NetAPYSplit, Network, PRICE_ROUTER, PasswordJsonCryptoUtil, type PositionAPY, type PositionInfo, Pragma, type PriceInfo, Pricer, PricerFromApi, PricerLST, PricerRedis, Protocols, type RedemptionExpectedTime, type RedemptionInfo, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, RiskType, type Route, type RouteNode, SIMPLE_SANITIZER, SIMPLE_SANITIZER_V2, SIMPLE_SANITIZER_VESU_V1_DELEGATIONS, type SecurityMetadata, SenseiStrategies, SenseiVault, type SenseiVaultSettings, type SingleActionAmount, type SingleTokenInfo, type SourceCodeInfo, SourceCodeType, StandardMerkleTree, type StandardMerkleTreeData, Store, type StoreConfig, type StrategyAlert, type StrategyCapabilities, type StrategyFilterMetadata, StrategyLiveStatus, type StrategyMetadata, type StrategyRegistryEntry, type StrategySettings, StrategyTag, StrategyType, type SupportedPosition, type Swap, type SwapInfo, TelegramGroupNotif, TelegramNotif, type TokenAmount, type TokenInfo, UNIVERSAL_ADAPTERS, UNIVERSAL_MANAGE_IDS, UniversalLstMultiplierStrategy, type UniversalManageCall, UniversalStrategies, UniversalStrategy, type UniversalStrategySettings, VESU_SINGLETON, VESU_V2_MODIFY_POSITION_SANITIZER, type VaultPosition, VaultType, VesuAdapter, type VesuAdapterConfig, type VesuAmount, VesuAmountDenomination, VesuAmountType, type VesuDefiSpringRewardsCallParams, type VesuModifyDelegationCallParams, type VesuModifyPositionCallParams, type VesuMultiplyCallParams, VesuPools, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, Web3Number, ZkLend, assert, buildStrategyRegistry, createEkuboCLStrategy, createHyperLSTStrategy, createSenseiStrategy, createStrategy, createUniversalStrategy, createVesuRebalanceStrategy, detectCapabilities, extensionMap, getAPIUsingHeadlessBrowser, getAllStrategyMetadata, getAllStrategyTags, getContractDetails, getDefaultStoreConfig, getFilterMetadata, getLiveStrategies, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getStrategiesByType, getStrategyTagDesciption, getStrategyTypeFromMetadata, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, isDualTokenStrategy, logger, toAmountsInfo, toBigInt };
|