@strkfarm/sdk 2.0.0-staging.7 → 2.0.0-staging.71

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/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, Uint256, Call, Account, CairoCustomEnum, RawArgs } from 'starknet';
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
  /**
@@ -97,6 +99,7 @@ interface RiskFactor {
97
99
  weight: number;
98
100
  reason?: string;
99
101
  }
102
+ type PriceMethod = 'AvnuApi' | 'Coinbase' | 'Coinmarketcap' | 'Ekubo' | 'Avnu';
100
103
  interface TokenInfo {
101
104
  name: string;
102
105
  symbol: string;
@@ -107,6 +110,8 @@ interface TokenInfo {
107
110
  displayDecimals: number;
108
111
  priceProxySymbol?: string;
109
112
  priceCheckAmount?: number;
113
+ priceMethod?: PriceMethod;
114
+ dontPrice?: boolean;
110
115
  }
111
116
  declare enum Network {
112
117
  mainnet = "mainnet",
@@ -123,22 +128,22 @@ interface IProtocol {
123
128
  name: string;
124
129
  logo: string;
125
130
  }
126
- declare enum StrategyCategory {
127
- ALL = "all",
128
- BTC = "btc",
129
- META_VAULTS = "meta-vaults"
131
+ interface ICurator {
132
+ name: string;
133
+ logo: string;
130
134
  }
131
135
  declare enum StrategyTag {
132
- EKUBO = "Ekubo",
133
- EVERGREEN = "Evergreen",
134
- HYPER_LST = "Hyper-LST",
135
- VESU = "Vesu",
136
- SENSEI = "Sensei",
137
- ENDUR = "Endur",
136
+ META_VAULT = "Meta Vaults",
137
+ LEVERED = "Maxx",
138
+ AUTOMATED_LP = "Ekubo",
138
139
  BTC = "BTC"
139
140
  }
140
141
  declare enum VaultType {
141
- FARMING = "farming"
142
+ LOOPING = "Looping",
143
+ META_VAULT = "Meta Vault",
144
+ DELTA_NEUTRAL = "Delta Neutral",
145
+ AUTOMATED_LP = "Automated LP",
146
+ TVA = "Troves Value Averaging"
142
147
  }
143
148
  declare enum AuditStatus {
144
149
  AUDITED = "Audited",
@@ -150,7 +155,8 @@ declare enum SourceCodeType {
150
155
  }
151
156
  declare enum AccessControlType {
152
157
  MULTISIG_ACCOUNT = "Multisig Account",
153
- STANDARD_ACCOUNT = "Standard Account"
158
+ STANDARD_ACCOUNT = "Standard Account",
159
+ ROLE_BASED_ACCESS = "Role Based Access"
154
160
  }
155
161
  declare enum InstantWithdrawalVault {
156
162
  YES = "Yes",
@@ -163,21 +169,20 @@ interface SourceCodeInfo {
163
169
  interface AccessControlInfo {
164
170
  type: AccessControlType;
165
171
  addresses: ContractAddr[];
166
- timeLock: string;
172
+ timeLock?: string;
167
173
  }
168
174
  interface SecurityMetadata {
169
175
  auditStatus: AuditStatus;
170
176
  sourceCode: SourceCodeInfo;
171
177
  accessControl: AccessControlInfo;
172
178
  }
173
- interface RedemptionExpectedTime {
174
- upto1M: string;
175
- upto10M: string;
176
- above10M: string;
177
- }
178
179
  interface RedemptionInfo {
179
180
  instantWithdrawalVault: InstantWithdrawalVault;
180
- expectedRedemptionTime?: RedemptionExpectedTime;
181
+ redemptionsInfo: {
182
+ title: string;
183
+ description: string;
184
+ }[];
185
+ alerts: StrategyAlert[];
181
186
  }
182
187
  declare enum FlowChartColors {
183
188
  Green = "purple",
@@ -192,7 +197,8 @@ declare enum StrategyLiveStatus {
192
197
  ACTIVE = "Active",
193
198
  NEW = "New",
194
199
  COMING_SOON = "Coming Soon",
195
- RETIRED = "Retired",
200
+ DEPRECATED = "Deprecated",// active but not recommended
201
+ RETIRED = "Retired",// not active anymore
196
202
  HOT = "Hot & New \uD83D\uDD25"
197
203
  }
198
204
  interface StrategyAlert {
@@ -201,7 +207,6 @@ interface StrategyAlert {
201
207
  tab: "all" | "deposit" | "withdraw";
202
208
  }
203
209
  interface StrategySettings {
204
- maxTVL?: Web3Number;
205
210
  liveStatus?: StrategyLiveStatus;
206
211
  isPaused?: boolean;
207
212
  isInMaintenance?: boolean;
@@ -216,6 +221,13 @@ interface StrategySettings {
216
221
  alerts?: StrategyAlert[];
217
222
  tags?: StrategyTag[];
218
223
  }
224
+ interface StrategyApyHistoryUIConfig {
225
+ showApyHistory?: boolean;
226
+ noApyHistoryMessage?: string;
227
+ }
228
+ interface FeeBps {
229
+ performanceFeeBps: number;
230
+ }
219
231
  /**
220
232
  * @property risk.riskFactor.factor - The risk factors that are considered for the strategy.
221
233
  * @property risk.riskFactor.factor - The value of the risk factor from 0 to 10, 0 being the lowest and 10 being the highest.
@@ -226,6 +238,19 @@ interface IStrategyMetadata<T> {
226
238
  id: string;
227
239
  name: string;
228
240
  description: string | React.ReactNode;
241
+ /**
242
+ * Optional UI sort priority. Higher shows earlier.
243
+ * Intended for pinning flagship parent vaults (e.g. BTC above STRK).
244
+ */
245
+ priority?: number;
246
+ /**
247
+ * Optional UI config for the variant intro popup (strategy page).
248
+ * Should be identical across strategies that share the same `parentId`.
249
+ */
250
+ variantIntro?: {
251
+ title: string;
252
+ description: string;
253
+ };
229
254
  address: ContractAddr;
