@strkfarm/sdk 2.0.0-dev.43 → 2.0.0-dev.44

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
@@ -102,6 +102,13 @@ interface RiskFactor {
102
102
  weight: number;
103
103
  reason?: string;
104
104
  }
105
+ type PriceMethod = 'AvnuApi' | 'Coinbase' | 'Coinmarketcap' | 'Ekubo' | 'Avnu';
106
+ declare enum TokenIndexingType {
107
+ PEGGED = "pegged",
108
+ INDEXER = "indexer",
109
+ LST_SCRIPT = "lstScript",
110
+ IGNORE = "ignore"
111
+ }
105
112
  interface TokenInfo {
106
113
  name: string;
107
114
  symbol: string;
@@ -112,7 +119,9 @@ interface TokenInfo {
112
119
  displayDecimals: number;
113
120
  priceProxySymbol?: string;
114
121
  priceCheckAmount?: number;
122
+ priceMethod?: PriceMethod;
115
123
  dontPrice?: boolean;
124
+ indexingType: TokenIndexingType;
116
125
  }
117
126
  declare enum Network {
118
127
  mainnet = "mainnet",
@@ -458,7 +467,6 @@ interface PriceInfo {
458
467
  price: number;
459
468
  timestamp: Date;
460
469
  }
461
- type PriceMethod = 'AvnuApi' | 'Coinbase' | 'Coinmarketcap' | 'Ekubo' | 'Avnu';
462
470
  declare class Pricer extends PricerBase {
463
471
  protected prices: {
464
472
  [key: string]: PriceInfo;
@@ -483,6 +491,7 @@ declare class Pricer extends PricerBase {
483
491
  getPrice(tokenSymbol: string, blockNumber?: BlockIdentifier): Promise<PriceInfo>;
484
492
  protected _loadPrices(onUpdate?: (tokenSymbol: string) => void): void;
485
493
  _getPrice(token: TokenInfo): Promise<number>;
494
+ protected _getMethodsToTry(token: TokenInfo): PriceMethod[];
486
495
  protected _tryPriceMethod(token: TokenInfo, method: PriceMethod): Promise<number>;
487
496
  _getPriceAvnuApi(token: TokenInfo): Promise<number>;
488
497
  _getPriceCoinbase(token: TokenInfo): Promise<number>;
@@ -2686,13 +2695,49 @@ declare class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
2686
2695
  id: string;
2687
2696
  }[];
2688
2697
  }>;
2689
- maxNewDeposits(params?: {
2690
- isAPYComputation: boolean;
2691
- }): Promise<number>;
2698
+ getVesuAPYs(): Promise<{
2699
+ baseAPYs: number[];
2700
+ rewardAPYs: number[];
2701
+ positions: VaultPosition[];
2702
+ }>;
2703
+ protected returnNetAPY(baseAPYs: number[], rewardAPYs: number[], weights: number[], prevAUMUSD: Web3Number): Promise<{
2704
+ net: number;
2705
+ splits: {
2706
+ apy: number;
2707
+ id: string;
2708
+ }[];
2709
+ }>;
2692
2710
  protected getUnusedBalanceAPY(): Promise<{
2693
2711
  apy: number;
2694
2712
  weight: number;
2695
2713
  }>;
2714
+ private computeAPY;
2715
+ getVesuAdapters(): VesuAdapter[];
2716
+ getVesuPositions(blockNumber?: BlockIdentifier): Promise<VaultPosition[]>;
2717
+ getUnusedBalance(): Promise<SingleTokenInfo>;
2718
+ maxNewDeposits(params?: {
2719
+ isAPYComputation: boolean;
2720
+ }): Promise<number>;
2721
+ getMaxBorrowableAmount(params?: {
2722
+ isAPYComputation: boolean;
2723
+ }): Promise<{
2724
+ netMaxBorrowableAmount: Web3Number;
2725
+ maxBorrowables: {
2726
+ amount: Web3Number;
2727
+ dexSwappableAmount: Web3Number;
2728
+ maxBorrowableAmount: Web3Number;
2729
+ borrowableAsset: TokenInfo;
2730
+ ltv: number;
2731
+ poolId: ContractAddr;
2732
+ }[];
2733
+ }>;
2734
+ getMaxSwappableWithMaxSlippage(fromToken: TokenInfo, toToken: TokenInfo, maxSlippage: number, maxAmount: Web3Number): Promise<Web3Number>;
2735
+ getMaxBorrowableAmountByVesuAdapter(vesuAdapter: VesuAdapter, isAPYComputation: boolean): Promise<{
2736
+ amount: Web3Number;
2737
+ dexSwappableAmount: Web3Number;
2738
+ maxBorrowableAmount: Web3Number;
2739
+ borrowableAsset: TokenInfo;
2740
+ }>;
2696
2741
  getAUM(unrealizedAUM?: boolean): Promise<{
2697
2742
  net: SingleTokenInfo;
2698
2743
  prevAum: Web3Number;
@@ -3020,8 +3065,8 @@ declare class Global {
3020
3065
  static getDefaultTokens(): TokenInfo[];
3021
3066
  static getTokens(): Promise<TokenInfo[]>;
3022
3067
  static assert(condition: any, message: string): void;
3023
- static getTokenInfoFromName(tokenName: string): Promise<TokenInfo>;
3024
3068
  static getTokenInfoFromAddr(addr: ContractAddr): Promise<TokenInfo>;
3069
+ static getTokenInfoFromName(tokenName: string): Promise<TokenInfo>;
3025
3070
  static setGlobalCache(key: string, data: any, ttl?: number): void;
3026
3071
  static getGlobalCache<T>(key: string): T | null;
3027
3072
  }
@@ -3315,4 +3360,4 @@ declare class PasswordJsonCryptoUtil {
3315
3360
  decrypt(encryptedData: string, password: string): any;
3316
3361
  }
3317
3362
 
3318
- export { type APYInfo, APYType, AUDIT_URL, AUMTypes, AVNU_EXCHANGE, AVNU_EXCHANGE_FOR_LEGACY_USDC, AVNU_LEGACY_SANITIZER, AVNU_MIDDLEWARE, AVNU_QUOTE_URL, type AccessControlInfo, AccessControlType, type AccountInfo, type AdapterLeafType, type AllAccountsStore, type AmountInfo, type AmountsInfo, type ApproveCallParams, AuditStatus, AutoCompounderSTRK, AvnuAdapter, type AvnuAdapterConfig, type AvnuDepositParams, type AvnuSwapCallParams, type AvnuWithdrawParams, AvnuWrapper, BaseAdapter, type BaseAdapterConfig, BaseStrategy, BoostedxSTRKCarryStrategies, BoostedxSTRKCarryStrategy, type BoostedxSTRKCarryStrategySettings, type CLVaultStrategySettings, CommonAdapter, type CommonAdapterConfig, ContractAddr, DEFAULT_TROVES_STRATEGIES_API, type DecreaseLeverParams, Deployer, type DepositParams, type DualActionAmount, type DualTokenInfo, ERC20, EXTENDED_CONTRACT, EXTENDED_SANITIZER, 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, HealthFactorMath, 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 LoggerConfig, type LoggerLevel, type ManageCall, MarginType, Midas, MyNumber, type NetAPYDetails, type NetAPYSplit, Network, PRICE_ROUTER, type ParsedStarknetCall, PasswordJsonCryptoUtil, type PositionAPY, type PositionAmount, type PositionInfo, PositionTypeAvnuExtended, Pragma, type PriceInfo, Pricer, PricerAvnuApi, PricerBase, 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, SVK_SIMPLE_SANITIZER, type SecurityMetadata, SenseiStrategies, SenseiVault, type SenseiVaultSettings, type SingleActionAmount, type SingleTokenInfo, type SourceCodeInfo, SourceCodeType, StandardMerkleTree, type StandardMerkleTreeData, StarknetCallParser, type StarknetCallParserOptions, Store, type StoreConfig, type StrategyAlert, type StrategyApyHistoryUIConfig, type StrategyCapabilities, type StrategyFilterMetadata, type StrategyInputMode, StrategyLiveStatus, type StrategyMetadata, type StrategyRegistryEntry, type StrategySettings, StrategyTag, StrategyType, type SupportedPosition, SvkTrovesAdapter, type SvkTrovesAdapterConfig, type Swap, type SwapInfo, type SwapPriceInfo, TRANSFER_SANITIZER, TelegramGroupNotif, TelegramNotif, type TokenAmount, type TokenInfo, TokenMarketData, TokenTransferAdapter, type TokenTransferAdapterConfig, UNIVERSAL_ADAPTER_IDS, 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 VesuDepositParams, type VesuModifyDelegationCallParams, VesuModifyPositionAdapter, type VesuModifyPositionAdapterConfig, type VesuModifyPositionCallParams, type VesuModifyPositionDepositParams, type VesuModifyPositionWithdrawParams, VesuMultiplyAdapter, type VesuMultiplyAdapterConfig, type VesuMultiplyCallParams, VesuPoolMetadata, VesuPools, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, VesuSupplyOnlyAdapter, type VesuSupplyOnlyAdapterConfig, type VesuWithdrawParams, Web3Number, type WithdrawParams, YoLoVault, type YoloSettings, type YoloSpendingLevel, type YoloVaultSettings, type YoloVaultStatus, YoloVaultStrategies, ZkLend, _riskFactor, assert, buildStrategyRegistry, configureLogger, createBoostedXSTRKCarryStrategy, createEkuboCLStrategy, createHyperLSTStrategy, createSenseiStrategy, createStrategy, createUniversalStrategy, createVesuRebalanceStrategy, createYoloVaultStrategy, detectCapabilities, extensionMap, getAPIUsingHeadlessBrowser, getAllStrategyMetadata, getAllStrategyTags, getContractDetails, getDefaultStoreConfig, getFAQs, getFilterMetadata, getInvestmentSteps, getLiveStrategies, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getStrategiesByType, getStrategyTagDesciption, getStrategyTypeFromMetadata, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, isDualTokenStrategy, logger, toAmountsInfo, toBigInt };
3363
+ export { type APYInfo, APYType, AUDIT_URL, AUMTypes, AVNU_EXCHANGE, AVNU_EXCHANGE_FOR_LEGACY_USDC, AVNU_LEGACY_SANITIZER, AVNU_MIDDLEWARE, AVNU_QUOTE_URL, type AccessControlInfo, AccessControlType, type AccountInfo, type AdapterLeafType, type AllAccountsStore, type AmountInfo, type AmountsInfo, type ApproveCallParams, AuditStatus, AutoCompounderSTRK, AvnuAdapter, type AvnuAdapterConfig, type AvnuDepositParams, type AvnuSwapCallParams, type AvnuWithdrawParams, AvnuWrapper, BaseAdapter, type BaseAdapterConfig, BaseStrategy, BoostedxSTRKCarryStrategies, BoostedxSTRKCarryStrategy, type BoostedxSTRKCarryStrategySettings, type CLVaultStrategySettings, CommonAdapter, type CommonAdapterConfig, ContractAddr, DEFAULT_TROVES_STRATEGIES_API, type DecreaseLeverParams, Deployer, type DepositParams, type DualActionAmount, type DualTokenInfo, ERC20, EXTENDED_CONTRACT, EXTENDED_SANITIZER, 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, HealthFactorMath, 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 LoggerConfig, type LoggerLevel, type ManageCall, MarginType, Midas, MyNumber, type NetAPYDetails, type NetAPYSplit, Network, PRICE_ROUTER, type ParsedStarknetCall, PasswordJsonCryptoUtil, type PositionAPY, type PositionAmount, type PositionInfo, PositionTypeAvnuExtended, Pragma, type PriceInfo, type PriceMethod, Pricer, PricerAvnuApi, PricerBase, 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, SVK_SIMPLE_SANITIZER, type SecurityMetadata, SenseiStrategies, SenseiVault, type SenseiVaultSettings, type SingleActionAmount, type SingleTokenInfo, type SourceCodeInfo, SourceCodeType, StandardMerkleTree, type StandardMerkleTreeData, StarknetCallParser, type StarknetCallParserOptions, Store, type StoreConfig, type StrategyAlert, type StrategyApyHistoryUIConfig, type StrategyCapabilities, type StrategyFilterMetadata, type StrategyInputMode, StrategyLiveStatus, type StrategyMetadata, type StrategyRegistryEntry, type StrategySettings, StrategyTag, StrategyType, type SupportedPosition, SvkTrovesAdapter, type SvkTrovesAdapterConfig, type Swap, type SwapInfo, type SwapPriceInfo, TRANSFER_SANITIZER, TelegramGroupNotif, TelegramNotif, type TokenAmount, TokenIndexingType, type TokenInfo, TokenMarketData, TokenTransferAdapter, type TokenTransferAdapterConfig, UNIVERSAL_ADAPTER_IDS, 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 VesuDepositParams, type VesuModifyDelegationCallParams, VesuModifyPositionAdapter, type VesuModifyPositionAdapterConfig, type VesuModifyPositionCallParams, type VesuModifyPositionDepositParams, type VesuModifyPositionWithdrawParams, VesuMultiplyAdapter, type VesuMultiplyAdapterConfig, type VesuMultiplyCallParams, VesuPoolMetadata, VesuPools, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, VesuSupplyOnlyAdapter, type VesuSupplyOnlyAdapterConfig, type VesuWithdrawParams, Web3Number, type WithdrawParams, YoLoVault, type YoloSettings, type YoloSpendingLevel, type YoloVaultSettings, type YoloVaultStatus, YoloVaultStrategies, ZkLend, _riskFactor, assert, buildStrategyRegistry, configureLogger, createBoostedXSTRKCarryStrategy, createEkuboCLStrategy, createHyperLSTStrategy, createSenseiStrategy, createStrategy, createUniversalStrategy, createVesuRebalanceStrategy, createYoloVaultStrategy, detectCapabilities, extensionMap, getAPIUsingHeadlessBrowser, getAllStrategyMetadata, getAllStrategyTags, getContractDetails, getDefaultStoreConfig, getFAQs, getFilterMetadata, getInvestmentSteps, getLiveStrategies, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getStrategiesByType, getStrategyTagDesciption, getStrategyTypeFromMetadata, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, isDualTokenStrategy, logger, toAmountsInfo, toBigInt };