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.
Fetch a batch of tick-arrays for a set of TA requests.
The Whirlpool programId which the Whirlpool lives on.
An array of TickArrayRequest of tick-arrays to request for.
an 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.
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.
Convert 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
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.
an 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.
Generated using TypeDoc
Calculate the SwapInput parameters
amount
&otherAmountThreshold
based on the amountIn & amountOut estimates from a quote.