@strkfarm/sdk 1.1.34 → 1.1.36
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.browser.global.js +2732 -45
- package/dist/index.browser.mjs +2732 -45
- package/dist/index.d.ts +57 -4
- package/dist/index.js +2733 -45
- package/dist/index.mjs +2732 -45
- package/package.json +1 -1
- package/src/data/vesu-extension.abi.json +2443 -0
- package/src/strategies/universal-adapters/vesu-adapter.ts +201 -0
- package/src/strategies/universal-lst-muliplier-strategy.tsx +162 -40
- package/src/strategies/universal-strategy.tsx +33 -18
package/dist/index.d.ts
CHANGED
|
@@ -1001,6 +1001,16 @@ interface VesuAdapterConfig {
|
|
|
1001
1001
|
vaultAllocator: ContractAddr;
|
|
1002
1002
|
id: string;
|
|
1003
1003
|
}
|
|
1004
|
+
type InterestRateConfig = {
|
|
1005
|
+
target_utilization: bigint;
|
|
1006
|
+
zero_utilization_rate: bigint;
|
|
1007
|
+
target_rate_percent: bigint;
|
|
1008
|
+
min_target_utilization: bigint;
|
|
1009
|
+
max_target_utilization: bigint;
|
|
1010
|
+
rate_half_life: bigint;
|
|
1011
|
+
min_full_utilization_rate: bigint;
|
|
1012
|
+
max_full_utilization_rate: bigint;
|
|
1013
|
+
};
|
|
1004
1014
|
interface TokenAmount {
|
|
1005
1015
|
token: ContractAddr;
|
|
1006
1016
|
amount: Web3Number;
|
|
@@ -1053,6 +1063,9 @@ declare const VesuPools: {
|
|
|
1053
1063
|
Re7xSTRK: ContractAddr;
|
|
1054
1064
|
Re7xBTC: ContractAddr;
|
|
1055
1065
|
};
|
|
1066
|
+
declare const extensionMap: {
|
|
1067
|
+
[key: string]: ContractAddr;
|
|
1068
|
+
};
|
|
1056
1069
|
declare function getVesuSingletonAddress(vesuPool: ContractAddr): {
|
|
1057
1070
|
addr: ContractAddr;
|
|
1058
1071
|
isV2: boolean;
|
|
@@ -1101,6 +1114,8 @@ declare class VesuAdapter extends BaseAdapter {
|
|
|
1101
1114
|
contract: Contract;
|
|
1102
1115
|
isV2: boolean;
|
|
1103
1116
|
};
|
|
1117
|
+
getDebtCap(config: IConfig): Promise<Web3Number>;
|
|
1118
|
+
getMaxBorrowableByInterestRate(config: IConfig, asset: TokenInfo, maxBorrowAPY: number): Promise<Web3Number>;
|
|
1104
1119
|
getLTVConfig(config: IConfig): Promise<number>;
|
|
1105
1120
|
getPositions(config: IConfig): Promise<VaultPosition[]>;
|
|
1106
1121
|
getCollateralization(config: IConfig): Promise<Omit<VaultPosition, 'amount'>[]>;
|
|
@@ -1115,6 +1130,19 @@ declare class VesuAdapter extends BaseAdapter {
|
|
|
1115
1130
|
}>;
|
|
1116
1131
|
getHealthFactor(): Promise<number>;
|
|
1117
1132
|
static getVesuPools(retry?: number): Promise<VesuPoolsInfo>;
|
|
1133
|
+
fullUtilizationRate(interestRateConfig: InterestRateConfig, timeDelta: bigint, utilization: bigint, fullUtilizationRate: bigint): bigint;
|
|
1134
|
+
/**
|
|
1135
|
+
* Calculates new interest rate per second and next full utilization rate.
|
|
1136
|
+
*/
|
|
1137
|
+
calculateInterestRate(interestRateConfig: InterestRateConfig, utilization: bigint, timeDelta: bigint, lastFullUtilizationRate: bigint): {
|
|
1138
|
+
newRatePerSecond: bigint;
|
|
1139
|
+
nextFullUtilizationRate: bigint;
|
|
1140
|
+
};
|
|
1141
|
+
/**
|
|
1142
|
+
* Calculates utilization given a specific rate per second.
|
|
1143
|
+
* This is an inverse function of the piecewise interest rate formula above.
|
|
1144
|
+
*/
|
|
1145
|
+
getMaxUtilizationGivenRatePerSecond(interestRateConfig: InterestRateConfig, ratePerSecond: bigint, timeDelta: bigint, last_full_utilization_rate: bigint): bigint;
|
|
1118
1146
|
}
|
|
1119
1147
|
|
|
1120
1148
|
declare const SIMPLE_SANITIZER: ContractAddr;
|
|
@@ -1182,6 +1210,11 @@ declare class UniversalStrategy<S extends UniversalStrategySettings> extends Bas
|
|
|
1182
1210
|
amount: Web3Number;
|
|
1183
1211
|
usdValue: number;
|
|
1184
1212
|
}>;
|
|
1213
|
+
getVesuAPYs(): Promise<{
|
|
1214
|
+
baseAPYs: number[];
|
|
1215
|
+
rewardAPYs: number[];
|
|
1216
|
+
positions: VaultPosition[];
|
|
1217
|
+
}>;
|
|
1185
1218
|
/**
|
|
1186
1219
|
* Calculates the weighted average APY across all pools based on USD value.
|
|
1187
1220
|
* @returns {Promise<number>} The weighted average APY across all pools
|
|
@@ -1193,6 +1226,13 @@ declare class UniversalStrategy<S extends UniversalStrategySettings> extends Bas
|
|
|
1193
1226
|
id: string;
|
|
1194
1227
|
}[];
|
|
1195
1228
|
}>;
|
|
1229
|
+
protected returnNetAPY(baseAPYs: number[], rewardAPYs: number[], weights: number[]): Promise<{
|
|
1230
|
+
net: number;
|
|
1231
|
+
splits: {
|
|
1232
|
+
apy: number;
|
|
1233
|
+
id: string;
|
|
1234
|
+
}[];
|
|
1235
|
+
}>;
|
|
1196
1236
|
protected getUnusedBalanceAPY(): Promise<{
|
|
1197
1237
|
apy: number;
|
|
1198
1238
|
weight: number;
|
|
@@ -1287,11 +1327,15 @@ declare function getContractDetails(settings: UniversalStrategySettings): {
|
|
|
1287
1327
|
}[];
|
|
1288
1328
|
declare const UniversalStrategies: IStrategyMetadata<UniversalStrategySettings>[];
|
|
1289
1329
|
|
|
1290
|
-
|
|
1330
|
+
interface HyperLSTStrategySettings extends UniversalStrategySettings {
|
|
1331
|
+
borrowable_assets: TokenInfo[];
|
|
1332
|
+
}
|
|
1333
|
+
declare class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTStrategySettings> {
|
|
1291
1334
|
private quoteAmountToFetchPrice;
|
|
1292
|
-
constructor(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<
|
|
1335
|
+
constructor(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<HyperLSTStrategySettings>);
|
|
1293
1336
|
asset(): TokenInfo;
|
|
1294
1337
|
getTag(): string;
|
|
1338
|
+
getVesuSameTokenAdapter(): VesuAdapter;
|
|
1295
1339
|
getVesuAdapters(): VesuAdapter[];
|
|
1296
1340
|
protected getRewardsAUM(prevAum: Web3Number): Promise<Web3Number>;
|
|
1297
1341
|
getLSTDexPrice(): Promise<number>;
|
|
@@ -1304,6 +1348,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<Universal
|
|
|
1304
1348
|
shouldRebalance: boolean;
|
|
1305
1349
|
manageCall: Call | undefined;
|
|
1306
1350
|
}>;
|
|
1351
|
+
protected getVesuAUM(adapter: VesuAdapter): Promise<Web3Number>;
|
|
1307
1352
|
private _getMinOutputAmountLSTBuy;
|
|
1308
1353
|
private _getMinOutputAmountLSTSell;
|
|
1309
1354
|
/**
|
|
@@ -1316,6 +1361,13 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<Universal
|
|
|
1316
1361
|
leg1DepositAmount: Web3Number;
|
|
1317
1362
|
}): Promise<Call[]>;
|
|
1318
1363
|
getLSTUnderlyingTokenInfo(): TokenInfo;
|
|
1364
|
+
getMaxBorrowableAmount(): Promise<{
|
|
1365
|
+
netMaxBorrowableAmount: Web3Number;
|
|
1366
|
+
maxBorrowables: {
|
|
1367
|
+
amount: Web3Number;
|
|
1368
|
+
borrowableAsset: TokenInfo;
|
|
1369
|
+
}[];
|
|
1370
|
+
}>;
|
|
1319
1371
|
/**
|
|
1320
1372
|
* Gets LST APR for the strategy's underlying asset from Endur API
|
|
1321
1373
|
* @returns Promise<number> The LST APR (not divided by 1e18)
|
|
@@ -1328,6 +1380,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<Universal
|
|
|
1328
1380
|
id: string;
|
|
1329
1381
|
}[];
|
|
1330
1382
|
}>;
|
|
1383
|
+
maxNewDeposits(): Promise<number>;
|
|
1331
1384
|
protected getUnusedBalanceAPY(): Promise<{
|
|
1332
1385
|
apy: number;
|
|
1333
1386
|
weight: number;
|
|
@@ -1344,7 +1397,7 @@ declare class UniversalLstMultiplierStrategy extends UniversalStrategy<Universal
|
|
|
1344
1397
|
isIncrease: boolean;
|
|
1345
1398
|
}): Promise<Call[]>;
|
|
1346
1399
|
}
|
|
1347
|
-
declare const HyperLSTStrategies: IStrategyMetadata<
|
|
1400
|
+
declare const HyperLSTStrategies: IStrategyMetadata<HyperLSTStrategySettings>[];
|
|
1348
1401
|
|
|
1349
1402
|
interface EkuboRouteNode {
|
|
1350
1403
|
pool_key: {
|
|
@@ -1617,4 +1670,4 @@ declare class PasswordJsonCryptoUtil {
|
|
|
1617
1670
|
decrypt(encryptedData: string, password: string): any;
|
|
1618
1671
|
}
|
|
1619
1672
|
|
|
1620
|
-
export { AUMTypes, AVNU_EXCHANGE, AVNU_MIDDLEWARE, type AccountInfo, type AdapterLeafType, type AllAccountsStore, type ApproveCallParams, AutoCompounderSTRK, type AvnuSwapCallParams, AvnuWrapper, BaseAdapter, 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 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, 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 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, getAPIUsingHeadlessBrowser, getContractDetails, getDefaultStoreConfig, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, logger, toBigInt };
|
|
1673
|
+
export { AUMTypes, AVNU_EXCHANGE, AVNU_MIDDLEWARE, type AccountInfo, type AdapterLeafType, type AllAccountsStore, type ApproveCallParams, AutoCompounderSTRK, type AvnuSwapCallParams, AvnuWrapper, BaseAdapter, 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, 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 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 };
|