@strkfarm/sdk 1.2.1 → 2.0.0-dca.2
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 +67035 -40458
- package/dist/index.browser.mjs +5218 -1908
- package/dist/index.d.ts +478 -33
- package/dist/index.js +5500 -2157
- package/dist/index.mjs +5441 -2129
- package/package.json +4 -1
- package/src/data/ekubo-price-fethcer.abi.json +265 -0
- package/src/data/yoloVault.abi.json +777 -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/dataTypes/index.ts +3 -2
- package/src/dataTypes/mynumber.ts +141 -0
- package/src/global.ts +42 -0
- package/src/index.browser.ts +2 -1
- package/src/interfaces/common.tsx +168 -2
- package/src/modules/apollo-client-config.ts +28 -0
- package/src/modules/avnu.ts +1 -1
- package/src/modules/ekubo-pricer.ts +79 -0
- package/src/modules/erc20.ts +18 -2
- package/src/modules/pragma.ts +23 -8
- package/src/modules/pricer-from-api.ts +150 -14
- package/src/modules/pricer.ts +2 -1
- package/src/modules/pricerBase.ts +2 -1
- package/src/node/pricer-redis.ts +2 -1
- package/src/strategies/base-strategy.ts +81 -2
- package/src/strategies/ekubo-cl-vault.tsx +686 -316
- package/src/strategies/factory.ts +159 -0
- package/src/strategies/index.ts +5 -1
- package/src/strategies/registry.ts +239 -0
- package/src/strategies/sensei.ts +361 -13
- 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 +1396 -463
- package/src/strategies/universal-strategy.tsx +287 -129
- package/src/strategies/vesu-rebalance.tsx +242 -146
- package/src/strategies/yoloVault.ts +463 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/logger.node.ts +11 -4
- package/src/utils/strategy-utils.ts +61 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import BigNumber from 'bignumber.js';
|
|
2
1
|
import * as starknet from 'starknet';
|
|
3
|
-
import { RpcProvider, BlockIdentifier, Contract,
|
|
2
|
+
import { Uint256, RpcProvider, BlockIdentifier, Contract, Call, Account, CairoCustomEnum, RawArgs } from 'starknet';
|
|
3
|
+
import BigNumber from 'bignumber.js';
|
|
4
4
|
import React, { ReactNode } from 'react';
|
|
5
5
|
import { Quote, AvnuOptions } from '@avnu/avnu-sdk';
|
|
6
6
|
import { HexString, BytesLike } from '@ericnordelo/strk-merkle-tree/dist/bytes';
|
|
@@ -31,10 +31,12 @@ declare class _Web3Number<T extends _Web3Number<T>> extends BigNumber {
|
|
|
31
31
|
mag: bigint;
|
|
32
32
|
sign: 0 | 1;
|
|
33
33
|
};
|
|
34
|
+
toUint256(): starknet.Uint256;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
declare class Web3Number extends _Web3Number<Web3Number> {
|
|
37
38
|
static fromWei(weiNumber: string | number, decimals: number): Web3Number;
|
|
39
|
+
static fromUint256(uint256Value: Uint256): Web3Number;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
/**
|
|
@@ -53,6 +55,33 @@ declare class ContractAddr {
|
|
|
53
55
|
toBigInt(): bigint;
|
|
54
56
|
}
|
|
55
57
|
|
|
58
|
+
declare const customInspectSymbol: unique symbol;
|
|
59
|
+
declare class MyNumber {
|
|
60
|
+
bigNumber: BigNumber;
|
|
61
|
+
decimals: number;
|
|
62
|
+
constructor(bigNumber: string, decimals: number);
|
|
63
|
+
static fromEther(num: string, decimals: number): MyNumber;
|
|
64
|
+
static fromZero(): MyNumber;
|
|
65
|
+
toString(): string;
|
|
66
|
+
toEtherStr(): string;
|
|
67
|
+
toFixedStr(decimals: number): string;
|
|
68
|
+
toEtherToFixedDecimals(decimals: number): string;
|
|
69
|
+
isZero(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @param amountEther in token terms without decimal e.g. 1 for 1 STRK
|
|
73
|
+
* @param command BigNumber compare funds. e.g. gte, gt, lt
|
|
74
|
+
* @returns
|
|
75
|
+
* @dev Add more commands as needed
|
|
76
|
+
*/
|
|
77
|
+
compare(amountEther: string, command: "gte" | "gt" | "lt"): boolean;
|
|
78
|
+
operate(command: "div" | "plus" | "mul", value: string | number): MyNumber;
|
|
79
|
+
subtract(value: MyNumber): MyNumber;
|
|
80
|
+
static min(a: MyNumber, b: MyNumber): MyNumber;
|
|
81
|
+
static max(a: MyNumber, b: MyNumber): MyNumber;
|
|
82
|
+
[customInspectSymbol](depth: any, inspectOptions: any, inspect: any): string;
|
|
83
|
+
}
|
|
84
|
+
|
|
56
85
|
declare enum RiskType {
|
|
57
86
|
MARKET_RISK = "Market Risk",
|
|
58
87
|
IMPERMANENT_LOSS = "Impermanent Loss Risk",
|
|
@@ -96,6 +125,57 @@ interface IProtocol {
|
|
|
96
125
|
name: string;
|
|
97
126
|
logo: string;
|
|
98
127
|
}
|
|
128
|
+
declare enum StrategyTag {
|
|
129
|
+
META_VAULT = "Meta Vaults",
|
|
130
|
+
LEVERED = "Maxx",
|
|
131
|
+
AUTOMATED_LP = "Ekubo",
|
|
132
|
+
BTC = "BTC"
|
|
133
|
+
}
|
|
134
|
+
declare enum VaultType {
|
|
135
|
+
LOOPING = "Looping",
|
|
136
|
+
META_VAULT = "Meta Vault",
|
|
137
|
+
DELTA_NEUTRAL = "Delta Neutral",
|
|
138
|
+
AUTOMATED_LP = "Automated LP",
|
|
139
|
+
Other = "Other"
|
|
140
|
+
}
|
|
141
|
+
declare enum AuditStatus {
|
|
142
|
+
AUDITED = "Audited",
|
|
143
|
+
NOT_AUDITED = "Not Audited"
|
|
144
|
+
}
|
|
145
|
+
declare enum SourceCodeType {
|
|
146
|
+
OPEN_SOURCE = "Open Source",
|
|
147
|
+
CLOSED_SOURCE = "Closed Source"
|
|
148
|
+
}
|
|
149
|
+
declare enum AccessControlType {
|
|
150
|
+
MULTISIG_ACCOUNT = "Multisig Account",
|
|
151
|
+
STANDARD_ACCOUNT = "Standard Account"
|
|
152
|
+
}
|
|
153
|
+
declare enum InstantWithdrawalVault {
|
|
154
|
+
YES = "Yes",
|
|
155
|
+
NO = "No"
|
|
156
|
+
}
|
|
157
|
+
interface SourceCodeInfo {
|
|
158
|
+
type: SourceCodeType;
|
|
159
|
+
contractLink: string;
|
|
160
|
+
}
|
|
161
|
+
interface AccessControlInfo {
|
|
162
|
+
type: AccessControlType;
|
|
163
|
+
addresses: ContractAddr[];
|
|
164
|
+
timeLock: string;
|
|
165
|
+
}
|
|
166
|
+
interface SecurityMetadata {
|
|
167
|
+
auditStatus: AuditStatus;
|
|
168
|
+
sourceCode: SourceCodeInfo;
|
|
169
|
+
accessControl: AccessControlInfo;
|
|
170
|
+
}
|
|
171
|
+
interface RedemptionInfo {
|
|
172
|
+
instantWithdrawalVault: InstantWithdrawalVault;
|
|
173
|
+
redemptionsInfo: {
|
|
174
|
+
title: string;
|
|
175
|
+
description: string;
|
|
176
|
+
}[];
|
|
177
|
+
alerts: StrategyAlert[];
|
|
178
|
+
}
|
|
99
179
|
declare enum FlowChartColors {
|
|
100
180
|
Green = "purple",
|
|
101
181
|
Blue = "#35484f",
|
|
@@ -105,26 +185,62 @@ interface FAQ {
|
|
|
105
185
|
question: string | React.ReactNode;
|
|
106
186
|
answer: string | React.ReactNode;
|
|
107
187
|
}
|
|
188
|
+
declare enum StrategyLiveStatus {
|
|
189
|
+
ACTIVE = "Active",
|
|
190
|
+
NEW = "New",
|
|
191
|
+
COMING_SOON = "Coming Soon",
|
|
192
|
+
DEPRECATED = "Deprecated",// active but not recommended
|
|
193
|
+
RETIRED = "Retired",// not active anymore
|
|
194
|
+
HOT = "Hot & New \uD83D\uDD25"
|
|
195
|
+
}
|
|
196
|
+
interface StrategyAlert {
|
|
197
|
+
type: "warning" | "info";
|
|
198
|
+
text: string | React.ReactNode;
|
|
199
|
+
tab: "all" | "deposit" | "withdraw";
|
|
200
|
+
}
|
|
201
|
+
interface StrategySettings {
|
|
202
|
+
maxTVL?: Web3Number;
|
|
203
|
+
liveStatus?: StrategyLiveStatus;
|
|
204
|
+
isPaused?: boolean;
|
|
205
|
+
isInMaintenance?: boolean;
|
|
206
|
+
isAudited: boolean;
|
|
207
|
+
isInstantWithdrawal?: boolean;
|
|
208
|
+
hideHarvestInfo?: boolean;
|
|
209
|
+
is_promoted?: boolean;
|
|
210
|
+
isTransactionHistDisabled?: boolean;
|
|
211
|
+
quoteToken: TokenInfo;
|
|
212
|
+
hideNetEarnings?: boolean;
|
|
213
|
+
showWithdrawalWarningModal?: boolean;
|
|
214
|
+
alerts?: StrategyAlert[];
|
|
215
|
+
tags?: StrategyTag[];
|
|
216
|
+
}
|
|
108
217
|
/**
|
|
109
218
|
* @property risk.riskFactor.factor - The risk factors that are considered for the strategy.
|
|
110
219
|
* @property risk.riskFactor.factor - The value of the risk factor from 0 to 10, 0 being the lowest and 10 being the highest.
|
|
220
|
+
* @property security - Security-related metadata including audit status, source code information, and access control details.
|
|
221
|
+
* @property redemptionInfo - Redemption information including instant withdrawal availability and expected redemption times.
|
|
111
222
|
*/
|
|
112
223
|
interface IStrategyMetadata<T> {
|
|
224
|
+
id: string;
|
|
113
225
|
name: string;
|
|
114
226
|
description: string | React.ReactNode;
|
|
115
227
|
address: ContractAddr;
|
|
116
228
|
launchBlock: number;
|
|
117
229
|
type: "ERC4626" | "ERC721" | "Other";
|
|
230
|
+
vaultType: {
|
|
231
|
+
type: VaultType;
|
|
232
|
+
description: string;
|
|
233
|
+
};
|
|
118
234
|
depositTokens: TokenInfo[];
|
|
119
235
|
protocols: IProtocol[];
|
|
120
236
|
auditUrl?: string;
|
|
121
|
-
maxTVL: Web3Number;
|
|
122
237
|
risk: {
|
|
123
238
|
riskFactor: RiskFactor[];
|
|
124
239
|
netRisk: number;
|
|
125
240
|
notARisks: RiskType[];
|
|
126
241
|
};
|
|
127
242
|
apyMethodology?: string;
|
|
243
|
+
realizedAPYMethodology?: string;
|
|
128
244
|
additionalInfo: T;
|
|
129
245
|
contractDetails: {
|
|
130
246
|
address: ContractAddr;
|
|
@@ -144,6 +260,36 @@ interface IStrategyMetadata<T> {
|
|
|
144
260
|
logo: string;
|
|
145
261
|
};
|
|
146
262
|
isPreview?: boolean;
|
|
263
|
+
tags?: StrategyTag[];
|
|
264
|
+
security: SecurityMetadata;
|
|
265
|
+
redemptionInfo: RedemptionInfo;
|
|
266
|
+
usualTimeToEarnings: null | string;
|
|
267
|
+
usualTimeToEarningsDescription: null | string;
|
|
268
|
+
discontinuationInfo?: {
|
|
269
|
+
date?: Date;
|
|
270
|
+
reason?: React.ReactNode | string;
|
|
271
|
+
info?: React.ReactNode | string;
|
|
272
|
+
};
|
|
273
|
+
settings?: StrategySettings;
|
|
274
|
+
actions?: Array<{
|
|
275
|
+
name?: string;
|
|
276
|
+
pool?: {
|
|
277
|
+
protocol?: {
|
|
278
|
+
name: string;
|
|
279
|
+
logo: string;
|
|
280
|
+
};
|
|
281
|
+
pool?: {
|
|
282
|
+
name: string;
|
|
283
|
+
logos?: string[];
|
|
284
|
+
};
|
|
285
|
+
apr?: number;
|
|
286
|
+
borrow?: {
|
|
287
|
+
apr?: number;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
amount?: string | number;
|
|
291
|
+
isDeposit?: boolean;
|
|
292
|
+
}>;
|
|
147
293
|
}
|
|
148
294
|
interface IInvestmentFlow {
|
|
149
295
|
id?: string;
|
|
@@ -156,6 +302,8 @@ interface IInvestmentFlow {
|
|
|
156
302
|
style?: any;
|
|
157
303
|
}
|
|
158
304
|
declare function getMainnetConfig(rpcUrl?: string, blockIdentifier?: BlockIdentifier): IConfig;
|
|
305
|
+
declare const getStrategyTagDesciption: (tag: StrategyTag) => string;
|
|
306
|
+
declare const getAllStrategyTags: () => StrategyTag[];
|
|
159
307
|
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.";
|
|
160
308
|
declare const getRiskColor: (risk: RiskFactor) => "light_green_2" | "yellow" | "red";
|
|
161
309
|
declare const getNoRiskTags: (risks: RiskFactor[]) => RiskType[];
|
|
@@ -170,6 +318,27 @@ interface VaultPosition {
|
|
|
170
318
|
token: TokenInfo;
|
|
171
319
|
remarks: string;
|
|
172
320
|
}
|
|
321
|
+
interface AmountInfo {
|
|
322
|
+
amount: Web3Number;
|
|
323
|
+
usdValue: number;
|
|
324
|
+
tokenInfo: TokenInfo;
|
|
325
|
+
}
|
|
326
|
+
interface AmountsInfo {
|
|
327
|
+
usdValue: number;
|
|
328
|
+
amounts: AmountInfo[];
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Strategy capabilities interface
|
|
332
|
+
* Describes what optional methods a strategy instance supports
|
|
333
|
+
*/
|
|
334
|
+
interface StrategyCapabilities {
|
|
335
|
+
hasMatchInputAmounts: boolean;
|
|
336
|
+
hasNetAPY: boolean;
|
|
337
|
+
hasGetInvestmentFlows: boolean;
|
|
338
|
+
hasGetPendingRewards: boolean;
|
|
339
|
+
hasHarvest: boolean;
|
|
340
|
+
hasRebalance: boolean;
|
|
341
|
+
}
|
|
173
342
|
declare const Protocols: {
|
|
174
343
|
VESU: IProtocol;
|
|
175
344
|
ENDUR: IProtocol;
|
|
@@ -232,7 +401,7 @@ declare abstract class PricerBase {
|
|
|
232
401
|
readonly config: IConfig;
|
|
233
402
|
readonly tokens: TokenInfo[];
|
|
234
403
|
constructor(config: IConfig, tokens: TokenInfo[]);
|
|
235
|
-
getPrice(tokenSymbol: string): Promise<PriceInfo>;
|
|
404
|
+
getPrice(tokenSymbol: string, blockNumber?: BlockIdentifier): Promise<PriceInfo>;
|
|
236
405
|
}
|
|
237
406
|
|
|
238
407
|
interface PriceInfo {
|
|
@@ -259,7 +428,7 @@ declare class Pricer extends PricerBase {
|
|
|
259
428
|
start(): void;
|
|
260
429
|
isStale(timestamp: Date, tokenName: string): boolean;
|
|
261
430
|
assertNotStale(timestamp: Date, tokenName: string): void;
|
|
262
|
-
getPrice(tokenSymbol: string): Promise<PriceInfo>;
|
|
431
|
+
getPrice(tokenSymbol: string, blockNumber?: BlockIdentifier): Promise<PriceInfo>;
|
|
263
432
|
protected _loadPrices(onUpdate?: (tokenSymbol: string) => void): void;
|
|
264
433
|
_getPrice(token: TokenInfo, defaultMethod?: string): Promise<number>;
|
|
265
434
|
_getPriceCoinbase(token: TokenInfo): Promise<number>;
|
|
@@ -268,11 +437,11 @@ declare class Pricer extends PricerBase {
|
|
|
268
437
|
_getPriceEkubo(token: TokenInfo, amountIn?: Web3Number, retry?: number): Promise<number>;
|
|
269
438
|
}
|
|
270
439
|
|
|
271
|
-
declare class Pragma {
|
|
440
|
+
declare class Pragma extends PricerBase {
|
|
272
441
|
contractAddr: string;
|
|
273
442
|
readonly contract: Contract;
|
|
274
|
-
constructor(
|
|
275
|
-
getPrice(tokenAddr: string): Promise<
|
|
443
|
+
constructor(config: IConfig, tokens: TokenInfo[]);
|
|
444
|
+
getPrice(tokenAddr: string, blockIdentifier?: BlockIdentifier): Promise<PriceInfo>;
|
|
276
445
|
}
|
|
277
446
|
|
|
278
447
|
declare class ZkLend extends ILending implements ILending {
|
|
@@ -307,12 +476,23 @@ declare class ZkLend extends ILending implements ILending {
|
|
|
307
476
|
}
|
|
308
477
|
|
|
309
478
|
declare class PricerFromApi extends PricerBase {
|
|
479
|
+
private apolloClient;
|
|
480
|
+
private pragma;
|
|
481
|
+
private ekuboPricer;
|
|
482
|
+
private readonly PRAGMA_SUPPORTED_TOKENS;
|
|
310
483
|
constructor(config: IConfig, tokens: TokenInfo[]);
|
|
311
|
-
getPrice(tokenSymbol: string): Promise<PriceInfo>;
|
|
484
|
+
getPrice(tokenSymbol: string, blockNumber?: BlockIdentifier): Promise<PriceInfo>;
|
|
312
485
|
getPriceFromMyAPI(tokenSymbol: string): Promise<{
|
|
313
486
|
price: number;
|
|
314
487
|
timestamp: Date;
|
|
315
488
|
}>;
|
|
489
|
+
/**
|
|
490
|
+
* Fetches historical price for a token at a specific block number
|
|
491
|
+
* @param tokenSymbol - The token symbol to get price for
|
|
492
|
+
* @param blockNumber - The block number to query
|
|
493
|
+
* @returns PriceInfo with price at the closest block <= blockNumber
|
|
494
|
+
*/
|
|
495
|
+
getHistoricalPrice(tokenSymbol: string, blockNumber: BlockIdentifier): Promise<PriceInfo>;
|
|
316
496
|
}
|
|
317
497
|
|
|
318
498
|
declare class ERC20 {
|
|
@@ -321,6 +501,7 @@ declare class ERC20 {
|
|
|
321
501
|
contract(addr: string | ContractAddr): Contract;
|
|
322
502
|
balanceOf(token: string | ContractAddr, address: string | ContractAddr, tokenDecimals: number): Promise<Web3Number>;
|
|
323
503
|
allowance(token: string | ContractAddr, owner: string | ContractAddr, spender: string | ContractAddr, tokenDecimals: number): Promise<Web3Number>;
|
|
504
|
+
approve(token: string | ContractAddr, spender: string | ContractAddr, amount: Web3Number): starknet.Call;
|
|
324
505
|
}
|
|
325
506
|
|
|
326
507
|
interface Route {
|
|
@@ -418,6 +599,14 @@ interface DualTokenInfo {
|
|
|
418
599
|
token0: SingleTokenInfo;
|
|
419
600
|
token1: SingleTokenInfo;
|
|
420
601
|
}
|
|
602
|
+
interface NetAPYSplit {
|
|
603
|
+
apy: number;
|
|
604
|
+
id: string;
|
|
605
|
+
}
|
|
606
|
+
interface NetAPYDetails {
|
|
607
|
+
net: number;
|
|
608
|
+
splits: NetAPYSplit[];
|
|
609
|
+
}
|
|
421
610
|
interface CacheData {
|
|
422
611
|
timestamp: number;
|
|
423
612
|
ttl: number;
|
|
@@ -427,12 +616,34 @@ declare class BaseStrategy<TVLInfo, ActionInfo> extends CacheClass {
|
|
|
427
616
|
readonly config: IConfig;
|
|
428
617
|
readonly cache: Map<string, CacheData>;
|
|
429
618
|
constructor(config: IConfig);
|
|
430
|
-
getUserTVL(user: ContractAddr): Promise<TVLInfo>;
|
|
619
|
+
getUserTVL(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<TVLInfo>;
|
|
431
620
|
getTVL(): Promise<TVLInfo>;
|
|
432
621
|
depositCall(amountInfo: ActionInfo, receiver: ContractAddr): Promise<Call[]>;
|
|
433
622
|
withdrawCall(amountInfo: ActionInfo, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
|
|
434
623
|
getVaultPositions(): Promise<VaultPosition[]>;
|
|
624
|
+
netAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number, timeperiod?: "24h" | "7d" | "30d" | "3m"): Promise<number | NetAPYDetails>;
|
|
435
625
|
getPendingRewards(): Promise<HarvestInfo[]>;
|
|
626
|
+
getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
|
|
627
|
+
/**
|
|
628
|
+
* Calculate lifetime earnings for a user based on provided data from client
|
|
629
|
+
* Formula: lifetimeEarnings = currentValue + totalWithdrawals - totalDeposits
|
|
630
|
+
*
|
|
631
|
+
* @param userTVL - The user's current TVL (SingleTokenInfo with amount, usdValue, tokenInfo)
|
|
632
|
+
* @param investmentFlows - Array of investment flow transactions from client
|
|
633
|
+
* @returns Object containing lifetime earnings, current value, and total deposits/withdrawals
|
|
634
|
+
*/
|
|
635
|
+
getLifetimeEarnings(userTVL: SingleTokenInfo, investmentFlows: Array<{
|
|
636
|
+
amount: string;
|
|
637
|
+
type: string;
|
|
638
|
+
timestamp: number;
|
|
639
|
+
tx_hash: string;
|
|
640
|
+
}>): {
|
|
641
|
+
tokenInfo: SingleTokenInfo;
|
|
642
|
+
lifetimeEarnings: Web3Number;
|
|
643
|
+
currentValue: Web3Number;
|
|
644
|
+
totalDeposits: Web3Number;
|
|
645
|
+
totalWithdrawals: Web3Number;
|
|
646
|
+
};
|
|
436
647
|
}
|
|
437
648
|
|
|
438
649
|
interface PoolProps {
|
|
@@ -513,16 +724,16 @@ declare class VesuRebalance extends BaseStrategy<SingleTokenInfo, SingleActionAm
|
|
|
513
724
|
* @returns Number of decimals (same as the underlying token)
|
|
514
725
|
*/
|
|
515
726
|
decimals(): number;
|
|
516
|
-
|
|
517
|
-
* Calculates the Total Value Locked (TVL) for a specific user.
|
|
518
|
-
* @param user - Address of the user
|
|
519
|
-
* @returns Object containing the amount in token units and USD value
|
|
520
|
-
*/
|
|
521
|
-
getUserTVL(user: ContractAddr): Promise<{
|
|
727
|
+
getUserTVL(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<{
|
|
522
728
|
tokenInfo: TokenInfo;
|
|
523
729
|
amount: Web3Number;
|
|
524
730
|
usdValue: number;
|
|
525
731
|
}>;
|
|
732
|
+
/**
|
|
733
|
+
* Calculates user realized APY based on trueSharesBasedAPY method.
|
|
734
|
+
* Returns the APY as a number.
|
|
735
|
+
*/
|
|
736
|
+
getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
|
|
526
737
|
/**
|
|
527
738
|
* Calculates the total TVL of the strategy.
|
|
528
739
|
* @returns Object containing the total amount in token units and USD value
|
|
@@ -718,11 +929,30 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
|
|
|
718
929
|
rebalanceCall(newBounds: EkuboBounds, swapParams: SwapInfo): Call[];
|
|
719
930
|
handleUnusedCall(swapParams: SwapInfo): Call[];
|
|
720
931
|
handleFeesCall(): Call[];
|
|
721
|
-
getFeeHistory(timePeriod?: '24h' | '7d' | '30d' | '3m'
|
|
932
|
+
getFeeHistory(timePeriod?: '24h' | '7d' | '30d' | '3m' | '6m', range?: {
|
|
933
|
+
startTimestamp?: number;
|
|
934
|
+
endTimestamp?: number;
|
|
935
|
+
}): Promise<{
|
|
722
936
|
summary: DualTokenInfo;
|
|
723
937
|
history: FeeHistory[];
|
|
724
938
|
}>;
|
|
725
939
|
netSharesBasedTrueAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
|
|
940
|
+
/**
|
|
941
|
+
* Calculate lifetime earnings for a user
|
|
942
|
+
* Not yet implemented for Ekubo CL Vault strategy
|
|
943
|
+
*/
|
|
944
|
+
getLifetimeEarnings(userTVL: SingleTokenInfo, investmentFlows: Array<{
|
|
945
|
+
amount: string;
|
|
946
|
+
type: string;
|
|
947
|
+
timestamp: number;
|
|
948
|
+
tx_hash: string;
|
|
949
|
+
}>): any;
|
|
950
|
+
/**
|
|
951
|
+
* Calculates realized APY based on TVL per share growth, always valued in USDC.
|
|
952
|
+
* This is a vault-level metric (same for all users) and works for all strategies,
|
|
953
|
+
* regardless of quote asset configuration.
|
|
954
|
+
*/
|
|
955
|
+
getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
|
|
726
956
|
feeBasedAPY(timeperiod?: '24h' | '7d' | '30d' | '3m'): Promise<number>;
|
|
727
957
|
/**
|
|
728
958
|
* Calculates assets before and now in a given token of TVL per share to observe growth
|
|
@@ -904,7 +1134,7 @@ declare class SenseiVault extends BaseStrategy<SingleTokenInfo, SingleActionAmou
|
|
|
904
1134
|
readonly pricer: PricerBase;
|
|
905
1135
|
readonly contract: Contract;
|
|
906
1136
|
constructor(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<SenseiVaultSettings>);
|
|
907
|
-
getUserTVL(user: ContractAddr): Promise<SingleTokenInfo>;
|
|
1137
|
+
getUserTVL(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<SingleTokenInfo>;
|
|
908
1138
|
getTVL(): Promise<SingleTokenInfo>;
|
|
909
1139
|
depositCall(amountInfo: SingleActionAmount, receiver: ContractAddr): Promise<Call[]>;
|
|
910
1140
|
withdrawCall(amountInfo: SingleActionAmount, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
|
|
@@ -918,9 +1148,67 @@ declare class SenseiVault extends BaseStrategy<SingleTokenInfo, SingleActionAmou
|
|
|
918
1148
|
}>;
|
|
919
1149
|
getSecondaryTokenPriceRelativeToMain(retry?: number): Promise<number>;
|
|
920
1150
|
getSettings: () => Promise<starknet.CallResult>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Calculate lifetime earnings for a user
|
|
1153
|
+
* Not yet implemented for Sensei Vault strategy
|
|
1154
|
+
*/
|
|
1155
|
+
getLifetimeEarnings(userTVL: SingleTokenInfo, investmentFlows: Array<{
|
|
1156
|
+
amount: string;
|
|
1157
|
+
type: string;
|
|
1158
|
+
timestamp: number;
|
|
1159
|
+
tx_hash: string;
|
|
1160
|
+
}>): any;
|
|
1161
|
+
netAPY(): Promise<number>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Calculates user realized APY based on position growth accounting for deposits and withdrawals.
|
|
1164
|
+
* Returns the APY as a number.
|
|
1165
|
+
* Not implemented for Sensei Strategy yet.
|
|
1166
|
+
*/
|
|
1167
|
+
getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
|
|
921
1168
|
}
|
|
922
1169
|
declare const SenseiStrategies: IStrategyMetadata<SenseiVaultSettings>[];
|
|
923
1170
|
|
|
1171
|
+
interface YoloVaultSettings {
|
|
1172
|
+
mainToken: TokenInfo;
|
|
1173
|
+
secondaryToken: TokenInfo;
|
|
1174
|
+
maxUnitsSpendPerEpoch: number;
|
|
1175
|
+
feeBps: number;
|
|
1176
|
+
}
|
|
1177
|
+
interface UserYoloInfo {
|
|
1178
|
+
shares: bigint;
|
|
1179
|
+
claimable_second_tokens: bigint;
|
|
1180
|
+
base_token_balance: bigint;
|
|
1181
|
+
second_token_last_index: bigint;
|
|
1182
|
+
second_token_balance: bigint;
|
|
1183
|
+
}
|
|
1184
|
+
interface YoloVaultStatus {
|
|
1185
|
+
current_epoch: bigint;
|
|
1186
|
+
total_epochs: bigint;
|
|
1187
|
+
remaining_base: bigint;
|
|
1188
|
+
total_second_tokens: bigint;
|
|
1189
|
+
global_second_token_index: bigint;
|
|
1190
|
+
total_shares: bigint;
|
|
1191
|
+
base_token_assets_per_share: bigint;
|
|
1192
|
+
}
|
|
1193
|
+
declare class YoLoVault extends BaseStrategy<DualTokenInfo, DualActionAmount> {
|
|
1194
|
+
readonly address: ContractAddr;
|
|
1195
|
+
readonly metadata: IStrategyMetadata<YoloVaultSettings>;
|
|
1196
|
+
readonly pricer: PricerBase;
|
|
1197
|
+
readonly contract: Contract;
|
|
1198
|
+
constructor(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<YoloVaultSettings>);
|
|
1199
|
+
formatTokenAmount(amount: Web3Number, decimals: number): Web3Number;
|
|
1200
|
+
private getNormalizedUserInfo;
|
|
1201
|
+
private resolveWithdrawRequest;
|
|
1202
|
+
getUserTVL(user: ContractAddr): Promise<DualTokenInfo>;
|
|
1203
|
+
getTVL(): Promise<DualTokenInfo>;
|
|
1204
|
+
depositCall(amountInfo: DualActionAmount): Promise<Call[]>;
|
|
1205
|
+
getVaultStatus(): Promise<YoloVaultStatus>;
|
|
1206
|
+
matchInputAmounts(amountInfo: DualActionAmount, user: ContractAddr): Promise<DualActionAmount>;
|
|
1207
|
+
withdrawCall(amountInfo: DualActionAmount, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
|
|
1208
|
+
getSettings: () => Promise<starknet.CallResult>;
|
|
1209
|
+
}
|
|
1210
|
+
declare const YoloVaultStrategies: IStrategyMetadata<YoloVaultSettings>[];
|
|
1211
|
+
|
|
924
1212
|
interface LeveledLogMethod {
|
|
925
1213
|
(message: string, ...meta: any[]): void;
|
|
926
1214
|
(message: any): void;
|
|
@@ -954,6 +1242,24 @@ declare class StandardMerkleTree extends MerkleTreeImpl<LeafData> {
|
|
|
954
1242
|
dump(): StandardMerkleTreeData<LeafData>;
|
|
955
1243
|
}
|
|
956
1244
|
|
|
1245
|
+
/**
|
|
1246
|
+
* Convert SDK TVL info (SingleTokenInfo or DualTokenInfo) to client AmountsInfo format
|
|
1247
|
+
*/
|
|
1248
|
+
declare function toAmountsInfo(tvlInfo: SingleTokenInfo | DualTokenInfo): Omit<AmountsInfo, "amounts"> & {
|
|
1249
|
+
amounts: Array<{
|
|
1250
|
+
amount: Web3Number;
|
|
1251
|
+
tokenInfo: TokenInfo;
|
|
1252
|
+
}>;
|
|
1253
|
+
};
|
|
1254
|
+
/**
|
|
1255
|
+
* Detect what capabilities a strategy instance has
|
|
1256
|
+
*/
|
|
1257
|
+
declare function detectCapabilities(strategy: BaseStrategy<any, any>): StrategyCapabilities;
|
|
1258
|
+
/**
|
|
1259
|
+
* Check if a strategy is a dual-token strategy
|
|
1260
|
+
*/
|
|
1261
|
+
declare function isDualTokenStrategy(strategy: BaseStrategy<any, any>): boolean;
|
|
1262
|
+
|
|
957
1263
|
type RequiredFields<T> = {
|
|
958
1264
|
[K in keyof T]-?: T[K];
|
|
959
1265
|
};
|
|
@@ -1156,6 +1462,24 @@ declare const VesuPools: {
|
|
|
1156
1462
|
Re7xSTRK: ContractAddr;
|
|
1157
1463
|
Re7xBTC: ContractAddr;
|
|
1158
1464
|
Prime: ContractAddr;
|
|
1465
|
+
Re7STRK: ContractAddr;
|
|
1466
|
+
};
|
|
1467
|
+
declare const VesuPoolMetadata: {
|
|
1468
|
+
[VesuPools.Genesis.address]: {
|
|
1469
|
+
name: string;
|
|
1470
|
+
};
|
|
1471
|
+
[VesuPools.Re7xSTRK.address]: {
|
|
1472
|
+
name: string;
|
|
1473
|
+
};
|
|
1474
|
+
[VesuPools.Re7xBTC.address]: {
|
|
1475
|
+
name: string;
|
|
1476
|
+
};
|
|
1477
|
+
[VesuPools.Prime.address]: {
|
|
1478
|
+
name: string;
|
|
1479
|
+
};
|
|
1480
|
+
[VesuPools.Re7STRK.address]: {
|
|
1481
|
+
name: string;
|
|
1482
|
+
};
|
|
1159
1483
|
};
|
|
1160
1484
|
declare const extensionMap: {
|
|
1161
1485
|
[key: string]: ContractAddr;
|
|
@@ -1198,8 +1522,15 @@ declare class VesuAdapter extends BaseAdapter {
|
|
|
1198
1522
|
getModifyPositionCall: (params: VesuModifyPositionCallParams) => ManageCall;
|
|
1199
1523
|
getMultiplyAdapter: (id: string) => LeafAdapterFn<VesuMultiplyCallParams>;
|
|
1200
1524
|
getMultiplyCall: (params: VesuMultiplyCallParams) => ManageCall;
|
|
1201
|
-
getVesuModifyDelegationAdapter: (id: string) => LeafAdapterFn<VesuModifyDelegationCallParams>;
|
|
1202
|
-
getVesuModifyDelegationCall: (params: VesuModifyDelegationCallParams) =>
|
|
1525
|
+
getVesuModifyDelegationAdapter: (id: string, delegatee: ContractAddr) => LeafAdapterFn<VesuModifyDelegationCallParams>;
|
|
1526
|
+
getVesuModifyDelegationCall: (delegatee: ContractAddr) => (params: VesuModifyDelegationCallParams) => {
|
|
1527
|
+
sanitizer: ContractAddr;
|
|
1528
|
+
call: {
|
|
1529
|
+
contractAddress: ContractAddr;
|
|
1530
|
+
selector: string;
|
|
1531
|
+
calldata: bigint[];
|
|
1532
|
+
};
|
|
1533
|
+
};
|
|
1203
1534
|
getDefispringRewardsAdapter: (id: string) => () => AdapterLeafType<VesuDefiSpringRewardsCallParams>;
|
|
1204
1535
|
getDefiSpringClaimCall: () => GenerateCallFn<VesuDefiSpringRewardsCallParams>;
|
|
1205
1536
|
formatAmountTypeEnum(amountType: VesuAmountType): CairoCustomEnum;
|
|
@@ -1254,6 +1585,11 @@ declare const AVNU_EXCHANGE: ContractAddr;
|
|
|
1254
1585
|
declare const VESU_SINGLETON: ContractAddr;
|
|
1255
1586
|
declare function toBigInt(value: string | number): bigint;
|
|
1256
1587
|
|
|
1588
|
+
declare enum LSTPriceType {
|
|
1589
|
+
ENDUR_PRICE = "ENDUR_PRICE",
|
|
1590
|
+
AVNU_PRICE = "AVNU_PRICE"
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1257
1593
|
interface UniversalManageCall {
|
|
1258
1594
|
proofs: string[];
|
|
1259
1595
|
manageCall: ManageCall;
|
|
@@ -1300,12 +1636,7 @@ declare class UniversalStrategy<S extends UniversalStrategySettings> extends Bas
|
|
|
1300
1636
|
asset(): TokenInfo;
|
|
1301
1637
|
depositCall(amountInfo: SingleActionAmount, receiver: ContractAddr): Promise<Call[]>;
|
|
1302
1638
|
withdrawCall(amountInfo: SingleActionAmount, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
|
|
1303
|
-
|
|
1304
|
-
* Calculates the Total Value Locked (TVL) for a specific user.
|
|
1305
|
-
* @param user - Address of the user
|
|
1306
|
-
* @returns Object containing the amount in token units and USD value
|
|
1307
|
-
*/
|
|
1308
|
-
getUserTVL(user: ContractAddr): Promise<{
|
|
1639
|
+
getUserTVL(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<{
|
|
1309
1640
|
tokenInfo: TokenInfo;
|
|
1310
1641
|
amount: Web3Number;
|
|
1311
1642
|
usdValue: number;
|
|
@@ -1338,6 +1669,11 @@ declare class UniversalStrategy<S extends UniversalStrategySettings> extends Bas
|
|
|
1338
1669
|
weight: number;
|
|
1339
1670
|
}>;
|
|
1340
1671
|
private computeAPY;
|
|
1672
|
+
/**
|
|
1673
|
+
* Calculates user realized APY based on trueSharesBasedAPY method.
|
|
1674
|
+
* Returns the APY as a number.
|
|
1675
|
+
*/
|
|
1676
|
+
getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
|
|
1341
1677
|
/**
|
|
1342
1678
|
* Calculates the total TVL of the strategy.
|
|
1343
1679
|
* @returns Object containing the total amount in token units and USD value
|
|
@@ -1348,9 +1684,9 @@ declare class UniversalStrategy<S extends UniversalStrategySettings> extends Bas
|
|
|
1348
1684
|
usdValue: number;
|
|
1349
1685
|
}>;
|
|
1350
1686
|
getUnusedBalance(): Promise<SingleTokenInfo>;
|
|
1351
|
-
protected getVesuAUM(adapter: VesuAdapter): Promise<Web3Number>;
|
|
1687
|
+
protected getVesuAUM(adapter: VesuAdapter, _priceType?: LSTPriceType): Promise<Web3Number>;
|
|
1352
1688
|
getPrevAUM(): Promise<Web3Number>;
|
|
1353
|
-
getAUM(): Promise<{
|
|
1689
|
+
getAUM(unrealizedAUM?: boolean): Promise<{
|
|
1354
1690
|
net: SingleTokenInfo;
|
|
1355
1691
|
prevAum: Web3Number;
|
|
1356
1692
|
splits: {
|
|
@@ -1429,10 +1765,12 @@ declare function getContractDetails(settings: UniversalStrategySettings): {
|
|
|
1429
1765
|
declare const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[];
|
|
1430
1766
|
|
|
1431
1767
|
interface HyperLSTStrategySettings extends UniversalStrategySettings {
|
|
1432
|
-
borrowable_assets:
|
|
1768
|
+
borrowable_assets: {
|
|
1769
|
+
token: TokenInfo;
|
|
1770
|
+
poolId: ContractAddr;
|
|
1771
|
+
}[];
|
|
1433
1772
|
underlyingToken: TokenInfo;
|
|
1434
1773
|
defaultPoolId: ContractAddr;
|
|
1435
|
-
altSupportedPoolIds: ContractAddr[];
|
|
1436
1774
|
}
|
|
1437
1775
|
declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTStrategySettings> {
|
|
1438
1776
|
private quoteAmountToFetchPrice;
|
|
@@ -1467,7 +1805,20 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
|
|
|
1467
1805
|
shouldRebalance: boolean;
|
|
1468
1806
|
manageCall: Call | undefined;
|
|
1469
1807
|
}>;
|
|
1470
|
-
protected getVesuAUM(adapter: VesuAdapter): Promise<Web3Number>;
|
|
1808
|
+
protected getVesuAUM(adapter: VesuAdapter, priceType?: LSTPriceType): Promise<Web3Number>;
|
|
1809
|
+
getTVLUnrealized(): Promise<{
|
|
1810
|
+
net: SingleTokenInfo;
|
|
1811
|
+
prevAum: Web3Number;
|
|
1812
|
+
splits: {
|
|
1813
|
+
id: string;
|
|
1814
|
+
aum: Web3Number;
|
|
1815
|
+
}[];
|
|
1816
|
+
}>;
|
|
1817
|
+
getUserUnrealizedGains(user: ContractAddr): Promise<{
|
|
1818
|
+
unrealizedGains: Web3Number;
|
|
1819
|
+
userShare: number;
|
|
1820
|
+
tokenInfo: TokenInfo;
|
|
1821
|
+
}>;
|
|
1471
1822
|
private _getMinOutputAmountLSTBuy;
|
|
1472
1823
|
private _getMinOutputAmountLSTSell;
|
|
1473
1824
|
/**
|
|
@@ -1492,6 +1843,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
|
|
|
1492
1843
|
maxBorrowableAmount: Web3Number;
|
|
1493
1844
|
borrowableAsset: TokenInfo;
|
|
1494
1845
|
ltv: number;
|
|
1846
|
+
poolId: ContractAddr;
|
|
1495
1847
|
}[];
|
|
1496
1848
|
}>;
|
|
1497
1849
|
getMaxSwappableWithMaxSlippage(fromToken: TokenInfo, toToken: TokenInfo, maxSlippage: number, maxAmount: Web3Number): Promise<Web3Number>;
|
|
@@ -1520,6 +1872,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
|
|
|
1520
1872
|
apy: number;
|
|
1521
1873
|
weight: number;
|
|
1522
1874
|
}>;
|
|
1875
|
+
getLSTAvnuRate(): Promise<number>;
|
|
1523
1876
|
getLSTExchangeRate(): Promise<number>;
|
|
1524
1877
|
/**
|
|
1525
1878
|
*
|
|
@@ -1536,6 +1889,97 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
|
|
|
1536
1889
|
}
|
|
1537
1890
|
declare const HyperLSTStrategies: IStrategyMetadata<HyperLSTStrategySettings>[];
|
|
1538
1891
|
|
|
1892
|
+
/**
|
|
1893
|
+
* Filter option definition
|
|
1894
|
+
*/
|
|
1895
|
+
interface FilterOption {
|
|
1896
|
+
id: string;
|
|
1897
|
+
label: string;
|
|
1898
|
+
icon?: string;
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* Strategy filter metadata - defines what filters are available
|
|
1902
|
+
*/
|
|
1903
|
+
interface StrategyFilterMetadata {
|
|
1904
|
+
assets: FilterOption[];
|
|
1905
|
+
protocols: FilterOption[];
|
|
1906
|
+
quickFilters: FilterOption[];
|
|
1907
|
+
}
|
|
1908
|
+
/**
|
|
1909
|
+
* Strategy type enum
|
|
1910
|
+
*/
|
|
1911
|
+
declare enum StrategyType {
|
|
1912
|
+
EKUBO_CL = "ekubo",
|
|
1913
|
+
UNIVERSAL = "universal",
|
|
1914
|
+
HYPER_LST = "hyper-lst",
|
|
1915
|
+
VESU_REBALANCE = "vesu-rebalance",
|
|
1916
|
+
SENSEI = "sensei"
|
|
1917
|
+
}
|
|
1918
|
+
/**
|
|
1919
|
+
* Strategy metadata extracted from IStrategyMetadata
|
|
1920
|
+
*/
|
|
1921
|
+
interface StrategyMetadata {
|
|
1922
|
+
id: string;
|
|
1923
|
+
name: string;
|
|
1924
|
+
type: StrategyType;
|
|
1925
|
+
assets: string[];
|
|
1926
|
+
protocols: string[];
|
|
1927
|
+
tags: string[];
|
|
1928
|
+
curator?: {
|
|
1929
|
+
name: string;
|
|
1930
|
+
logo: string;
|
|
1931
|
+
};
|
|
1932
|
+
isRetired: boolean;
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* Strategy registry entry
|
|
1936
|
+
*/
|
|
1937
|
+
interface StrategyRegistryEntry<T = any> {
|
|
1938
|
+
metadata: IStrategyMetadata<T>;
|
|
1939
|
+
type: StrategyType;
|
|
1940
|
+
}
|
|
1941
|
+
/**
|
|
1942
|
+
* Build strategy registry from SDK strategies
|
|
1943
|
+
*/
|
|
1944
|
+
declare function buildStrategyRegistry(): StrategyRegistryEntry[];
|
|
1945
|
+
/**
|
|
1946
|
+
* Get all strategy metadata from registry
|
|
1947
|
+
*/
|
|
1948
|
+
declare function getAllStrategyMetadata(): StrategyMetadata[];
|
|
1949
|
+
/**
|
|
1950
|
+
* Get filter metadata - defines available filters and their options
|
|
1951
|
+
*/
|
|
1952
|
+
declare function getFilterMetadata(): StrategyFilterMetadata;
|
|
1953
|
+
/**
|
|
1954
|
+
* Get live strategies (filter out retired)
|
|
1955
|
+
*/
|
|
1956
|
+
declare function getLiveStrategies(): StrategyRegistryEntry[];
|
|
1957
|
+
/**
|
|
1958
|
+
* Get strategies by type
|
|
1959
|
+
*/
|
|
1960
|
+
declare function getStrategiesByType(type: StrategyType): StrategyRegistryEntry[];
|
|
1961
|
+
|
|
1962
|
+
declare enum FactoryStrategyType {
|
|
1963
|
+
UNIVERSAL = "UNIVERSAL",
|
|
1964
|
+
EKUBO_CL = "EKUBO_CL",
|
|
1965
|
+
HYPER_LST = "HYPER_LST",
|
|
1966
|
+
VESU_REBALANCE = "VESU_REBALANCE",
|
|
1967
|
+
SENSEI = "SENSEI"
|
|
1968
|
+
}
|
|
1969
|
+
declare function createUniversalStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<UniversalStrategySettings>): UniversalStrategy<UniversalStrategySettings>;
|
|
1970
|
+
declare function createEkuboCLStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<CLVaultStrategySettings>): EkuboCLVault;
|
|
1971
|
+
declare function createHyperLSTStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<HyperLSTStrategySettings>): UniversalLstMultiplierStrategy;
|
|
1972
|
+
declare function createVesuRebalanceStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<VesuRebalanceSettings>): VesuRebalance;
|
|
1973
|
+
declare function createSenseiStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<SenseiVaultSettings>): SenseiVault;
|
|
1974
|
+
/**
|
|
1975
|
+
* Determines the strategy type from metadata by inspecting the additionalInfo structure
|
|
1976
|
+
*/
|
|
1977
|
+
declare function getStrategyTypeFromMetadata(metadata: IStrategyMetadata<any>): FactoryStrategyType;
|
|
1978
|
+
/**
|
|
1979
|
+
* Generic factory function that creates SDK strategy instances based on type
|
|
1980
|
+
*/
|
|
1981
|
+
declare function createStrategy(type: FactoryStrategyType, config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<any>): VesuRebalance | EkuboCLVault | SenseiVault | UniversalStrategy<UniversalStrategySettings>;
|
|
1982
|
+
|
|
1539
1983
|
interface EkuboRouteNode {
|
|
1540
1984
|
pool_key: {
|
|
1541
1985
|
token0: string;
|
|
@@ -1596,6 +2040,7 @@ declare class Global {
|
|
|
1596
2040
|
static getTokens(): Promise<TokenInfo[]>;
|
|
1597
2041
|
static assert(condition: any, message: string): void;
|
|
1598
2042
|
static getTokenInfoFromAddr(addr: ContractAddr): Promise<TokenInfo>;
|
|
2043
|
+
static getTokenInfoFromName(tokenName: string): Promise<TokenInfo>;
|
|
1599
2044
|
static setGlobalCache(key: string, data: any, ttl?: number): void;
|
|
1600
2045
|
static getGlobalCache<T>(key: string): T | null;
|
|
1601
2046
|
}
|
|
@@ -1693,7 +2138,7 @@ declare class PricerRedis extends Pricer {
|
|
|
1693
2138
|
/** sets current local price in redis */
|
|
1694
2139
|
private _setRedisPrices;
|
|
1695
2140
|
/** Returns price from redis */
|
|
1696
|
-
getPrice(tokenSymbol: string): Promise<PriceInfo>;
|
|
2141
|
+
getPrice(tokenSymbol: string, blockNumber?: BlockIdentifier): Promise<PriceInfo>;
|
|
1697
2142
|
}
|
|
1698
2143
|
|
|
1699
2144
|
declare function getAPIUsingHeadlessBrowser(url: string): Promise<any>;
|
|
@@ -1809,4 +2254,4 @@ declare class PasswordJsonCryptoUtil {
|
|
|
1809
2254
|
decrypt(encryptedData: string, password: string): any;
|
|
1810
2255
|
}
|
|
1811
2256
|
|
|
1812
|
-
export { APYType, AUMTypes, AVNU_EXCHANGE, AVNU_MIDDLEWARE, type AccountInfo, type AdapterLeafType, type AllAccountsStore, type ApproveCallParams, 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, FatalError, 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, LSTAPRService, type LSTStats, type LeafAdapterFn, type LeafData, type LendingToken, type ManageCall, MarginType, Network, PRICE_ROUTER, PasswordJsonCryptoUtil, type PositionAPY, type PositionInfo, Pragma, type PriceInfo, Pricer, PricerFromApi, PricerLST, PricerRedis, Protocols, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, RiskType, type Route, type RouteNode, SIMPLE_SANITIZER, SIMPLE_SANITIZER_V2, SIMPLE_SANITIZER_VESU_V1_DELEGATIONS, SenseiStrategies, SenseiVault, type SenseiVaultSettings, type SingleActionAmount, type SingleTokenInfo, StandardMerkleTree, type StandardMerkleTreeData, Store, type StoreConfig, 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, VesuAdapter, type VesuAdapterConfig, type VesuAmount, VesuAmountDenomination, VesuAmountType, type VesuDefiSpringRewardsCallParams, type VesuModifyDelegationCallParams, type VesuModifyPositionCallParams, type VesuMultiplyCallParams, VesuPools, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, Web3Number, ZkLend, assert, extensionMap, getAPIUsingHeadlessBrowser, getContractDetails, getDefaultStoreConfig, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, logger, toBigInt };
|
|
2257
|
+
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, LSTPriceType, 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 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, type UserYoloInfo, 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, VesuPoolMetadata, VesuPools, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, Web3Number, YoLoVault, type YoloVaultSettings, type YoloVaultStatus, YoloVaultStrategies, 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 };
|