Skip to main content

Pool & Factory

Pool and Factory error codes are defined in Errors.sol contract. The errors are designated by two digit numbers and are formatted as such:

SWAAP#XY

Where X and Y are two integers

CodeErrorDescription
00REENTRY
01NOT_FINALIZEDPool parameters are not finalized (LPs cannot join or exit the pool)
02NOT_BOUNDToken is not in the pool
03NOT_CONTROLLER
04IS_FINALIZED
05MATH_APPROX
06NOT_FACTORY
07FACTORY_CONTROL_REVOKED
08LIMIT_INThe token amount in needed exceeds the user-supplied limit
09LIMIT_OUTThe token amount out is below the user-supplied limit
10SWAP_NOT_PUBLIC
11BAD_LIMIT_PRICEThe swap's initial spot price exceeds the user-supplied limit
12NOT_ADMIN
13NULL_CONTROLLER
14MIN_FEE
15MAX_FEE
16NON_POSITIVE_PRICEThe oracle returned an illegal non-positive price
17NOT_POOL
18MIN_TOKENS
19INSUFFICIENT_BALANCEInsufficient Pool Token balance
20NOT_PENDING_SWAAPLABS
21INSUFFICIENT_ALLOWANCE
22MIN_HORIZON
23MAX_HORIZON
24MIN_LB_PERIODS
25MAX_LB_PERIODS
26MIN_LB_SECS
28IS_BOUNDThe token is already in the pool
29MAX_TOKENS
30MIN_WEIGHT
31MAX_WEIGHT
32MIN_BALANCE
33MAX_TOTAL_WEIGHT
34NOT_SWAAPLABS
35NULL_ADDRESS
36PAUSED_FACTORYThe swaps and liquidity provision has been paused by Swaap's protocol
37X_OUT_OF_BOUNDS
38Y_OUT_OF_BOUNDS
39POW_BASE_TOO_LOW
40POW_BASE_TOO_HIGH
41PRODUCT_OUT_OF_BOUNDS
42INVALID_EXPONENT
43OUT_OF_BOUNDS
44MAX_PRICE_UNPEG_RATIOThe pool is too imbalanced after the swap (i.e. the spot price and oracle price are diverging more than it is authorized). This could happen when performing too large trades.
45PAUSE_WINDOW_EXCEEDED
47NOT_PENDING_CONTROLLER
48EXCEEDED_ORACLE_TIMEOUTThe oracle price feed is not up-to-date
49NEGATIVE_PRICEThe oracle returned an illegal negative price
50BINDED_TOKENS
51PENDING_NEW_CONTROLLER
52UNEXPECTED_BALANCEThe pool's token balance does not correspond to the internal state balance of the pool after a trade. This could happen if there are fees on the ERC20 transfers.
53MIN_LB_STEP_PERIODS
54INPUT_LENGTH_MISMATCHThe number of token limits is different than the number of tokens in the pool
55MIN_MAX_PRICE_UNPEG_RATIO
56MAX_MAX_PRICE_UNPEG_RATIO
57MAX_IN_RATIOThe amount of token in exceeds the allowed limit
58MAX_OUT_RATIOThe amount of token out exceeds the allowed limit

Proxy

Proxy error codes are defined in Proxy.sol contract. The errors are designated by two digit numbers and are formatted as such:

PROOXY#XY
CodeErrorDescription
00REENTRY
01PASSED_DEADLINEThe transaction is not mined within the specified deadline
02LIMIT_INThe token amount in needed exceeds the user-supplied limit
03LIMIT_OUTThe token amount out is below the user-supplied limit
04BAD_LIMIT_INThe msg.value is different than the input limit
05NEGATIVE_PRICEThe oracle returned an illegal negative price
06FAILED_CALLAn external call to an aggregator failed
07NOT_SWAAPLABS
08NOT_PENDING_SWAAPLABS
09PAUSED_PROXYThe proxy's functionalities are paused by the swaap protocol