Skip to main content
Common issues and solutions when integrating with Custom Stablecoins swaps.

Common Errors

SwapsCannotBePaused

Error: Transaction reverts with SwapsCannotBePaused()Solution: Swaps are currently disabled on the contract. Wait for the PAUSE_ROLE holder to re-enable swaps.

TokenNotListed

Error: Transaction reverts with TokenNotListed(address)Solution: The token address you provided is not listed on the contract. Verify the token address against the Key Addresses page.

TokenMustBeSwappable

Error: Transaction reverts with TokenMustBeSwappable(address)Solution: The token is listed but currently disabled for swapping. Wait for the PAUSE_ROLE holder to re-enable the token.

SlippageExceeded

Error: Transaction reverts with SlippageExceeded()Solution: The output amount after fees and decimal normalization is less than your minAmountOut. Increase your slippage tolerance or re-read the current feeBasisPoints() value and recalculate.

AmountOutExceedsAvailableLiquidity

Error: Transaction reverts with AmountOutExceedsAvailableLiquidity(amountOut, availableLiquidity)Solution: Reduce your swap amount. The contract doesn’t have enough output token liquidity (after accounting for reserved amounts) to fulfill the swap.

AddressNotInAllowlist

Error: Transaction reverts with AddressNotInAllowlist(address)Solution: The allowlist feature is enabled and your wallet address is not allowlisted. Contact support to be added.

CannotSwapSameToken

Error: Transaction reverts with CannotSwapSameToken(address)Solution: You specified the same token address for both tokenIn and tokenOut. Use two different token addresses.

ERC-20 approval errors

Error: Transaction reverts during transferFrom with no descriptive errorSolution: You need to approve the Stableswapper contract to spend your input tokens before calling swap(). Call approve() on the input token contract first:
const token = new ethers.Contract(tokenAddress, ERC20_ABI, signer);
await token.approve(STABLESWAPPER_ADDRESS, amountIn);

Insufficient gas

Error: Transaction fails with insufficient funds for gasSolution: You need Base Sepolia ETH for gas fees. Get testnet ETH from CDP Faucet.

Production Readiness

Helper functions for validation

Examples

More swap code examples

Reference

Swap instruction parameters

Quickstart

Back to quickstart guide