Private _assetPrivate _associatedPrivate _connectionPrivate _eurosPrivate _isPrivate _placeholderPrivate _programPrivate _providerPrivate _sdxPrivate _stablePrivate _statePrivate _tokenPrivate _tradingPrivate _tradingPrivate _volatilityPrivate Readonly boundPrivate Readonly boundPrivate Readonly boundOptional optionalAssetDetails: AssetDetailsPrivate Readonly boundPrivate Readonly boundOptional fromCache: booleanPrivate Readonly boundOptional fromCache: booleanOptional enableLogging: booleanPrivate Readonly boundOptional fromCache: booleanOptional enableLogging: booleanPrivate Readonly boundOptional enableLogging: booleanPrivate Readonly boundOptional fromCache: booleanOptional enableLogging: booleanPrivate Readonly boundOptional tradingAccountKey: PublicKeyOptional fromCache: booleanOptional enableLogging: booleanPrivate Readonly boundOptional fromCache: booleanOptional enableLogging: booleanPrivate Readonly boundOptional fromCache: booleanOptional enableLogging: booleanPrivate Readonly boundOptional fromCache: booleanOptional enableLogging: booleanPrivate Readonly boundPrivate Readonly boundPrivate Readonly boundOptional tradingAccount: PublicKeyPrivate Readonly boundOptional optionalAssetDetails: AssetDetailsPrivate Readonly boundcancelVaultTransferImpl for usage details
depositToTradingImpl for usage details
Optional optionalAssetDetails: AssetDetailsdepositToVaultImpl for usage details
Estimates the liquidity pool tokens receivable for a deposit and provides a suggested deposit amount to minimize slippage.
The amount of the underlying asset to deposit (in float).
The amount of the stable token to deposit (in float).
The type of the underlying asset.
A promise that resolves to an object that contains the estimated LP deposit amount.
Estimates the amounts of underlying and stable assets receivable for a liquidity pool withdrawal.
The amount of the liquidity pool tokens to withdraw (in float).
The type of the underlying asset.
A promise that resolves to estimated amounts of underlying and stable assets receivable.
Asynchronously calculates the price and associated fees for given series of options on a specific asset.
The asset for which the option pricing is to be estimated.
An array of series IDs for which the option pricing needs to be estimated.
Size of the position the user is considering, use 1 for buying and -1 for selling.
Estimates the details of a trade for a given asset, option series ID and size to trade. If user trading account does not exist, assumes that user has normal fee tier.
The asset involved in the trade.
The ID of the option series involved in the trade.
The user's position size.
Optional fromCache: booleanA flag indicating whether to fetch account data from cache. Defaults to false.
Optional enableLogging: booleanA flag indicating whether to enable logging. Defaults to false.
This method is used to fetch the price of a liquidity pool (LP) token. It obtains the details of the underlying and stable assets, loads the necessary accounts (option chain, option vault, volatility feed, vault trading account), and fetches the current timestamp and underlying price. It uses these inputs to estimate and return the price of the LP token.
Throws an error if unable to fetch the LP token price.
The amount of LP tokens for which to fetch the price (in float)
The underlying asset associated with the LP token.
A promise that resolves to an estimate of the LP token price, values in float.
This method is used to fetch the market option pricing for a specified asset. It gets the details of the asset, loads the option chain, volatility feed, and underlying price of the asset. It then calculates and returns the new option pricing based on these inputs.
Throws an error if unable to fetch the market option pricing for the asset.
The asset for which to fetch the market option pricing.
A promise that resolves to a map where the key is a number (typically representing an option ID or similar identifier) and the value is an object representing the pricing details for that option.
Gets the associated token account balance for the given asset mint, for the current wallet. Returns 0 if the associated token account is not initialized.
The asset mint to get the associated token account for.
Token balance of account in raw decimals
loadAccountBalancesImpl for usage details
Optional fromCache: booleanloadOptionChainImpl for usage details
Optional fromCache: booleanOptional enableLogging: booleanloadOptionVaultImpl for usage details
Optional fromCache: booleanOptional enableLogging: booleanloadProgramAuthorityImpl for usage details
Optional enableLogging: booleanloadTokenWhitelistImpl for usage details
Optional fromCache: booleanOptional enableLogging: booleanloadTradingAccountImpl for usage details
Optional tradingAccountKey: PublicKeyOptional fromCache: booleanOptional enableLogging: booleanloadTransferQueueImpl for usage details
Optional fromCache: booleanOptional enableLogging: booleanloadTransferRecordImpl for usage details
Optional fromCache: booleanOptional enableLogging: booleanloadVolatilityFeedImpl for usage details
Optional fromCache: booleanOptional enableLogging: booleanprocessNextTransferRecordImpl for usage details
sellOptionBySeriesIdImpl for usage details
settleExpiredPositionImpl for usage details
Optional tradingAccount: PublicKeyFor a given array of mints, find the associated token account addresses, check if they are initialized, and if not, generate instructions to initialize them.
The mint accounts to setup ATAs for.
A promise that resolves to an array of ATAs, and initialization instructions.
For a given array of mints, find the trading token account addresses, check if they are initialized, and if not, generate instructions to initialize them.
The mint accounts to setup trading token accounts for.
A promise that resolves to an array of addresses, and initialization instructions.
withdrawFromTradingImpl for usage details
Optional optionalAssetDetails: AssetDetailswithdrawFromVaultImpl for usage details
Generated using TypeDoc
See
buyOptionBySeriesIdImpl for usage details