Withdraw all tokens from a position, close the account and burn the position token.
Users have to collect all fees and rewards from this position prior to closing the account.
If positionWallet, payer is provided, the wallet owner has to sign this transaction.
The address of the position account.
The amount of slippage the caller is willing to accept when withdrawing liquidity.
OptionaldestinationWallet: AddressThe wallet that the tokens withdrawn and rent lamports will be sent to. If null, the WhirlpoolContext wallet is used.
OptionalpositionWallet: AddressThe wallet that houses the position token that corresponds to this position address. If null, the WhirlpoolContext wallet is used.
Optionalpayer: Addressthe wallet that will fund the cost needed to initialize the token ATA accounts. If null, the WhirlpoolContext wallet is used.
OptionalusePriceSlippage: booleanif true, use the price slippage to calculate the minimum tokens to receive. If false, use the token slippage.
transactions that will close the position. The transactions must be executed serially.
Return the address for this Whirlpool instance.
the PublicKey for this Whirlpool instance.
Return the most recently fetched Whirlpool account data.
most recently fetched WhirlpoolData for this address.
Get the WhirlpoolRewardInfos for this pool.
Array of 3 WhirlpoolRewardInfos. However, not all of them may be initialized. Use the initialized field on WhirlpoolRewardInfo to check if the reward is active.
Get the TokenInfo for token A of this pool.
Get the TokenInfo for token B of this pool.
Get the TokenAccountInfo for token vault A of this pool.
TokenAccountInfo for token vault A
Get the TokenAccountInfo for token vault B of this pool.
TokenAccountInfo for token vault B
Initialize a set of tick-arrays that encompasses the provided ticks.
If funder is provided, the funder wallet has to sign this transaction.
A group of ticks that define the desired tick-arrays to initialize. If the tick's array has been initialized, it will be ignored.
Optionalfunder: Addressthe wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used.
Optionalopts: SimpleAccountFetchOptionsan WhirlpoolAccountFetchOptions object to define fetch and cache options when accessing on-chain accounts
OptionaltickArrayType: "dynamic" | "fixed"a transaction that will initialize the defined tick-arrays if executed. Return null if all of the tick's arrays are initialized.
Open and fund a position on this Whirlpool.
User has to ensure the TickArray for tickLower and tickUpper has been initialized prior to calling this function.
If wallet or funder is provided, those wallets have to sign this transaction.
the tick index for the lower bound of this position
the tick index for the upper bound of this position
an InputLiquidityInput type to define the desired liquidity amount to deposit
Optionalwallet: Addressthe wallet to withdraw tokens to deposit into the position and house the position token. If null, the WhirlpoolContext wallet is used.
Optionalfunder: Addressthe wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used.
OptionalpositionMint: PublicKeythe mint address of the position token to be created. If null, a new mint address will be created.
OptionaltokenProgramId: PublicKeythe token program id to use for the position token. The default is TOKEN_PROGRAM_ID.
positionMint - the position to be created. tx - The transaction containing the instructions to perform the operation on chain.
Open and fund a position with meta-data on this Whirlpool.
User has to ensure the TickArray for tickLower and tickUpper has been initialized prior to calling this function.
If wallet or funder is provided, the wallet owners have to sign this transaction.
the tick index for the lower bound of this position
the tick index for the upper bound of this position
input that defines the desired liquidity amount and maximum tokens willing to be to deposited.
Optionalwallet: Addressthe wallet to withdraw tokens to deposit into the position and house the position token. If null, the WhirlpoolContext wallet is used.
Optionalfunder: Addressthe wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used.
OptionalpositionMint: PublicKeythe mint address of the position token to be created. If null, a new mint address will be created.
OptionaltokenProgramId: PublicKeythe token program id to use for the position token. The default is TOKEN_PROGRAM_ID.
OptionalresolveATA: booleanif true, add instructions to create associated token accounts for tokenA,B for the destinationWallet if necessary. (RPC call required)
positionMint - the position to be created. tx - The transaction containing the instructions to perform the operation on chain.
Fetch and return the most recently fetched Whirlpool account data.
the most up to date WhirlpoolData for this address.
Perform a swap between tokenA and tokenB on this pool.
A quote on the desired tokenIn and tokenOut for this swap. Use swapQuoteWithParams or other swap quote functions to generate this object.
Optionalwallet: PublicKeyThe wallet that tokens will be withdrawn and deposit into. If null, the WhirlpoolContext wallet is used.
a transaction that will perform the swap once executed.
Collect a developer fee and perform a swap between tokenA and tokenB on this pool.
A quote on the desired tokenIn and tokenOut for this swap. Use swapQuoteByInputTokenWithDevFees to generate this object.
The wallet that developer fees will be deposited into.
Optionalwallet: PublicKeyThe wallet that swap tokens will be withdrawn and deposit into. If null, the WhirlpoolContext wallet is used.
Optionalpayer: PublicKeyThe wallet that will fund the cost needed to initialize the dev wallet token ATA accounts. If null, the WhirlpoolContext wallet is used.
a transaction that will perform the swap once executed.
Helper class to interact with a Whirlpool account and build complex transactions.