@strkfarm/sdk 2.0.0-dev.21 → 2.0.0-dev.23
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 +887 -262
- package/dist/index.browser.mjs +813 -188
- package/dist/index.d.ts +24 -2
- package/dist/index.js +814 -188
- package/dist/index.mjs +813 -188
- package/package.json +1 -1
- package/src/strategies/universal-adapters/avnu-adapter.ts +2 -1
- package/src/strategies/vesu-extended-strategy/services/operationService.ts +1 -0
- package/src/strategies/vesu-extended-strategy/utils/helper.ts +32 -2
- package/src/strategies/vesu-extended-strategy/vesu-extended-strategy.tsx +1144 -337
package/dist/index.d.ts
CHANGED
|
@@ -2222,6 +2222,7 @@ declare abstract class Operations {
|
|
|
2222
2222
|
extendedAmount: Web3Number;
|
|
2223
2223
|
extendedLeverage: number;
|
|
2224
2224
|
vesuLeverage: number;
|
|
2225
|
+
debtAmountToBeRepaid: Web3Number;
|
|
2225
2226
|
}>;
|
|
2226
2227
|
/**
|
|
2227
2228
|
* Move assets between protocols.
|
|
@@ -2281,12 +2282,22 @@ declare class VesuExtendedMultiplierStrategy<S extends VesuExtendedStrategySetti
|
|
|
2281
2282
|
collateralPrice: number;
|
|
2282
2283
|
debtPrice: number;
|
|
2283
2284
|
vesuLeverage: number;
|
|
2285
|
+
debtAmountToBeRepaid: Web3Number;
|
|
2284
2286
|
}>;
|
|
2285
2287
|
shouldMoveAssets(extendedAmount: Web3Number, vesuAmount: Web3Number): Promise<TransactionResult[]>;
|
|
2286
2288
|
/**
|
|
2287
2289
|
* Helper method to create transaction result with metadata
|
|
2288
2290
|
*/
|
|
2289
2291
|
private createTransactionResult;
|
|
2292
|
+
/**
|
|
2293
|
+
* This method is used to move assets between protocols
|
|
2294
|
+
* @param params - The parameters for the move assets operation
|
|
2295
|
+
* @param extendedAdapter - The extended adapter
|
|
2296
|
+
* @param vesuAdapter - The vesu adapter
|
|
2297
|
+
* @returns The transaction result
|
|
2298
|
+
* If Extended amount is greater than amount of withdrawal from extended, then we need to open a long position
|
|
2299
|
+
* so that the amount of withdrawal from extended is fullfilled
|
|
2300
|
+
*/
|
|
2290
2301
|
moveAssets(params: {
|
|
2291
2302
|
amount: Web3Number;
|
|
2292
2303
|
from: string;
|
|
@@ -2773,11 +2784,22 @@ declare const calculateExposureDelta: (exposure_extended: number, exposure_vesu:
|
|
|
2773
2784
|
* @returns {number} The delta percentage
|
|
2774
2785
|
*/
|
|
2775
2786
|
declare const calculateBTCPriceDelta: (btcPrice: number, lastBtcPrice: number) => number;
|
|
2776
|
-
declare const calculateVesUPositionSizeGivenExtended: (extendedPositonValue: number, extendedHoldingAmount: Web3Number, collateralAmount: Web3Number, collateralPrice: number) => {
|
|
2787
|
+
declare const calculateVesUPositionSizeGivenExtended: (extendedPositonValue: number, extendedHoldingAmount: Web3Number, collateralAmount: Web3Number, collateralPrice: number, vesuDebtAmountToBeRepaid: Web3Number) => {
|
|
2777
2788
|
vesuAmountInUsd: string;
|
|
2778
2789
|
vesuAmountInBTC: Web3Number;
|
|
2779
2790
|
extendedAmountInBTC: Web3Number;
|
|
2780
2791
|
};
|
|
2792
|
+
/**
|
|
2793
|
+
* calculate the debt amount to be repaid to maintain the ltv
|
|
2794
|
+
* @param maxLtv - The maximum ltv
|
|
2795
|
+
* @param existingVesuCollateral - The existing vesu collateral
|
|
2796
|
+
* @param existingVesuDebt - The existing vesu debt
|
|
2797
|
+
* @param collateralPrice - The collateral price
|
|
2798
|
+
* @param debtPrice - The debt price
|
|
2799
|
+
* @param targetHf - The target hf
|
|
2800
|
+
* @returns The debt amount to be repaid
|
|
2801
|
+
*/
|
|
2802
|
+
declare const calculateDeltaDebtAmount: (maxLtv: number | undefined, existingVesuCollateral: Web3Number, existingVesuDebt: Web3Number, collateralPrice: number, debtPrice: number, targetHf?: number) => Web3Number | null;
|
|
2781
2803
|
|
|
2782
2804
|
interface EkuboRouteNode {
|
|
2783
2805
|
pool_key: {
|
|
@@ -3124,4 +3146,4 @@ declare class PasswordJsonCryptoUtil {
|
|
|
3124
3146
|
decrypt(encryptedData: string, password: string): any;
|
|
3125
3147
|
}
|
|
3126
3148
|
|
|
3127
|
-
export { type APYInfo, APYType, AUDIT_URL, AUMTypes, AVNU_EXCHANGE, AVNU_EXCHANGE_FOR_LEGACY_USDC, AVNU_LEGACY_SANITIZER, AVNU_MIDDLEWARE, AVNU_QUOTE_URL, AbisConfig, type AccountInfo, type AdapterLeafType, AddressesConfig, type AllAccountsStore, type ApiResponse, type ApproveCallParams, type AssetOperation, AssetOperationStatus, AssetOperationType, AutoCompounderSTRK, AvnuAdapter, type AvnuAdapterConfig, type AvnuSwapCallParams, AvnuWrapper, type Balance, BaseAdapter, type BaseAdapterConfig, BaseStrategy, type CLVaultStrategySettings, type CancelOrderRequest, CommonAdapter, type CommonAdapterConfig, ContractAddr, type CreateOrderRequest, CycleType, type DecreaseLeverParams, Deployer, type DepositParams, type DualActionAmount, type DualTokenInfo, ERC20, EXTENDED_CONTRACT, EXTENDED_SANITIZER, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey, type EkuboQuote, EkuboQuoter, type EkuboRouteNode, type EkuboSplit, ExitType, ExtendedAdapter, type ExtendedAdapterConfig, type ExtendedApiResponse, ExtendedConfig, ExtendedWrapper, type ExtendedWrapperConfig, type FAQ, FatalError, type FlashloanCallParams, FlowChartColors, type FundingRate, type GenerateCallFn, Global, HyperLSTStrategies, type HyperLSTStrategySettings, type IConfig, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, type IncreaseLeverParams, Initializable, type L2Config, LSTAPRService, type LSTStats, type LeafAdapterFn, type LeafData, type LendingToken, type ManageCall, MarginType, type Market, type MarketStats, Midas, Network, type OpenOrder, OrderSide, OrderStatus, OrderStatusReason, OrderType, PRICE_ROUTER, PasswordJsonCryptoUtil, type PlacedOrder, type Position, type PositionAPY, type PositionAmount, type PositionHistory, type PositionInfo, PositionSide, PositionTypeAvnuExtended, Pragma, type PriceInfo, Pricer, PricerBase, PricerFromApi, PricerLST, PricerRedis, Protocols, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, type RiskFactorConfig, RiskType, type Route, type RouteNode, SIMPLE_SANITIZER, SIMPLE_SANITIZER_V2, SIMPLE_SANITIZER_VESU_V1_DELEGATIONS, SenseiStrategies, SenseiVault, type SenseiVaultSettings, type SettlementSignature, type SignedWithdrawRequest, type SingleActionAmount, type SingleTokenInfo, StandardMerkleTree, type StandardMerkleTreeData, type StarkDebuggingOrderAmounts, type StarkSettlement, Store, type StoreConfig, type SupportedPosition, type Swap, type SwapInfo, TelegramGroupNotif, TelegramNotif, TimeInForce, type TokenAmount, type TokenInfo, TokenMarketData, type TradingConfig, type TransactionMetadata, type TransactionResult, UNIVERSAL_MANAGE_IDS, UniversalLstMultiplierStrategy, type UniversalManageCall, type UniversalStrategySettings, UnusedBalanceAdapter, type UnusedBalanceAdapterConfig, type UpdateLeverageRequest, VESU_SINGLETON, VESU_V2_MODIFY_POSITION_SANITIZER, type VaultPosition, VesuAdapter, type VesuAdapterConfig, type VesuAmount, VesuAmountDenomination, VesuAmountType, VesuConfig, type VesuDefiSpringRewardsCallParams, VesuExtendedMultiplierStrategy, type VesuExtendedStrategySettings, VesuExtendedTestStrategies, type VesuModifyDelegationCallParams, type VesuModifyPositionCallParams, VesuMultiplyAdapter, type VesuMultiplyAdapterConfig, type VesuMultiplyCallParams, VesuPools, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, VesuSupplyOnlyAdapter, type VesuSupplyOnlyAdapterConfig, Web3Number, type WithdrawParams, type WithdrawRequest, ZkLend, _riskFactor, assert, calculateAmountDepositOnExtendedWhenIncurringLosses, calculateAmountDistribution, calculateAmountDistributionForWithdrawal, calculateBTCPriceDelta, calculateDebtAmount, calculateDebtReductionAmountForWithdrawal, calculateExposureDelta, calculateExtendedLevergae, calculateVesUPositionSizeGivenExtended, calculateVesuLeverage, calculateWBTCAmountToMaintainLTV, extensionMap, getAPIUsingHeadlessBrowser, getContractDetails, getDefaultStoreConfig, getFAQs, getInvestmentSteps, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, logger, returnFormattedAmount, toBigInt };
|
|
3149
|
+
export { type APYInfo, APYType, AUDIT_URL, AUMTypes, AVNU_EXCHANGE, AVNU_EXCHANGE_FOR_LEGACY_USDC, AVNU_LEGACY_SANITIZER, AVNU_MIDDLEWARE, AVNU_QUOTE_URL, AbisConfig, type AccountInfo, type AdapterLeafType, AddressesConfig, type AllAccountsStore, type ApiResponse, type ApproveCallParams, type AssetOperation, AssetOperationStatus, AssetOperationType, AutoCompounderSTRK, AvnuAdapter, type AvnuAdapterConfig, type AvnuSwapCallParams, AvnuWrapper, type Balance, BaseAdapter, type BaseAdapterConfig, BaseStrategy, type CLVaultStrategySettings, type CancelOrderRequest, CommonAdapter, type CommonAdapterConfig, ContractAddr, type CreateOrderRequest, CycleType, type DecreaseLeverParams, Deployer, type DepositParams, type DualActionAmount, type DualTokenInfo, ERC20, EXTENDED_CONTRACT, EXTENDED_SANITIZER, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey, type EkuboQuote, EkuboQuoter, type EkuboRouteNode, type EkuboSplit, ExitType, ExtendedAdapter, type ExtendedAdapterConfig, type ExtendedApiResponse, ExtendedConfig, ExtendedWrapper, type ExtendedWrapperConfig, type FAQ, FatalError, type FlashloanCallParams, FlowChartColors, type FundingRate, type GenerateCallFn, Global, HyperLSTStrategies, type HyperLSTStrategySettings, type IConfig, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, type IncreaseLeverParams, Initializable, type L2Config, LSTAPRService, type LSTStats, type LeafAdapterFn, type LeafData, type LendingToken, type ManageCall, MarginType, type Market, type MarketStats, Midas, Network, type OpenOrder, OrderSide, OrderStatus, OrderStatusReason, OrderType, PRICE_ROUTER, PasswordJsonCryptoUtil, type PlacedOrder, type Position, type PositionAPY, type PositionAmount, type PositionHistory, type PositionInfo, PositionSide, PositionTypeAvnuExtended, Pragma, type PriceInfo, Pricer, PricerBase, PricerFromApi, PricerLST, PricerRedis, Protocols, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, type RiskFactorConfig, RiskType, type Route, type RouteNode, SIMPLE_SANITIZER, SIMPLE_SANITIZER_V2, SIMPLE_SANITIZER_VESU_V1_DELEGATIONS, SenseiStrategies, SenseiVault, type SenseiVaultSettings, type SettlementSignature, type SignedWithdrawRequest, type SingleActionAmount, type SingleTokenInfo, StandardMerkleTree, type StandardMerkleTreeData, type StarkDebuggingOrderAmounts, type StarkSettlement, Store, type StoreConfig, type SupportedPosition, type Swap, type SwapInfo, TelegramGroupNotif, TelegramNotif, TimeInForce, type TokenAmount, type TokenInfo, TokenMarketData, type TradingConfig, type TransactionMetadata, type TransactionResult, UNIVERSAL_MANAGE_IDS, UniversalLstMultiplierStrategy, type UniversalManageCall, type UniversalStrategySettings, UnusedBalanceAdapter, type UnusedBalanceAdapterConfig, type UpdateLeverageRequest, VESU_SINGLETON, VESU_V2_MODIFY_POSITION_SANITIZER, type VaultPosition, VesuAdapter, type VesuAdapterConfig, type VesuAmount, VesuAmountDenomination, VesuAmountType, VesuConfig, type VesuDefiSpringRewardsCallParams, VesuExtendedMultiplierStrategy, type VesuExtendedStrategySettings, VesuExtendedTestStrategies, type VesuModifyDelegationCallParams, type VesuModifyPositionCallParams, VesuMultiplyAdapter, type VesuMultiplyAdapterConfig, type VesuMultiplyCallParams, VesuPools, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, VesuSupplyOnlyAdapter, type VesuSupplyOnlyAdapterConfig, Web3Number, type WithdrawParams, type WithdrawRequest, ZkLend, _riskFactor, assert, calculateAmountDepositOnExtendedWhenIncurringLosses, calculateAmountDistribution, calculateAmountDistributionForWithdrawal, calculateBTCPriceDelta, calculateDebtAmount, calculateDebtReductionAmountForWithdrawal, calculateDeltaDebtAmount, calculateExposureDelta, calculateExtendedLevergae, calculateVesUPositionSizeGivenExtended, calculateVesuLeverage, calculateWBTCAmountToMaintainLTV, extensionMap, getAPIUsingHeadlessBrowser, getContractDetails, getDefaultStoreConfig, getFAQs, getInvestmentSteps, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, logger, returnFormattedAmount, toBigInt };
|