The 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 amount
represents 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.
Get 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.
Get 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.
Given 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.
Given 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.
Given 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.
AccountFetcher object to fetch solana accounts
If true, fetcher would default to fetching the latest accounts
An array of PublicKey[] for the tickArray accounts that this swap may traverse across.
Generated using TypeDoc
Calculate the SwapInput parameters
amount
&otherAmountThreshold
based on the amountIn & amountOut estimates from a quote.