SwapInput: {
    aToB: boolean;
    amount: BN;
    amountSpecifiedIsInput: boolean;
    otherAmountThreshold: BN;
    sqrtPriceLimit: BN;
    tickArray0: PublicKey;
    tickArray1: PublicKey;
    tickArray2: PublicKey;
}

Parameters that describe the nature of a swap on a Whirlpool.

Type declaration

  • aToB: boolean
  • amount: BN
  • amountSpecifiedIsInput: boolean
  • otherAmountThreshold: BN
  • sqrtPriceLimit: BN
  • tickArray0: PublicKey
  • tickArray1: PublicKey
  • tickArray2: PublicKey

Param: aToB

The direction of the swap. True if swapping from A to B. False if swapping from B to A.

Param: amountSpecifiedIsInput

Specifies the token the parameter amountrepresents. If true, the amount represents the input token of the swap.

Param: amount

The amount of input or output token to swap from (depending on amountSpecifiedIsInput).

Param: otherAmountThreshold

The maximum/minimum of input/output token to swap into (depending on amountSpecifiedIsInput).

Param: sqrtPriceLimit

The maximum/minimum price the swap will swap to.

Param: tickArray0

PublicKey of the tick-array where the Whirlpool's currentTickIndex resides in

Param: tickArray1

The next tick-array in the swap direction. If the swap will not reach the next tick-aray, input the same array as tickArray0.

Param: tickArray2

The next tick-array in the swap direction after tickArray2. If the swap will not reach the next tick-aray, input the same array as tickArray1.

Generated using TypeDoc