StaticcalculateThe amount of tokens the user wanted to swap from.
The estimated amount of input tokens expected in a SwapQuote
The estimated amount of output tokens expected from a SwapQuote
The amount of slippage to adjust for.
Specifies the token the parameter amountrepresents in the swap quote. If true, the amount represents
the input token of the swap.
A Partial SwapInput object containing the slippage adjusted 'amount' & 'otherAmountThreshold' parameters.
StaticgetFetch a batch of tick-arrays for a set of TA requests.
The Whirlpool programId which the Whirlpool lives on.
WhirlpoolAccountCacheInterface instance to fetch solana accounts
An array of TickArrayRequest of tick-arrays to request for.
Optionalopts: SimpleAccountFetchOptionsan WhirlpoolAccountFetchOptions object to define fetch and cache options when accessing on-chain accounts
A array of request indicies mapped to an array of resulting PublicKeys.
StaticgetGet the default values for the otherAmountThreshold parameter in a swap.
The direction of a swap
The default values for the otherAmountThreshold parameter in a swap.
StaticgetGet the default values for the sqrtPriceLimit parameter in a swap.
The direction of a swap
The default values for the sqrtPriceLimit parameter in a swap.
StaticgetGiven the intended token mint to swap, return the swap direction of a swap for a Whirlpool
The Whirlpool to evaluate the mint against
The token mint PublicKey the user bases their swap against
Whether the swap token is the input token. (similar to amountSpecifiedIsInput from swap Ix)
The direction of the swap given the swapTokenMint. undefined if the token mint is not part of the trade pair of the pool.
StaticgetConvert a quote object and WhirlpoolClient's Whirlpool object into a SwapParams type to be plugged into WhirlpoolIx.swapIx.
A SwapQuote type generated from swapQuoteWithParams
A Whirlpool object from WhirlpoolClient
The public key for the ATA of the input token in the swap
The public key for the ATA of the input token in the swap
The token authority for this swap
A converted SwapParams generated from the input
StaticgetStaticinterpolateGiven a set of tickArrays, interpolate the tickArrays with zeroed tick data if they are not initialized.
PublicKey of the whirlpool to swap on.
Fetched tickArrays to interpolate.
An array of TickArray objects with zeroed tick data if they are not initialized.
StaticgetGiven the tickArrays, return the fallback tickArray account that this swap may traverse across.
An array of tickArrays to be used in the swap.
The tickSpacing for the Whirlpool.
The direction of the trade.
The Whirlpool programId which the Whirlpool lives on.
PublicKey of the whirlpool to swap on.
A PublicKey for the fallback tickArray account that this swap may traverse across. If the fallback tickArray does not exist, return undefined.
StaticgetFetch the oracle data for a given whirlpool.
The Whirlpool programId which the Whirlpool lives on.
PublicKey of the whirlpool to swap on.
WhirlpoolAccountCacheInterface object to fetch solana accounts
Optionalopts: SimpleAccountFetchOptionsan WhirlpoolAccountFetchOptions object to define fetch and cache options when accessing on-chain accounts
OracleData object containing the trade enable timestamp and adaptive fee constants and variables if the oracle is initialized, otherwise null.
StaticgetGiven the current tick-index, returns the dervied PDA and fetched data for the tick-arrays that this swap may traverse across.
The current tickIndex for the Whirlpool to swap on.
The tickSpacing for the Whirlpool.
The direction of the trade.
The Whirlpool programId which the Whirlpool lives on.
PublicKey of the whirlpool to swap on.
An array of PublicKey[] for the tickArray accounts that this swap may traverse across.
StaticgetGiven the current tick-index, returns TickArray objects that this swap may traverse across.
The current tickIndex for the Whirlpool to swap on.
The tickSpacing for the Whirlpool.
The direction of the trade.
The Whirlpool programId which the Whirlpool lives on.
PublicKey of the whirlpool to swap on.
WhirlpoolAccountCacheInterface object to fetch solana accounts
Optionalopts: SimpleAccountFetchOptionsan WhirlpoolAccountFetchOptions object to define fetch and cache options when accessing on-chain accounts
An array of PublicKey[] for the tickArray accounts that this swap may traverse across.
Calculate the SwapInput parameters
amount&otherAmountThresholdbased on the amountIn & amountOut estimates from a quote.