Pool

The following table outlines potential errors that may occur during interactions with the pool contract in GnoSwap:

Code
Error
Description

GNOSWAP-POOL-001

Caller has no permission

Occurs when a user without the necessary permissions attempts an action that requires authorization.

GNOSWAP-POOL-002

Not registered token

Occurs when an operation references a token that has not been registered within the pool.

GNOSWAP-POOL-003

Already registered token

Occurs when there is an attempt to register a token that is already registered in the pool.

GNOSWAP-POOL-004

Can't transfer token while locked

Occurs when a user attempts to transfer tokens that are currently locked and unavailable for transfer.

GNOSWAP-POOL-005

Out of range for numeric value

Occurs when a numeric input exceeds the allowed range for liquidity or token amounts

GNOSWAP-POOL-006

Invalid input data

Occurs when input data does not meet the expected format or parameters, making the operation invalid.

GNOSWAP-POOL-007

Invalid position key

Occurs when an invalid or non-existent position key is referenced in an operation.

GNOSWAP-POOL-008

Requsted data not found

Occurs when the system is unable to locate the requested data for the operation, such as a specific pool or liquidity position.

GNOSWAP-POOL-009

Invalid liquidity calculated

Occurs when the calculated liquidity value is incorrect, possibly due to invalid inputs or calculation errors.

GNOSWAP-POOL-010

Zero liquidity

Occurs when an operation that requires positive liquidity is attempted with zero liquidity.

GNOSWAP-POOL-011

Same token used in single pool

Occurs when the same token is used twice in a single pool, which is invalid in a pool configuration.

GNOSWAP-POOL-012

Tokens must be in lexicographic order

Occurs when the tokens provided are not in the expected lexicographic order, which is required for pool consistency.

GNOSWAP-POOL-013

Pool already created

Occurs when there is an attempt to create a pool that already exists with the same token pair and fee tier.

GNOSWAP-POOL-014

Invalid swap amount

Occurs when the swap amount provided is invalid, such as a negative value or an amount that exceeds available liquidity.

GNOSWAP-POOL-015

Invalid protocol fee percentage

Occurs when an invalid protocol fee percentage is provided, such as a value outside the acceptable range.

GNOSWAP-POOL-016

Invalid withdrawal fee percentage

Occurs when the withdrawal fee percentage is outside the allowed range or is otherwise invalid.

GNOSWAP-POOL-017

Can't swap while pool is locked

Occurs when a user attempts to perform a swap operation while the pool is locked, making swaps temporarily unavailable.

GNOSWAP-POOL-018

Swap price is out of range

Occurs when the specified swap price falls outside the acceptable range defined by the pool’s parameters.

GNOSWAP-POOL-019

Not enough balance to transfer

Occurs when a user attempts to transfer more tokens than they currently have in their balance.

GNOSWAP-POOL-020

Negative value expected

Occurs when a negative value is required or expected for the operation, but a non-negative value is provided.

GNOSWAP-POOL-021

Token transfer failed

Occurs when a token transfer fails due to issues such as insufficient gas, network issues, or restrictions on the token itself.

GNOSWAP-POOL-022

Invalid tick and tick spacing requested

Occurs when an invalid tick value or tick spacing is provided, which does not align with the pool's tick configuration requirements.

Last updated