@strkfarm/sdk 2.0.0-dev.42 → 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/cli.js +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/index.browser.global.js +26409 -25535
- package/dist/index.browser.mjs +859 -581
- package/dist/index.d.ts +52 -8
- package/dist/index.js +894 -613
- package/dist/index.mjs +864 -584
- package/package.json +72 -14
- package/src/global.ts +219 -230
- package/src/interfaces/common.tsx +12 -3
- package/src/modules/ekubo-pricer.ts +2 -1
- package/src/modules/pricer.ts +27 -15
- package/src/modules/zkLend.ts +3 -2
- package/src/strategies/ekubo-cl-vault.tsx +0 -5
- package/src/strategies/svk-strategy.ts +7 -0
- package/src/strategies/token-boosted-xstrk-carry-strategy.tsx +0 -1
- package/src/strategies/universal-lst-muliplier-strategy.tsx +294 -39
- package/src/strategies/universal-strategy.tsx +0 -1
- package/src/strategies/yoloVault.ts +2 -0
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",
|
|
@@ -208,7 +217,6 @@ interface StrategyAlert {
|
|
|
208
217
|
tab: "all" | "deposit" | "withdraw";
|
|
209
218
|
}
|
|
210
219
|
interface StrategySettings {
|
|
211
|
-
maxTVL?: Web3Number;
|
|
212
220
|
liveStatus?: StrategyLiveStatus;
|
|
213
221
|
isPaused?: boolean;
|
|
214
222
|
isInMaintenance?: boolean;
|
|
@@ -459,7 +467,6 @@ interface PriceInfo {
|
|
|
459
467
|
price: number;
|
|
460
468
|
timestamp: Date;
|
|
461
469
|
}
|
|
462
|
-
type PriceMethod = 'AvnuApi' | 'Coinbase' | 'Coinmarketcap' | 'Ekubo' | 'Avnu';
|
|
463
470
|
declare class Pricer extends PricerBase {
|
|
464
471
|
protected prices: {
|
|
465
472
|
[key: string]: PriceInfo;
|
|
@@ -484,6 +491,7 @@ declare class Pricer extends PricerBase {
|
|
|
484
491
|
getPrice(tokenSymbol: string, blockNumber?: BlockIdentifier): Promise<PriceInfo>;
|
|
485
492
|
protected _loadPrices(onUpdate?: (tokenSymbol: string) => void): void;
|
|
486
493
|
_getPrice(token: TokenInfo): Promise<number>;
|
|
494
|
+
protected _getMethodsToTry(token: TokenInfo): PriceMethod[];
|
|
487
495
|
protected _tryPriceMethod(token: TokenInfo, method: PriceMethod): Promise<number>;
|
|
488
496
|
_getPriceAvnuApi(token: TokenInfo): Promise<number>;
|
|
489
497
|
_getPriceCoinbase(token: TokenInfo): Promise<number>;
|
|
@@ -1118,7 +1126,6 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
|
|
|
1118
1126
|
* regardless of quote asset configuration.
|
|
1119
1127
|
*/
|
|
1120
1128
|
getUserRealizedAPY(blockIdentifier?: BlockIdentifier, sinceBlocks?: number): Promise<number>;
|
|
1121
|
-
getMaxTVL(): Promise<Web3Number>;
|
|
1122
1129
|
getUserPositionCards(input: UserPositionCardsInput): Promise<UserPositionCard[]>;
|
|
1123
1130
|
feeBasedAPY(timeperiod?: '24h' | '7d' | '30d' | '3m'): Promise<number>;
|
|
1124
1131
|
/**
|
|
@@ -2469,6 +2476,7 @@ declare abstract class SVKStrategy<S extends UniversalStrategySettings> extends
|
|
|
2469
2476
|
getPrevAUM(): Promise<Web3Number>;
|
|
2470
2477
|
maxDepositables(): Promise<PositionInfo[]>;
|
|
2471
2478
|
maxWithdrawables(): Promise<PositionInfo[]>;
|
|
2479
|
+
getMaxTVL(): Promise<Web3Number>;
|
|
2472
2480
|
}
|
|
2473
2481
|
|
|
2474
2482
|
interface UniversalManageCall {
|
|
@@ -2687,13 +2695,49 @@ declare class UniversalLstMultiplierStrategy<S extends HyperLSTStrategySettings>
|
|
|
2687
2695
|
id: string;
|
|
2688
2696
|
}[];
|
|
2689
2697
|
}>;
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
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
|
+
}>;
|
|
2693
2710
|
protected getUnusedBalanceAPY(): Promise<{
|
|
2694
2711
|
apy: number;
|
|
2695
2712
|
weight: number;
|
|
2696
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
|
+
}>;
|
|
2697
2741
|
getAUM(unrealizedAUM?: boolean): Promise<{
|
|
2698
2742
|
net: SingleTokenInfo;
|
|
2699
2743
|
prevAum: Web3Number;
|
|
@@ -3021,8 +3065,8 @@ declare class Global {
|
|
|
3021
3065
|
static getDefaultTokens(): TokenInfo[];
|
|
3022
3066
|
static getTokens(): Promise<TokenInfo[]>;
|
|
3023
3067
|
static assert(condition: any, message: string): void;
|
|
3024
|
-
static getTokenInfoFromName(tokenName: string): Promise<TokenInfo>;
|
|
3025
3068
|
static getTokenInfoFromAddr(addr: ContractAddr): Promise<TokenInfo>;
|
|
3069
|
+
static getTokenInfoFromName(tokenName: string): Promise<TokenInfo>;
|
|
3026
3070
|
static setGlobalCache(key: string, data: any, ttl?: number): void;
|
|
3027
3071
|
static getGlobalCache<T>(key: string): T | null;
|
|
3028
3072
|
}
|
|
@@ -3316,4 +3360,4 @@ declare class PasswordJsonCryptoUtil {
|
|
|
3316
3360
|
decrypt(encryptedData: string, password: string): any;
|
|
3317
3361
|
}
|
|
3318
3362
|
|
|
3319
|
-
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 };
|