Skip to main content

Error code format

Each error code is a 6-digit number composed of two parts:
PartDescription
Error domainIdentifies the stage where the error occurred
Specific error codeDescribes the exact failure reason
The final error code is formed by concatenating both parts and converting them to a number. Example If a requested token pair is not supported:
  • Error domain: 002
  • Specific error code: 001
  • Final error code: 2001
Errors are always tied to a specific stage of the API flow, such as:
  • quote calculation
  • swap execution
  • smart contract interaction

Error domains

DomainCodeDescription
PARAMS_ERRORS001Request validation and input parameters
CALCULATION_ERRORS002Route discovery and quote calculation
SWAP_ERRORS003Swap execution
RUBIC_CONTRACT_ERRORS004Rubic smart contracts
UNKNOWN_ERRORS999Unexpected or unknown errors

Params errors (001)

Errors related to invalid or missing request parameters.
CodeNameDescription
001REQUIRED_RECEIVERReceiver address is required
002EQUAL_TOKENSSource and destination tokens are the same
003DIFFERENT_QUOTESQuote data mismatch
004MISS_IDRequired identifier is missing
005NO_REQUIRED_FIELDOne or more required fields are missing
006NOT_CORRECT_WALLET_ADDRESSInvalid wallet address
999WRONG_OR_MISSED_FIELDInvalid or malformed field

Calculation errors (002)

Errors occurring during route discovery or quote calculation.
CodeNameDescription
001NO_ROUTESNo routes found for the provided parameters
002BLOCKCHAIN_TEMPORARILY_DOWNBlockchain is temporarily unavailable
003PROVIDER_RATE_LIMITProvider rate limit exceeded
004MAX_AMOUNTAmount exceeds provider limits
005MIN_AMOUNTAmount below provider limits
006MAX_DECIMALSToken decimals exceed allowed limit
007NO_AUTH_WALLETWallet authorization is required
999UNKNOWNUnknown calculation error

Swap execution errors (003)

Errors occurring during swap execution.
CodeNameDescription
001NEED_APPROVEERC20 approval is required
002NEED_PERMIT2_APPROVEPermit2 approval is required
003NOT_ENOUGH_BALANCEInsufficient token balance
004NOT_ENOUGH_NATIVE_BALANCEInsufficient native currency for fees
005SIMULATION_FAILEDTransaction simulation failed
006UNSUPPORTED_RECEIVERReceiver address is not supported
007NO_DATAExecution data is missing
100WRONG_ARB_BRIDGE_HASHInvalid Arbitrum bridge transaction hash
999UNKNOWNUnknown swap execution error

Rubic contract errors (004)

Errors related to Rubic smart contract configuration.
CodeNameDescription
001NO_DIRECT_ROUTESNo direct routes available
002NO_SELECTORRequired function selector not found
003NO_CONTRACTContract not deployed or unavailable
004UNLISTEDContract or token is not listed

Error response formats

The API may return errors in different formats depending on the error domain.

Validation errors (PARAMS_ERRORS)

Validation errors may contain multiple issues in a single response.
FieldDescription
codeError code
reasonHuman-readable error description
Example:
  • Invalid sender address
  • Invalid receiver address

Standard error response

All errors except validation errors follow a unified response structure.
FieldDescription
error.codeNumeric error code
error.reasonHuman-readable error description
error.dataOptional additional error details
idSwap or execution identifier
The id field can be used to track the swap or retrieve its status if execution was partially completed.

Common error examples

No routes available

FieldValue
code2001
reasonNo routes found. Try to use other tokens

Approval required

Returned when the user does not have enough allowance for a required spender.
FieldValue
code3001
reasonNot enough allowance for spender address
data.contractAddressSpender contract address

Insufficient native balance (EVM)

FieldDescription
code3004
reasonNot enough native currency to pay transaction fees
data.gasLimitEstimated gas limit
data.gasPriceEstimated gas price
data.valueTransaction value

Insufficient native balance (TON)

FieldDescription
code3004
reasonNot enough native currency to pay network fees
data.gasEstimated gas amount
data.valueTransaction value

Notes

  • Not all errors include the data field
  • Error lists may expand as the API evolves
  • Refund handling depends on the selected provider
  • Some providers (for example, Celer) require manual refund actions via a dedicated endpoint or support