230
255
  launchBlock: number;
231
256
  type: "ERC4626" | "ERC721" | "Other";
@@ -242,6 +267,8 @@ interface IStrategyMetadata<T> {
242
267
  notARisks: RiskType[];
243
268
  };
244
269
  apyMethodology?: string;
270
+ realizedApyMethodology?: string;
271
+ feeBps?: FeeBps;
245
272
  additionalInfo: T;
246
273
  contractDetails: {
247
274
  address: ContractAddr;
@@ -256,16 +283,20 @@ interface IStrategyMetadata<T> {
256
283
  }[];
257
284
  docs?: string;
258
285
  investmentSteps: string[];
259
- curator?: {
260
- name: string;
261
- logo: string;
262
- };
286
+ curator?: ICurator;
263
287
  isPreview?: boolean;
264
- category: StrategyCategory;
265
288
  tags?: StrategyTag[];
266
289
  security: SecurityMetadata;
267
290
  redemptionInfo: RedemptionInfo;
291
+ usualTimeToEarnings: null | string;
292
+ usualTimeToEarningsDescription: null | string;
293
+ discontinuationInfo?: {
294
+ date?: Date;
295
+ reason?: React.ReactNode | string;
296
+ info?: React.ReactNode | string;
297
+ };
268
298
  settings?: StrategySettings;
299
+ apyHistoryUIConfig?: StrategyApyHistoryUIConfig;
269
300
  actions?: Array<{
270
301
  name?: string;
271
302
  pool?: {
@@ -285,6 +316,8 @@ interface IStrategyMetadata<T> {
285
316
  amount?: string | number;
286
317
  isDeposit?: boolean;
287
318
  }>;
319
+ parentId?: string;
320
+ parentName?: string;
288
321
  }
289
322
  interface IInvestmentFlow {
290
323
  id?: string;
@@ -297,6 +330,8 @@ interface IInvestmentFlow {
297
330
  style?: any;
298
331
  }
299
332
  declare function getMainnetConfig(rpcUrl?: string, blockIdentifier?: BlockIdentifier): IConfig;
333
+ declare const getStrategyTagDesciption: (tag: StrategyTag) => string;
334
+ declare const getAllStrategyTags: () => StrategyTag[];
300
335
  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.";
301
336
  declare const getRiskColor: (risk: RiskFactor) => "light_green_2" | "yellow" | "red";
302
337
  declare const getNoRiskTags: (risks: RiskFactor[]) => RiskType[];
@@ -337,6 +372,7 @@ declare const Protocols: {
337
372
  ENDUR: IProtocol;
338
373
  EXTENDED: IProtocol;
339
374
  };
375
+ declare const UnwrapLabsCurator: ICurator;
340
376
 
341
377
  interface ILendingMetadata {
342
378
  name: string;
@@ -397,6 +433,27 @@ declare abstract class PricerBase {
397
433
  getPrice(tokenSymbol: string, blockNumber?: BlockIdentifier): Promise<PriceInfo>;
398
434
  }
399
435
 
436
+ /**
437
+ * Polls Avnu impulse tokens API and keeps USD prices in memory for configured tokens.
438
+ * Price timestamp is set when each poll request completes.
439
+ */
440
+ declare class PricerAvnuApi extends PricerBase {
441
+ protected prices: {
442
+ [key: string]: PriceInfo;
443
+ };
444
+ readonly refreshInterval = 15000;
445
+ readonly staleTime: number;
446
+ private pollTimer;
447
+ private loading;
448
+ constructor(config: IConfig, tokens: TokenInfo[]);
449
+ start(): void;
450
+ stop(): void;
451
+ isStale(timestamp: Date): boolean;
452
+ hasPrice(tokenSymbol: string): boolean;
453
+ getPrice(tokenSymbol: string): Promise<PriceInfo>;
454
+ protected _loadPrices(): Promise<void>;
455
+ }
456
+
400
457
  interface PriceInfo {
401
458
  price: number;
402
459
  timestamp: Date;
@@ -407,8 +464,9 @@ declare class Pricer extends PricerBase {
407
464
  };
408
465
  refreshInterval: number;
409
466
  staleTime: number;
467
+ protected readonly avnuApiPricer: PricerAvnuApi;
410
468
  protected methodToUse: {
411
- [tokenSymbol: string]: 'Ekubo' | 'Coinbase' | 'Coinmarketcap' | 'Avnu';
469
+ [tokenSymbol: string]: PriceMethod;
412
470
  };
413
471
  /**
414
472
  * TOKENA and TOKENB are the two token names to get price of TokenA in terms of TokenB
@@ -423,7 +481,10 @@ declare class Pricer extends PricerBase {
423
481
  assertNotStale(timestamp: Date, tokenName: string): void;
424
482
  getPrice(tokenSymbol: string, blockNumber?: BlockIdentifier): Promise<PriceInfo>;
425
483
  protected _loadPrices(onUpdate?: (tokenSymbol: string) => void): void;
426
- _getPrice(token: TokenInfo, defaultMethod?: string): Promise<number>;
484
+ _getPrice(token: TokenInfo): Promise<number>;
485
+ protected _getMethodsToTry(token: TokenInfo): PriceMethod[];
486
+ protected _tryPriceMethod(token: TokenInfo, method: PriceMethod): Promise<number>;
487
+ _getPriceAvnuApi(token: TokenInfo): Promise<number>;
427
488
  _getPriceCoinbase(token: TokenInfo): Promise<number>;
428
489
  _getPriceCoinMarketCap(token: TokenInfo): Promise<number>;
429
490
  _getAvnuPrice(token: TokenInfo, amountIn?: Web3Number, retry?: number): Promise<number>;
@@ -494,6 +555,7 @@ declare class ERC20 {
494
555
  contract(addr: string | ContractAddr): Contract;
495
556
  balanceOf(token: string | ContractAddr, address: string | ContractAddr, tokenDecimals: number): Promise<Web3Number>;
496
557
  allowance(token: string | ContractAddr, owner: string | ContractAddr, spender: string | ContractAddr, tokenDecimals: number): Promise<Web3Number>;
558
+ approve(token: string | ContractAddr, spender: string | ContractAddr, amount: Web3Number): starknet.Call;
497
559
  }
498
560
 
499
561
  interface Route {
@@ -591,6 +653,8 @@ interface DualTokenInfo {
591
653
  token0: SingleTokenInfo;
592
654
  token1: SingleTokenInfo;
593
655
  }
656
+ type StrategyInputMode = "single" | "dual";
657
+ type InputModeFromAction<T> = T extends DualActionAmount ? "dual" : "single";
594
658
  interface NetAPYSplit {
595
659
  apy: number;
596
660
  id: string;
@@ -599,22 +663,75 @@ interface NetAPYDetails {
599
663
  net: number;
600
664
  splits: NetAPYSplit[];
601
665
  }
666
+ type UserPositionCardSubValueColor = "default" | "positive" | "negative" | "info";
667
+ interface UserPositionCard {
668
+ title: string;
669
+ value: string;
670
+ tooltip?: string;
671
+ subValue?: string;
672
+ subValueColor?: UserPositionCardSubValueColor;
673
+ }
674
+ interface UserPositionCardsInput {
675
+ user: ContractAddr;
676
+ investmentFlows?: Array<{
677
+ amount: string;
678
+ type: string;
679
+ timestamp: number;
680
+ tx_hash: string;
681
+ }>;
682
+ usualTimeToEarnings?: string | null;
683
+ usualTimeToEarningsDescription?: string | null;
684
+ }
602
685
  interface CacheData {
603
686
  timestamp: number;
604
687
  ttl: number;
605
688
  data: any;
606
689
  }
607
- declare class BaseStrategy<TVLInfo, ActionInfo> extends CacheClass {
690
+ declare class BaseStrategy<TVLInfo, DepositActionInfo, WithdrawActionInfo = DepositActionInfo> extends CacheClass {
608
691
  readonly config: IConfig;
609
692
  readonly cache: Map<string, CacheData>;
610
- constructor(config: IConfig);
693
+ private readonly _depositInputMode;
694
+ private readonly _withdrawInputMode;
695
+ constructor(config: IConfig, inputModes?: {
696
+ depositInputMode?: InputModeFromAction<DepositActionInfo>;
697
+ withdrawInputMode?: InputModeFromAction<WithdrawActionInfo>;
698
+ });
699
+ depositInputMode(): InputModeFromAction<DepositActionInfo>;
700
+ withdrawInputMode(): InputModeFromAction<WithdrawActionInfo>;
611
701
  getUserTVL(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<TVLInfo>;
612
702
  getTVL(): Promise<TVLInfo>;
613
- depositCall(amountInfo: ActionInfo, receiver: ContractAddr): Promise<Call[]>;
614
- withdrawCall(amountInfo: ActionInfo, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
703
+ depositCall(amountInfo: DepositActionInfo, receiver: ContractAddr): Promise<Call[]>;
704
+ withdrawCall(amountInfo: WithdrawActionInfo, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
615
705
  getVaultPositions(): Promise<VaultPosition[]>;
616
- netAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number, timeperiod?: "24h" | "7d" | "30d" | "3m"): Promise<number | NetAPYDetails>;
706
+ netAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number, timeperiod?: "24h" | "7d" | "30d" | "3m"): Promise<number | string | NetAPYDetails>;
617
707
  getPendingRewards(): Promise<HarvestInfo[]>;
708
+ getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
709
+ getUserPositionCards(_input: UserPositionCardsInput): Promise<UserPositionCard[]>;
710
+ getMaxTVL(): Promise<Web3Number>;
711
+ protected formatTokenAmountForCard(amount: Web3Number, tokenInfo: TokenInfo): string;
712
+ protected formatPercentForCard(value: number): string;
713
+ protected formatUSDForCard(value: number): string;
714
+ protected getSubValueColorFromSignedNumber(value: number): UserPositionCardSubValueColor;
715
+ /**
716
+ * Calculate lifetime earnings for a user based on provided data from client
717
+ * Formula: lifetimeEarnings = currentValue + totalWithdrawals - totalDeposits
718
+ *
719
+ * @param userTVL - The user's current TVL (SingleTokenInfo with amount, usdValue, tokenInfo)
720
+ * @param investmentFlows - Array of investment flow transactions from client
721
+ * @returns Object containing lifetime earnings, current value, and total deposits/withdrawals
722
+ */
723
+ getLifetimeEarnings(userTVL: SingleTokenInfo, investmentFlows: Array<{
724
+ amount: string;
725
+ type: string;
726
+ timestamp: number;
727
+ tx_hash: string;
728
+ }>): {
729
+ tokenInfo: SingleTokenInfo;
730
+ lifetimeEarnings: Web3Number;
731
+ currentValue: Web3Number;
732
+ totalDeposits: Web3Number;
733
+ totalWithdrawals: Web3Number;
734
+ };
618
735
  }
619
736
 
620
737
  interface PoolProps {
@@ -900,17 +1017,32 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
900
1017
  rebalanceCall(newBounds: EkuboBounds, swapParams: SwapInfo): Call[];
901
1018
  handleUnusedCall(swapParams: SwapInfo): Call[];
902
1019
  handleFeesCall(): Call[];
903
- getFeeHistory(timePeriod?: '24h' | '7d' | '30d' | '3m'): Promise<{
1020
+ getFeeHistory(timePeriod?: '24h' | '7d' | '30d' | '3m' | '6m', range?: {
1021
+ startTimestamp?: number;
1022
+ endTimestamp?: number;
1023
+ }): Promise<{
904
1024
  summary: DualTokenInfo;
905
1025
  history: FeeHistory[];
906
1026
  }>;
907
1027
  netSharesBasedTrueAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
1028
+ /**
1029
+ * Calculate lifetime earnings for a user
1030
+ * Not yet implemented for Ekubo CL Vault strategy
1031
+ */
1032
+ getLifetimeEarnings(userTVL: SingleTokenInfo, investmentFlows: Array<{
1033
+ amount: string;
1034
+ type: string;
1035
+ timestamp: number;
1036
+ tx_hash: string;
1037
+ }>): any;
908
1038
  /**
909
1039
  * Calculates realized APY based on TVL per share growth, always valued in USDC.
910
1040
  * This is a vault-level metric (same for all users) and works for all strategies,
911
1041
  * regardless of quote asset configuration.
912
1042
  */
913
1043
  getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
1044
+ getMaxTVL(): Promise<Web3Number>;
1045
+ getUserPositionCards(input: UserPositionCardsInput): Promise<UserPositionCard[]>;
914
1046
  feeBasedAPY(timeperiod?: '24h' | '7d' | '30d' | '3m'): Promise<number>;
915
1047
  /**
916
1048
  * Calculates assets before and now in a given token of TVL per share to observe growth
@@ -1106,15 +1238,122 @@ declare class SenseiVault extends BaseStrategy<SingleTokenInfo, SingleActionAmou
1106
1238
  }>;
1107
1239
  getSecondaryTokenPriceRelativeToMain(retry?: number): Promise<number>;
1108
1240
  getSettings: () => Promise<starknet.CallResult>;
1241
+ /**
1242
+ * Calculate lifetime earnings for a user
1243
+ * Not yet implemented for Sensei Vault strategy
1244
+ */
1245
+ getLifetimeEarnings(userTVL: SingleTokenInfo, investmentFlows: Array<{
1246
+ amount: string;
1247
+ type: string;
1248
+ timestamp: number;
1249
+ tx_hash: string;
1250
+ }>): any;
1109
1251
  netAPY(): Promise<number>;
1110
1252
  /**
1111
1253
  * Calculates user realized APY based on position growth accounting for deposits and withdrawals.
1112
1254
  * Returns the APY as a number.
1255
+ * Not implemented for Sensei Strategy yet.
1113
1256
  */
1114
- getUserRealizedAPY(userAddress: ContractAddr, blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
1257
+ getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
1258
+ getUserPositionCards(_input: UserPositionCardsInput): Promise<UserPositionCard[]>;
1115
1259
  }
1116
1260
  declare const SenseiStrategies: IStrategyMetadata<SenseiVaultSettings>[];
1117
1261
 
1262
+ interface YoloVaultSettings {
1263
+ startDate: string;
1264
+ expiryDate: string;
1265
+ mainToken: TokenInfo;
1266
+ secondaryToken: TokenInfo;
1267
+ totalEpochs: number;
1268
+ minEpochDurationSeconds: number;
1269
+ spendingLevels: YoloSpendingLevel[];
1270
+ feeBps: number;
1271
+ /** When true, base token is ERC-4626 (e.g. vUSDC); amounts for TVL / user info use `convert_to_assets` into `baseUnderlying`. */
1272
+ isBaseERC4626?: boolean;
1273
+ /** When true, second token is ERC-4626 (e.g. xSTRK); amounts use `convert_to_assets` into `secondUnderlying`. */
1274
+ isSecondERC4626?: boolean;
1275
+ /** Required when `isBaseERC4626` is true (e.g. USDC). */
1276
+ baseUnderlying?: TokenInfo;
1277
+ /** Required when `isSecondERC4626` is true (e.g. STRK / WBTC for xSTRK / xWBTC). */
1278
+ secondUnderlying?: TokenInfo;
1279
+ }
1280
+ interface YoloSpendingLevel {
1281
+ minPrice?: number;
1282
+ maxPrice?: number;
1283
+ spendPercent: number;
1284
+ }
1285
+ interface UserYoloInfo {
1286
+ shares: bigint;
1287
+ claimable_second_tokens: bigint;
1288
+ base_token_balance: bigint;
1289
+ base_token_consumed: bigint;
1290
+ base_consumed_last_index: bigint;
1291
+ second_token_last_index: bigint;
1292
+ second_token_balance: bigint;
1293
+ }
1294
+ interface YoloVaultStatus {
1295
+ current_epoch: bigint;
1296
+ total_epochs: bigint;
1297
+ remaining_base: bigint;
1298
+ total_second_tokens: bigint;
1299
+ global_second_token_index: bigint;
1300
+ cumulative_spend_index: bigint;
1301
+ total_shares: bigint;
1302
+ base_token_assets_per_share: bigint;
1303
+ }
1304
+ interface YoloSettings {
1305
+ base_token: bigint;
1306
+ second_token: bigint;
1307
+ total_epochs: bigint;
1308
+ min_time_per_epoch: bigint;
1309
+ max_spend_units_per_epoch: bigint;
1310
+ base_token_assets_per_share: bigint;
1311
+ oracle: bigint;
1312
+ }
1313
+ type YoloErc4626RuntimeConfig = {
1314
+ isBaseERC4626: boolean;
1315
+ isSecondERC4626: boolean;
1316
+ baseUnderlying?: TokenInfo;
1317
+ secondUnderlying?: TokenInfo;
1318
+ };
1319
+ declare class YoLoVault extends BaseStrategy<DualTokenInfo, SingleActionAmount, DualActionAmount> {
1320
+ readonly address: ContractAddr;
1321
+ readonly metadata: IStrategyMetadata<YoloVaultSettings>;
1322
+ readonly pricer: PricerBase;
1323
+ /** Resolves to a `Contract` built from `provider.getClassAt` at the vault address (no checked-in vault ABI). */
1324
+ readonly contract: Promise<Contract>;
1325
+ readonly primaryToken: TokenInfo;
1326
+ readonly secondaryToken: TokenInfo;
1327
+ readonly erc4626: YoloErc4626RuntimeConfig;
1328
+ constructor(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<YoloVaultSettings>);
1329
+ /** Underlying (or base token) used for pricing / swap sell leg when base is ERC-4626. */
1330
+ tokenForPrimaryPricing(): TokenInfo;
1331
+ /** Underlying (or second token) for price ratios when second leg is ERC-4626 (e.g. STRK for xSTRK). */
1332
+ tokenForSecondaryPricing(): TokenInfo;
1333
+ private primaryAmountDecimals;
1334
+ private secondaryAmountDecimals;
1335
+ private convertWrapperSharesToUnderlying;
1336
+ private getNormalizedUserInfo;
1337
+ private resolveWithdrawRequest;
1338
+ getUserTVL(user: ContractAddr, blockIdentifier?: BlockIdentifier): Promise<DualTokenInfo>;
1339
+ getVaultPositions(): Promise<VaultPosition[]>;
1340
+ getTVL(): Promise<DualTokenInfo>;
1341
+ depositCall(amountInfo: SingleActionAmount, receiver: ContractAddr): Promise<Call[]>;
1342
+ getVaultStatus(): Promise<YoloVaultStatus>;
1343
+ matchInputAmounts(amountInfo: DualActionAmount, user: ContractAddr): Promise<DualActionAmount>;
1344
+ withdrawCall(amountInfo: DualActionAmount, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
1345
+ netAPY(): Promise<number | string | NetAPYDetails>;
1346
+ getSwapAmounts(spendUnits: Web3Number): Promise<{
1347
+ grossSpend: Web3Number;
1348
+ netSpend: Web3Number;
1349
+ isReadyForNextSwap: boolean;
1350
+ }>;
1351
+ getSettings: () => Promise<YoloSettings>;
1352
+ getMaxTVL(): Promise<Web3Number>;
1353
+ getUserPositionCards(input: UserPositionCardsInput): Promise<UserPositionCard[]>;
1354
+ }
1355
+ declare const YoloVaultStrategies: IStrategyMetadata<YoloVaultSettings>[];
1356
+
1118
1357
  interface LeveledLogMethod {
1119
1358
  (message: string, ...meta: any[]): void;
1120
1359
  (message: any): void;
@@ -1368,6 +1607,24 @@ declare const VesuPools: {
1368
1607
  Re7xSTRK: ContractAddr;
1369
1608
  Re7xBTC: ContractAddr;
1370
1609
  Prime: ContractAddr;
1610
+ Re7STRK: ContractAddr;
1611
+ };
1612
+ declare const VesuPoolMetadata: {
1613
+ [VesuPools.Genesis.address]: {
1614
+ name: string;
1615
+ };
1616
+ [VesuPools.Re7xSTRK.address]: {
1617
+ name: string;
1618
+ };
1619
+ [VesuPools.Re7xBTC.address]: {
1620
+ name: string;
1621
+ };
1622
+ [VesuPools.Prime.address]: {
1623
+ name: string;
1624
+ };
1625
+ [VesuPools.Re7STRK.address]: {
1626
+ name: string;
1627
+ };
1371
1628
  };
1372
1629
  declare const extensionMap: {
1373
1630
  [key: string]: ContractAddr;
@@ -1410,8 +1667,15 @@ declare class VesuAdapter extends BaseAdapter {
1410
1667
  getModifyPositionCall: (params: VesuModifyPositionCallParams) => ManageCall;
1411
1668
  getMultiplyAdapter: (id: string) => LeafAdapterFn<VesuMultiplyCallParams>;
1412
1669
  getMultiplyCall: (params: VesuMultiplyCallParams) => ManageCall;
1413
- getVesuModifyDelegationAdapter: (id: string) => LeafAdapterFn<VesuModifyDelegationCallParams>;
1414
- getVesuModifyDelegationCall: (params: VesuModifyDelegationCallParams) => ManageCall;
1670
+ getVesuModifyDelegationAdapter: (id: string, delegatee: ContractAddr) => LeafAdapterFn<VesuModifyDelegationCallParams>;
1671
+ getVesuModifyDelegationCall: (delegatee: ContractAddr) => (params: VesuModifyDelegationCallParams) => {
1672
+ sanitizer: ContractAddr;
1673
+ call: {
1674
+ contractAddress: ContractAddr;
1675
+ selector: string;
1676
+ calldata: bigint[];
1677
+ };
1678
+ };
1415
1679
  getDefispringRewardsAdapter: (id: string) => () => AdapterLeafType<VesuDefiSpringRewardsCallParams>;
1416
1680
  getDefiSpringClaimCall: () => GenerateCallFn<VesuDefiSpringRewardsCallParams>;
1417
1681
  formatAmountTypeEnum(amountType: VesuAmountType): CairoCustomEnum;
@@ -1466,6 +1730,11 @@ declare const AVNU_EXCHANGE: ContractAddr;
1466
1730
  declare const VESU_SINGLETON: ContractAddr;
1467
1731
  declare function toBigInt(value: string | number): bigint;
1468
1732
 
1733
+ declare enum LSTPriceType {
1734
+ ENDUR_PRICE = "ENDUR_PRICE",
1735
+ AVNU_PRICE = "AVNU_PRICE"
1736
+ }
1737
+
1469
1738
  interface UniversalManageCall {
1470
1739
  proofs: string[];
1471
1740
  manageCall: ManageCall;
@@ -1550,6 +1819,7 @@ declare class UniversalStrategy<S extends UniversalStrategySettings> extends Bas
1550
1819
  * Returns the APY as a number.
1551
1820
  */
1552
1821
  getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
1822
+ getUserPositionCards(input: UserPositionCardsInput): Promise<UserPositionCard[]>;
1553
1823
  /**
1554
1824
  * Calculates the total TVL of the strategy.
1555
1825
  * @returns Object containing the total amount in token units and USD value
@@ -1559,10 +1829,11 @@ declare class UniversalStrategy<S extends UniversalStrategySettings> extends Bas
1559
1829
  amount: Web3Number;
1560
1830
  usdValue: number;
1561
1831
  }>;
1832
+ getMaxTVL(): Promise<Web3Number>;
1562
1833
  getUnusedBalance(): Promise<SingleTokenInfo>;
1563
- protected getVesuAUM(adapter: VesuAdapter): Promise<Web3Number>;
1834
+ protected getVesuAUM(adapter: VesuAdapter, _priceType?: LSTPriceType): Promise<Web3Number>;
1564
1835
  getPrevAUM(): Promise<Web3Number>;
1565
- getAUM(): Promise<{
1836
+ getAUM(unrealizedAUM?: boolean): Promise<{
1566
1837
  net: SingleTokenInfo;
1567
1838
  prevAum: Web3Number;
1568
1839
  splits: {
@@ -1641,10 +1912,12 @@ declare function getContractDetails(settings: UniversalStrategySettings): {
1641
1912
  declare const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[];
1642
1913
 
1643
1914
  interface HyperLSTStrategySettings extends UniversalStrategySettings {
1644
- borrowable_assets: TokenInfo[];
1915
+ borrowable_assets: {
1916
+ token: TokenInfo;
1917
+ poolId: ContractAddr;
1918
+ }[];
1645
1919
  underlyingToken: TokenInfo;
1646
1920
  defaultPoolId: ContractAddr;
1647
- altSupportedPoolIds: ContractAddr[];
1648
1921
  }
1649
1922
  declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTStrategySettings> {
1650
1923
  private quoteAmountToFetchPrice;
@@ -1679,7 +1952,22 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
1679
1952
  shouldRebalance: boolean;
1680
1953
  manageCall: Call | undefined;
1681
1954
  }>;
1682
- protected getVesuAUM(adapter: VesuAdapter): Promise<Web3Number>;
1955
+ protected getVesuAUM(adapter: VesuAdapter, priceType?: LSTPriceType): Promise<Web3Number>;
1956
+ getTVLUnrealized(): Promise<{
1957
+ net: SingleTokenInfo;
1958
+ prevAum: Web3Number;
1959
+ splits: {
1960
+ id: string;
1961
+ aum: Web3Number;
1962
+ }[];
1963
+ }>;
1964
+ getUserUnrealizedGains(user: ContractAddr): Promise<{
1965
+ unrealizedGains: Web3Number;
1966
+ userShare: number;
1967
+ tokenInfo: TokenInfo;
1968
+ }>;
1969
+ getMaxTVL(): Promise<Web3Number>;
1970
+ getUserPositionCards(input: UserPositionCardsInput): Promise<UserPositionCard[]>;
1683
1971
  private _getMinOutputAmountLSTBuy;
1684
1972
  private _getMinOutputAmountLSTSell;
1685
1973
  /**
@@ -1704,6 +1992,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
1704
1992
  maxBorrowableAmount: Web3Number;
1705
1993
  borrowableAsset: TokenInfo;
1706
1994
  ltv: number;
1995
+ poolId: ContractAddr;
1707
1996
  }[];
1708
1997
  }>;
1709
1998
  getMaxSwappableWithMaxSlippage(fromToken: TokenInfo, toToken: TokenInfo, maxSlippage: number, maxAmount: Web3Number): Promise<Web3Number>;
@@ -1732,6 +2021,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTS
1732
2021
  apy: number;
1733
2022
  weight: number;
1734
2023
  }>;
2024
+ getLSTAvnuRate(): Promise<number>;
1735
2025
  getLSTExchangeRate(): Promise<number>;
1736
2026
  /**
1737
2027
  *
@@ -1762,7 +2052,6 @@ interface FilterOption {
1762
2052
  interface StrategyFilterMetadata {
1763
2053
  assets: FilterOption[];
1764
2054
  protocols: FilterOption[];
1765
- categories: FilterOption[];
1766
2055
  quickFilters: FilterOption[];
1767
2056
  }
1768
2057
  /**
@@ -1773,7 +2062,8 @@ declare enum StrategyType {
1773
2062
  UNIVERSAL = "universal",
1774
2063
  HYPER_LST = "hyper-lst",
1775
2064
  VESU_REBALANCE = "vesu-rebalance",
1776
- SENSEI = "sensei"
2065
+ SENSEI = "sensei",
2066
+ YOLO_VAULT = "yolo-vault"
1777
2067
  }
1778
2068
  /**
1779
2069
  * Strategy metadata extracted from IStrategyMetadata
@@ -1784,7 +2074,6 @@ interface StrategyMetadata {
1784
2074
  type: StrategyType;
1785
2075
  assets: string[];
1786
2076
  protocols: string[];
1787
- category: string;
1788
2077
  tags: string[];
1789
2078
  curator?: {
1790
2079
  name: string;
@@ -1825,10 +2114,12 @@ declare enum FactoryStrategyType {
1825
2114
  EKUBO_CL = "EKUBO_CL",
1826
2115
  HYPER_LST = "HYPER_LST",
1827
2116
  VESU_REBALANCE = "VESU_REBALANCE",
1828
- SENSEI = "SENSEI"
2117
+ SENSEI = "SENSEI",
2118
+ YOLO_VAULT = "YOLO_VAULT"
1829
2119
  }
1830
2120
  declare function createUniversalStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<UniversalStrategySettings>): UniversalStrategy<UniversalStrategySettings>;
1831
2121
  declare function createEkuboCLStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<CLVaultStrategySettings>): EkuboCLVault;
2122
+ declare function createYoloVaultStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<YoloVaultSettings>): YoLoVault;
1832
2123
  declare function createHyperLSTStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<HyperLSTStrategySettings>): UniversalLstMultiplierStrategy;
1833
2124
  declare function createVesuRebalanceStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<VesuRebalanceSettings>): VesuRebalance;
1834
2125
  declare function createSenseiStrategy(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<SenseiVaultSettings>): SenseiVault;
@@ -1839,7 +2130,7 @@ declare function getStrategyTypeFromMetadata(metadata: IStrategyMetadata<any>):
1839
2130
  /**
1840
2131
  * Generic factory function that creates SDK strategy instances based on type
1841
2132
  */
1842
- declare function createStrategy(type: FactoryStrategyType, config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<any>): VesuRebalance | EkuboCLVault | SenseiVault | UniversalStrategy<UniversalStrategySettings>;
2133
+ declare function createStrategy(type: FactoryStrategyType, config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<any>): VesuRebalance | EkuboCLVault | SenseiVault | YoLoVault | UniversalStrategy<UniversalStrategySettings>;
1843
2134
 
1844
2135
  interface EkuboRouteNode {
1845
2136
  pool_key: {
@@ -1963,6 +2254,16 @@ declare class LSTAPRService {
1963
2254
  static clearCache(): void;
1964
2255
  }
1965
2256
 
2257
+ declare class EkuboPricer extends PricerBase {
2258
+ EKUBO_PRICE_FETCHER_ADDRESS: string;
2259
+ readonly contract: Contract;
2260
+ private readonly USDC_ADDRESS;
2261
+ private readonly USDC_DECIMALS;
2262
+ constructor(config: IConfig, tokens: TokenInfo[]);
2263
+ private div2Power128;
2264
+ getPrice(tokenAddr: string, blockIdentifier?: BlockIdentifier): Promise<PriceInfo>;
2265
+ }
2266
+
1966
2267
  declare class TelegramNotif {
1967
2268
  private subscribers;
1968
2269
  readonly bot: TelegramBot;
@@ -2115,4 +2416,4 @@ declare class PasswordJsonCryptoUtil {
2115
2416
  decrypt(encryptedData: string, password: string): any;
2116
2417
  }
2117
2418
 
2118
- 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, StrategyCategory, 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, getContractDetails, getDefaultStoreConfig, getFilterMetadata, getLiveStrategies, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getStrategiesByType, getStrategyTypeFromMetadata, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, isDualTokenStrategy, logger, toAmountsInfo, toBigInt };
2419
+ 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, EkuboPricer, type EkuboQuote, EkuboQuoter, type EkuboRouteNode, type EkuboSplit, type FAQ, FactoryStrategyType, FatalError, type FeeBps, type FilterOption, type FlashloanCallParams, FlowChartColors, type GenerateCallFn, Global, HyperLSTStrategies, type HyperLSTStrategySettings, type IConfig, type ICurator, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, type IncreaseLeverParams, Initializable, type InputModeFromAction, 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, type PriceMethod, Pricer, PricerAvnuApi, 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 StrategyApyHistoryUIConfig, type StrategyCapabilities, type StrategyFilterMetadata, type StrategyInputMode, 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, UnwrapLabsCurator, type UserPositionCard, type UserPositionCardSubValueColor, type UserPositionCardsInput, 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 YoloSettings, type YoloSpendingLevel, type YoloVaultSettings, type YoloVaultStatus, YoloVaultStrategies, ZkLend, assert, buildStrategyRegistry, createEkuboCLStrategy, createHyperLSTStrategy, createSenseiStrategy, createStrategy, createUniversalStrategy, createVesuRebalanceStrategy, createYoloVaultStrategy, 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 };