Skip to main content

Invariant Errors

This section outlines error codes essential for maintaining the integrity of Invariant operations. These codes provide insights into specific issues encountered during interactions with the platform.

CodeValueDescription
NotAdmin0Unauthorized user attempts to invoke an admin-only message.
InsufficientLiquidity1Not enough liquidity.
InvalidTickSpacing2Fails if the init tick is not divisible by the tick spacing.
InvalidTickSpacing801Fails if the init tick is not divisible by the tick spacing. Originated in CLAMM.
InvalidFee3Attempted to create a fee tier with a fee over 100%.
FeeTierNotFound4Unable to retrieve the state of the specified fee tier.
TokensAreSame5Fails if the user attempts to create a pool for the same tokens.
PoolKeyAlreadyExist6Attempted to create a pool key that already exists.
TickAndSqrtPriceMismatch7The init sqrt price is not related to the init tick.
NotFeeReceiver8Unauthorized user attempts to invoke a fee-receiver-only message.
InvalidTickLiquidity9The maximum liquidity on a single tick has been exceeded. You can try opening a position on a neighboring tick.
ZeroLiquidity10Position with zero liquidity cannot be created.
PriceLimitReached11Swap would exceed the specified limit.
InvalidProtocolFee12Attempted to set the protocol fee to over 100%.
ZeroAmount14Attempted swap with zero tokens on input or output, depending on swap direction.
WrongPriceLimit15Attempted swap with an incorrect price limit. Usually happens due to setting the wrong direction of the swap.
NoGainSwap16User would receive zero tokens after the swap.
FeeTierAlreadyExist18Attempted to create a fee tier that already exists.
PoolNotFound19Unable to retrieve the state of the specified pool.
PoolAlreadyExist20Attempted creation of a pool with the same tokens (order does not matter) and the same fee tier that already exists.
TickAlreadyExist21Attempted to create a tick that already exists.
InvalidTickIndex22Init tick is outside of the Min <= Init <= Max tick index range.
InvalidTickIndex800Init tick is outside of the Min <= Init <= Max tick index range. Originated in CLAMM.
TickAndTickSpacingMismatch23Fails if the init sqrt price is not related to the init tick.
TickLimitReached24The tick index has reached the global tick limit.
ChunkNotFound25Unable to retrieve the state of the specified chunk in tickmap.
InvalidTickmapBit26An illegal operation on a tickmap bit has been requested.
PositionNotFound27Unable to retrieve the state of the specified position.
FeeTierLimitReached28The maximal number of fee tiers (32) already exists.
SqrtPriceOutOfRange7001SqrtPrice not in the MinSqrtPrice <= sqrtPrice <= MaxSqrtPrice range.