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.

CodeDescription
NotAdminUnauthorized user attempts to invoke an admin-only message.
NotFeeReceiverUnauthorized user attempts to withdraw protocol fee.
PoolAlreadyExistAttempted creation of a pool with the same tokens (order does not matter) and the same fee tier that already exists.
PoolNotFoundUnable to retrieve the state of the specified pool.
TickAlreadyExistAttempted to create a tick that already exists.
InvalidTickIndexOrTickSpacingAttempt to create a tick with an out-of-bounds index or incorrect spacing.
PositionNotFoundUnable to retrieve the state of the specified position.
TickNotFoundUnable to retrieve the state of the specified tick.
FeeTierNotFoundUnable to retrieve the state of the specified fee tier.
PoolKeyNotFoundUnable to retrieve the state of the specified pool key.
AmountIsZeroAttempted swap with zero tokens on input or output, depending on swap direction.
WrongLimitAttempted swap with an incorrect price limit.
PriceLimitReachedSwap would exceed the specified limit.
NoGainSwapUser would receive zero tokens after the swap.
InvalidTickSpacingAttempted creation of a fee tier with incorrect tick spacing.
FeeTierAlreadyExistAttempted to create a fee tier that already exists.
PoolKeyAlreadyExistAttempted to create a pool key that already exists.
UnauthorizedFeeReceiverAttempted to claim fee without being a fee receiver.
ZeroLiquidityAttempted opening of a position with zero liquidity.
TransferErrorPSP22 token transfer could not be performed.
TokensAreSameAttempted creation of a pool with exactly the same tokens.
AmountUnderMinimumAmountOutSwap amount out will not fit into the next swap amount to achieve the specified amount out.
InvalidFeeAttempted to create a fee tier with a fee over 100%.
NotEmptyTickDeinitializationAttempted to remove a tick with liquidity on it.
InvalidInitTickAttempted to create a pool with invalid init tick.
InvalidInitSqrtPriceAttempted to create a pool with invalid init sqrt price.
SetCodeHashErrorUnable to set provided CodeHash
AddOverflow(u128, u128)Overflow while adding two provided numbers
SubUnderflow(u128, u128)Underflow while subtracting two provided numbers
MulOverflowOverflow while multiplying
DivByZeroAttempt to divide by zero
WAZEROWithdrawErrorError during wAZERO withdraw call
LiquidityChangeZeroAttempted to change liquidity by 0