StaticcloseClose a position in a Whirlpool. Burns the position token in the owner's wallet. Mint and TokenAccount are based on Token-2022. And Mint accout will be also closed.
program object containing services required to generate the instruction
ClosePositionWithTokenExtensionsParams object
StaticinitializeInitializes an adaptive fee tier account usable by Whirlpools in this WhirlpoolsConfig space.
InitializeAdaptiveFeeTierParams object
StaticinitializeInitializes a Whirlpool account with adaptive fee.
InitPoolWithAdaptiveFeeTierParams object
StaticlockLock the position to prevent any liquidity changes.
PositionAlreadyLocked - The provided position is already locked.
PositionNotLockable - The provided position is not lockable (e.g. An empty position).
program object containing services required to generate the instruction
LockPositionParams object.
StaticsetSets specific adaptive fee constants for a pool. Only the provided constants will be updated, others remain unchanged.
Program object containing the Whirlpool IDL
SetAdaptiveFeeConstantsParams object
StaticsetSets the feature flag for a WhirlpoolsConfig.
program object containing services required to generate the instruction
SetConfigFeatureFlagParams object
StaticsetUpdates an adaptive fee tier account with a new default base fee rate. The new rate will not retroactively update initialized pools.
SetDefaultBaseFeeRateParams object
StaticsetSets the delegated fee authority for an AdaptiveFeeTier. Only the fee authority has permission to invoke this instruction.
SetDelegatedFeeAuthorityParams object
StaticsetSets the fee rate for a Whirlpool by the delegated fee authority. Only the current delegated fee authority has permission to invoke this instruction.
SetFeeRateByDelegatedFeeAuthorityParams object
StaticsetSets the initialize pool authority for an AdaptiveFeeTier. Only the fee authority has permission to invoke this instruction.
SetInitializePoolAuthorityParams object
StaticsetUpdates an adaptive fee tier account with new preset adaptive fee constants.
SetPresetAdaptiveFeeConstantsParams object
StaticcloseClose a bundled position in a Whirlpool.
InvalidBundleIndex - If the provided bundle index is out of bounds.
ClosePositionNotEmpty - The provided position account is not empty.
program object containing services required to generate the instruction
CloseBundledPositionParams object
StaticcloseClose a position in a Whirlpool. Burns the position token in the owner's wallet.
program object containing services required to generate the instruction
ClosePositionParams object
StaticcollectCollect fees accrued for this position. Call updateFeesAndRewards before this to update the position to the newest accrued values.
program object containing services required to generate the instruction
CollectFeesParams object
StaticcollectStaticcollectCollect protocol fees accrued in this Whirlpool.
program object containing services required to generate the instruction
CollectProtocolFeesParams object
StaticcollectStaticcollectCollect rewards accrued for this reward index in a position. Call updateFeesAndRewards before this to update the position to the newest accrued values.
program object containing services required to generate the instruction
CollectRewardParams object
StaticcollectStaticdecreaseRemove liquidity to a position in the Whirlpool. This call also updates the position's accrued fees and rewards.
LiquidityZero - Provided liquidity amount is zero.LiquidityTooHigh - Provided liquidity exceeds u128::max.TokenMinSubceeded - The required token to perform this operation subceeds the user defined amount.program object containing services required to generate the instruction
DecreaseLiquidityParams object
StaticdecreaseStaticdeleteDeletes a PositionBundle account.
PositionBundleNotDeletable - The provided position bundle has open positions.
program object containing services required to generate the instruction
DeletePositionBundleParams object
StaticdeleteStaticincreaseStaticincreaseAdd liquidity to a position in the Whirlpool. This call also updates the position's accrued fees and rewards.
LiquidityZero - Provided liquidity amount is zero.
LiquidityTooHigh - Provided liquidity exceeds u128::max.
TokenMaxExceeded - The required token to perform this operation exceeds the user defined amount.
program object containing services required to generate the instruction
IncreaseLiquidityParams object
StaticincreaseStaticinitStaticinitializeStaticinitializeInitializes a WhirlpoolsConfig account that hosts info & authorities required to govern a set of Whirlpools.
program object containing services required to generate the instruction
InitConfigParams object
StaticinitializeInitializes a fee tier account usable by Whirlpools in this WhirlpoolsConfig space.
Special Errors
FeeRateMaxExceeded - If the provided default_fee_rate exceeds MAX_FEE_RATE.
program object containing services required to generate the instruction
InitFeeTierParams object
StaticinitializeInitializes a tick_array account to represent a tick-range in a Whirlpool.
Special Errors
InvalidTokenMintOrder - The order of mints have to be ordered by
SqrtPriceOutOfBounds - provided initial_sqrt_price is not between 2^-64 to 2^64
program object containing services required to generate the instruction
InitPoolParams object
StaticinitializeStaticinitializeInitializes a PositionBundle account.
program object containing services required to generate the instruction
InitializePositionBundleParams object
StaticinitializeInitializes a PositionBundle account. Additional Metaplex metadata is appended to identify the token.
program object containing services required to generate the instruction
InitializePositionBundleParams object
StaticinitializeInitialize reward for a Whirlpool. A pool can only support up to a set number of rewards. The initial emissionsPerSecond is set to 0.
InvalidRewardIndex - If the provided reward index doesn't match the lowest uninitialized index in this pool,
or exceeds NUM_REWARDS, or all reward slots for this pool has been initialized.program object containing services required to generate the instruction
InitializeRewardParams object
StaticinitializeStaticinitializeStaticinitInitializes a TickArray account.
InvalidStartTick - if the provided start tick is out of bounds or is not a multiple of TICK_ARRAY_SIZE * tick spacing.
program object containing services required to generate the instruction
InitTickArrayParams object
StaticopenOpen a bundled position in a Whirlpool. No new tokens are issued because the owner of the position bundle becomes the owner of the position. The position will start off with 0 liquidity.
InvalidBundleIndex - If the provided bundle index is out of bounds.
InvalidTickIndex - If a provided tick is out of bounds, out of order or not a multiple of the tick-spacing in this pool.
program object containing services required to generate the instruction
OpenBundledPositionParams object
StaticopenOpen a position in a Whirlpool. A unique token will be minted to represent the position in the users wallet. The position will start off with 0 liquidity.
InvalidTickIndex - If a provided tick is out of bounds, out of order or not a multiple of the tick-spacing in this pool.
program object containing services required to generate the instruction
OpenPositionParams object
StaticopenOpen a position in a Whirlpool. A unique token will be minted to represent the position in the users wallet. Additional Metaplex metadata is appended to identify the token. The position will start off with 0 liquidity.
InvalidTickIndex - If a provided tick is out of bounds, out of order or not a multiple of the tick-spacing in this pool.
program object containing services required to generate the instruction
OpenPositionParams object and a derived PDA that hosts the position's metadata.
StaticopenOpen a position in a Whirlpool. A unique token will be minted to represent the position in the users wallet. Additional TokenMetadata extension is initialized to identify the token if requested. Mint and Token account are based on Token-2022. The position will start off with 0 liquidity.
InvalidTickIndex - If a provided tick is out of bounds, out of order or not a multiple of the tick-spacing in this pool.
program object containing services required to generate the instruction
OpenPositionWithTokenExtensionsParams object and a derived PDA that hosts the position's metadata.
StaticrepositionStaticresetReset a position's range. Requires liquidity to be zero.
InvalidTickIndex - If a provided tick is out of bounds, out of order or not a multiple of the tick-spacing in this pool.
ClosePositionNotEmpty - The provided position account is not empty.
SameTickRangeNotAllowed - The provided tick range is the same as the current tick range.
program object containing services required to generate the instruction
ResetPositionRangeParams object
StaticsetSets the fee authority to collect protocol fees for a WhirlpoolsConfig. Only the current collect protocol fee authority has permission to invoke this instruction.
program object containing services required to generate the instruction
SetCollectProtocolFeesAuthorityParams object
StaticsetStaticsetUpdates a fee tier account with a new default fee rate. The new rate will not retroactively update initialized pools.
FeeRateMaxExceeded - If the provided default_fee_rate exceeds MAX_FEE_RATE.program object containing services required to generate the instruction
SetDefaultFeeRateParams object
StaticsetUpdates a WhirlpoolsConfig with a new default protocol fee rate. The new rate will not retroactively update initialized pools.
ProtocolFeeRateMaxExceeded - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE.program object containing services required to generate the instruction
SetDefaultFeeRateParams object
StaticsetSets the fee authority for a WhirlpoolsConfig. The fee authority can set the fee & protocol fee rate for individual pools or set the default fee rate for newly minted pools. Only the current fee authority has permission to invoke this instruction.
program object containing services required to generate the instruction
SetFeeAuthorityParams object
StaticsetSets the fee rate for a Whirlpool. Only the current fee authority has permission to invoke this instruction.
FeeRateMaxExceeded - If the provided fee_rate exceeds MAX_FEE_RATE.program object containing services required to generate the instruction
SetFeeRateParams object
StaticsetSets the protocol fee rate for a Whirlpool. Only the current fee authority has permission to invoke this instruction.
ProtocolFeeRateMaxExceeded - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE.program object containing services required to generate the instruction
SetFeeRateParams object
StaticsetSet the whirlpool reward authority at the provided reward_index.
Only the current reward super authority has permission to invoke this instruction.
InvalidRewardIndex - If the provided reward index doesn't match the lowest uninitialized index in this pool,
or exceeds NUM_REWARDS.program object containing services required to generate the instruction
SetRewardAuthorityParams object
StaticsetSet the whirlpool reward authority at the provided reward_index.
Only the current reward authority for this reward index has permission to invoke this instruction.
InvalidRewardIndex - If the provided reward index doesn't match the lowest uninitialized index in this pool,
or exceeds NUM_REWARDS.program object containing services required to generate the instruction
SetRewardAuthorityParams object
StaticsetSet the reward emissions for a reward in a Whirlpool.
RewardVaultAmountInsufficient - The amount of rewards in the reward vault cannot emit more than a day of desired emissions.InvalidTimestamp - Provided timestamp is not in order with the previous timestamp.InvalidRewardIndex - If the provided reward index doesn't match the lowest uninitialized index in this pool,
or exceeds NUM_REWARDS.program object containing services required to generate the instruction
SetRewardEmissionsParams object
StaticsetSet the whirlpool reward super authority for a WhirlpoolsConfig
Only the current reward super authority has permission to invoke this instruction.
This instruction will not change the authority on any WhirlpoolRewardInfo whirlpool rewards.
program object containing services required to generate the instruction
SetRewardEmissionsSuperAuthorityParams object
StaticsetStaticsetStaticsetStaticswapPerform a swap in this Whirlpool
ZeroTradableAmount - User provided parameter amount is 0.InvalidSqrtPriceLimitDirection - User provided parameter sqrt_price_limit does not match the direction of the trade.SqrtPriceOutOfBounds - User provided parameter sqrt_price_limit is over Whirlppool's max/min bounds for sqrt-price.InvalidTickArraySequence - User provided tick-arrays are not in sequential order required to proceed in this trade direction.TickArraySequenceInvalidIndex - The swap loop attempted to access an invalid array index during the query of the next initialized tick.TickArrayIndexOutofBounds - The swap loop attempted to access an invalid array index during tick crossing.LiquidityOverflow - Liquidity value overflowed 128bits during tick crossing.InvalidTickSpacing - The swap pool was initialized with tick-spacing of 0.AmountCalcOverflow - The required token amount exceeds the u64 range.AmountRemainingOverflow - Result does not match the specified amount.DifferentWhirlpoolTickArrayAccount - The provided tick array account does not belong to the whirlpool.PartialFillError - Partially filled when sqrtPriceLimit = 0 and amountSpecifiedIsInput = false.program object containing services required to generate the instruction
StaticswapStatictransferTransfer a position in a Whirlpool.
program object containing services required to generate the instruction
TransferPositionParams object
StatictwoPerform a two-hop-swap in this Whirlpool
ZeroTradableAmount - User provided parameter amount is 0.InvalidSqrtPriceLimitDirection - User provided parameter sqrt_price_limit does not match the direction of the trade.SqrtPriceOutOfBounds - User provided parameter sqrt_price_limit is over Whirlppool's max/min bounds for sqrt-price.InvalidTickArraySequence - User provided tick-arrays are not in sequential order required to proceed in this trade direction.TickArraySequenceInvalidIndex - The swap loop attempted to access an invalid array index during the query of the next initialized tick.TickArrayIndexOutofBounds - The swap loop attempted to access an invalid array index during tick crossing.LiquidityOverflow - Liquidity value overflowed 128bits during tick crossing.InvalidTickSpacing - The swap pool was initialized with tick-spacing of 0.DuplicateTwoHopPool - Swaps on the same pool are not allowed.InvalidIntermediaryMint - The first and second leg of the hops do not share a common token.AmountCalcOverflow - The required token amount exceeds the u64 range.AmountRemainingOverflow - Result does not match the specified amount.DifferentWhirlpoolTickArrayAccount - The provided tick array account does not belong to the whirlpool.PartialFillError - Partially filled when sqrtPriceLimit = 0 and amountSpecifiedIsInput = false.IntermediateTokenAmountMismatch - The amount of tokens received from the first hop does not match the amount sent to the second hop.program object containing services required to generate the instruction
TwoHopSwapParams object
StatictwoStaticupdateUpdate the accrued fees and rewards for a position.
TickNotFound - Provided tick array account does not contain the tick for this position.
LiquidityZero - Position has zero liquidity and therefore already has the most updated fees and reward values.
program object containing services required to generate the instruction
UpdateFeesAndRewardsParams object
Instruction builders for the Whirlpools program.