Close 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
Close 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
Collect 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
Collect protocol fees accrued in this Whirlpool.
program object containing services required to generate the instruction
CollectProtocolFeesParams object
Collect 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
Remove 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
Deletes a PositionBundle account.
PositionBundleNotDeletable
- The provided position bundle has open positions.
program object containing services required to generate the instruction
DeletePositionBundleParams object
Add 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
Initializes 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
Initializes 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
Initializes 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
Initializes 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
Initializes a PositionBundle account.
program object containing services required to generate the instruction
InitializePositionBundleParams object
Initializes a PositionBundle account. Additional Metaplex metadata is appended to identify the token.
program object containing services required to generate the instruction
InitializePositionBundleParams object
Initialize 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
Open 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
Open 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
Open 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.
Sets 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
Updates 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
Updates 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
Sets 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
Sets 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
Sets 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
Set 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
Set 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
Set 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
Set 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
Perform 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.program object containing services required to generate the instruction
Perform 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.program object containing services required to generate the instruction
TwoHopSwapParams object
Update 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
Generated using TypeDoc
Instruction builders for the Whirlpools program.