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

Error Handling

tradePAMM and getQuote revert on failure. There is no HTTP error envelope on this path.

Swap and quote reverts

Error
Meaning

DirectSwapDisabled

directSwapEnabled is off for the pair, or the pair has no engine assigned. A quote may still succeed if an engine exists.

InvalidNativePool

Pool not whitelisted on this router.

QuoteExpired

deadlineTimestamp passed.

PriceExpired

The engine price is no longer valid. V2 engines expire by block number (validUntil); V1 engines expire by timestamp. Re-quote and retry.

PriceOutsideAllowedRange

Fill is below amountOutMinimum (the engine's slippage check). Widen slippage, reduce size, or re-quote.

InsufficientDepth

Size larger than remaining ladder/curve.

BelowMinimumTradeSize

Under minBaseInputRaw / minQuoteInputRaw, or the net amount rounds to zero.

UnsupportedPair

The sell/buy tokens are not this engine's baseAsset() / quoteAsset().

InvalidPrice / ZeroAmountOut

Zero input amount, or the quote resolves to zero output.

InsufficientVaultCash

Quote-time only. The treasury does not hold enough of the buy token to pay the output.

PositionLimitExceeded

The pair's inventory cap would be exceeded. Try a smaller size or the opposite direction.

ZeroInput

Router rejected the call: zero recipient, sellerToken == buyerToken, or zero amount.

UnexpectedMsgValue

msg.value > 0 while selling an ERC-20. Send msg.value = 0.

InvalidAmount

Selling native and msg.value != sellerTokenAmount, or the received amount differs from the requested amount (for example a fee-on-transfer token).

EnforcedPause

The router is paused.

Selling native with sellerToken = address(0) but msg.value = 0 is treated as an ERC-20 sell and fails with an unnamed token-transfer revert. Always send msg.value = sellerTokenAmount when selling native.

NotEnoughAmountOut is raised on the RFQ path (tradeRFQT), not on direct pAMM swaps. InvalidEngine is raised only by admin calls that configure an engine.

Last updated