For the complete documentation index, see llms.txt. This page is also available as Markdown.

Error codes

Contract error codes returned by the Aquarius AMM router and pools, and how to handle them.

When a contract call fails, the simulation (or transaction) reports a numeric error code, for example, Error(Contract, #2006). The codes below cover the errors an integrator is most likely to encounter.

Swap & liquidity guards

The errors you should expect and handle in normal operation:

Code
Name
When it happens
How to handle

2006

OutMinNotSatisfied

Exact-input swap: output fell below your out_min. Also raised on deposits (min_shares) and withdrawals (min_amounts)

Re-quote and retry; consider a wider slippage tolerance

2020

InMaxNotSatisfied

Exact-output swap: required input exceeds your max_in

Re-quote and retry

2005

InMinNotSatisfied

Exact-output swap at pool level: output below minimum

Re-quote and retry

2018

ZeroAmount

Zero passed as a swap/deposit amount

Validate input before calling

2019

InsufficientBalance

Account balance can't cover the transfer

Check balances before submitting

For multi-hop swaps (swap_chained), the slippage guard is enforced end-to-end — intermediate hops are unconstrained; only the final output is checked against out_min.

Routing & setup errors

Usually indicate a bug in the integration rather than market conditions:

Code
Name
When it happens
How to handle

301

PoolNotFound

No pool exists for the given tokens + pool hash

Re-discover pools via get_pools(tokens)

302

BadFee

Fee tier not in the allowed set for the pool type

Use 10 / 30 / 100 bps (volatile & concentrated)

307

PathIsEmpty

swap_chained called with an empty swaps chain

Always pass the XDR from the Find Path API

2002

TokensNotSorted

Token vector not sorted by contract address

Sort with the order_token_ids helper

Pause states

Aquarius contracts have independent kill switches for emergency response. If operations are paused you'll see: 205 PoolDepositKilled, 206 PoolSwapKilled, 207 PoolClaimKilled (standard pools), or 2139 GaugesClaimKilled (concentrated pool incentives). These are not integration bugs — check Discord for status.

Concentrated-pool specific

Code
Name
When it happens

2121

InsufficientLiquidity

The swap exhausted all liquidity in the pool

API-level failures

The backend API signals differently — see Backend API: no route is HTTP 200 + success: false; invalid input is HTTP 400.

Parsing results: since Stellar protocol 23, transaction metadata uses version 4 (TransactionMetaV4). Code that reads meta.v3.soroban_meta directly will find None — use the version-aware pattern shown in the code examples, or meta.value().sorobanMeta() in JavaScript.

Last updated