Skip to Content
Stacks Pools

Error Codes

This page lists the error codes used by the Zest Protocol concentrated liquidity contracts. A call that fails with one of these codes reverts as a whole, and no tokens move.

Error Code Ranges

RangeContractDescription
u1-u4clmm-lp-token-v1Share transfer errors
u1000-u1008clmm-pool-v1Authorization and pool state
u1000-u1002executor-daoProposal execution
u2000-u2013clmm-pool-v1Inputs, positions, swaps and limits
u3002-u3007clmm-pool-v1Arithmetic bounds and transfer checks
u4000-u4005operatorsMultisig approvals
u5001-u5004clmm-router-v1Route results

Several contracts use u1000 for “not authorized”; the contract that returned the error tells them apart.

Pool Errors (u1000-u1008)

CodeNameDescription
u1000ERR-NOT-AUTHORIZEDCaller is not governance, or a withdrawal was not called directly by the owner
u1001ERR-POOL-PAUSEDThe pool is paused. Swaps and deposits are stopped; withdrawals still work.
u1002ERR-POOL-SUNSETThe pool is sunset. Deposits are stopped; swaps and withdrawals still work.
u1003ERR-POOL-NOT-FOUNDNo pool with this id
u1004ERR-INVALID-PAIRA pool’s two tokens must differ
u1005ERR-TOKEN-LISTEDA token’s native STX flag cannot change once a pool uses it
u1006ERR-NOT-DEPOSITOROnly a private pool’s depositor can add liquidity
u1007ERR-PRIVATE-POOLPrivate pools take no partner discounts
u1008ERR-PUBLIC-POOLA public pool has no depositor to move

Input, Position and Swap Errors (u2000-u2013)

CodeNameDescription
u2000ERR-POOL-ALREADY-EXISTSA public pool already exists for this pair and bin step, in either token order
u2001ERR-INVALID-PRICEThe bin price after a deposit falls outside the deposit’s price bounds. Re-quote the deposit.
u2002ERR-INVALID-TOKEN-TRAITThe token contracts passed are not the pool’s token X and token Y
u2003ERR-INVALID-BIN-STEPBin step must be u100, u500, u1000 or u2000
u2004ERR-PERCENT-GREATER-THAN-ONEA percentage, LP fee share or discount is above 100%
u2005ERR-ZERO-PERCENTThe withdrawal would burn zero shares
u2006ERR-INVALID-AMOUNTA deposit must add some X or some Y
u2007ERR-POSITION-NOT-FOUNDThe bin has never held liquidity
u2008ERR-PERCENT-GREATER-THAN-OR-EQUALS-ONEA fee rate must be below 100%
u2009ERR-SLIPPAGEOutput or shares fell below the minimum in the transaction. Request a fresh quote.
u2010ERR-NOT-FILLEDA route that does not allow partial fills could not spend the whole input
u2011ERR-INVALID-ROUTERoute ticks are not strictly ascending (X to Y) or strictly descending (Y to X)
u2012ERR-FEE-TOO-HIGHA pool’s fee rate cannot exceed 10%
u2013ERR-EXPIREDThe deadline passed before the transaction was mined. Request a fresh quote.

Arithmetic and Transfer Errors (u3002-u3007)

CodeNameDescription
u3002ERR-INVALID-LP-STATEThe deposit would mint zero shares
u3003ERR-MAX-POOLS-ALLOWEDThe pool contract has reached its maximum number of pools
u3004ERR-TICK-OUT-OF-RANGEThe tick is outside the bin step’s usable range
u3005ERR-AMOUNT-TOO-LARGEAn amount, or a bin’s reserve after the trade, exceeds the bin’s size bound (2¹¹⁸ base units, scaled)
u3006ERR-MATH-OVERFLOWAn intermediate result does not fit
u3007ERR-TRANSFER-MISMATCHSafety invariant: a transfer moved a different amount than requested

Router Errors (u5001-u5004)

The router maps the pool’s route errors onto its own codes. Other pool errors pass through unchanged.

CodeNamePool codeDescription
u5001ERR-INSUFFICIENT-LIQUIDITYu2010The bins could not take the whole input (fill-or-kill or a full route)
u5002ERR-SLIPPAGEu2009Output fell below the minimum. Request a fresh quote.
u5003ERR-INVALID-ROUTEu2011Tick order is wrong, or the token path and hops do not match
u5004ERR-EXPIREDu2013The deadline passed. Request a fresh quote.

LP Token Errors (u1-u4, u1000)

CodeNameDescription
u1ERR-INSUFFICIENT-BALANCEThe sender does not hold enough shares of this bin
u2ERR-SAME-PRINCIPALSender and recipient are the same
u3ERR-ZERO-AMOUNTTransfer amount cannot be zero
u4ERR-INVALID-SENDERThe sender must be the immediate caller
u1000ERR-NOT-AUTHORIZEDTransfers are disabled, or only the pool may mint and burn

Governance Errors

executor-dao

CodeNameDescription
u1000ERR-UNAUTHORISEDCaller is not the DAO or an enabled extension
u1001ERR-ALREADY-EXECUTEDThe proposal has already been executed
u1002ERR-INVALID-EXTENSIONAn extension callback came from a contract that is not an enabled extension

operators

CodeNameDescription
u4000ERR-NOT-AUTHORIZEDCaller is not the DAO or an enabled extension
u4001ERR-NOT-OPERATORCaller is not an operator
u4002ERR-ALREADY-APPROVEDThis operator has already approved the proposal
u4003ERR-ALREADY-EXECUTEDThe proposal has already been executed
u4004ERR-EXPIREDThe approval window for the proposal has closed
u4005ERR-INVALID-THRESHOLDThe threshold must be at least 1 and at most the number of operators

Debugging Tips

  1. Deadline and slippage errors (u2009, u2013, u5002, u5004) are the most common failures. All four mean a protection fired. Nothing is lost; request a fresh quote and try again.
  2. u2001 on a deposit means the bin traded before the deposit confirmed. Re-quote and set price bounds from the new state.
  3. u1000 on a withdrawal means the owner did not call the pool directly. Call reduce-position or reduce-positions from the wallet that holds the shares, or from inside the holding contract’s as-contract?.
  4. u3007 should never occur with a supported token. The code means the pool refused a transfer that did not reconcile exactly. If one occurs, contact support with the transaction ID.
Last updated on