Error Codes
Complete error reference โ all SDK and on-chain error codes, their causes, and how to fix them.
SDK Error Codes
These are thrown as VaeaError instances in the SDK. Access via err.code.
| Code | Cause | Fix | Retried? |
|---|---|---|---|
INSUFFICIENT_LIQUIDITY | No protocol has enough liquidity | Try smaller amount or different token | โ |
TOKEN_NOT_SUPPORTED | Token not in VAEA registry | Check supported tokens page | โ |
SLIPPAGE_EXCEEDED | Swap price moved beyond tolerance | Increase slippageBps or retry later | โ |
FEE_TOO_HIGH | Fee exceeds your maxFeeBps | Increase limit or skip this opportunity | โ |
REPAY_FAILED | Token repay instruction failed | Ensure enough tokens to repay loan + fee | โ |
TX_EXPIRED | Blockhash expired before landing | Smart Retry handles this automatically | โ |
SOURCE_UNAVAILABLE | Source protocol is down or degraded | Wait or try different token | โ |
PROGRAM_PAUSED | VAEA program is paused by admin | Wait for unpause | โ |
INVALID_AMOUNT | Amount is zero or negative | Use a positive amount | โ |
INSUFFICIENT_SOL_FOR_FEE | Not enough SOL for gas + fee | Fund wallet with SOL | โ |
API_ERROR | VAEA API returned an error | Use executeLocal() to bypass API | โ |
NETWORK_ERROR | Cannot reach VAEA API | Check connectivity, use executeLocal() | โ |
On-Chain Errors (Anchor)
These errors come from the on-chain program. They appear as Custom(600X) in transaction logs.
| Code | Anchor ID | Message | Cause |
|---|---|---|---|
MissingEndFlash | 6000 | end_flash instruction missing from transaction | begin_flash was called but end_flash is not in the TX |
MissingBeginFlash | 6001 | begin_flash instruction missing from transaction | end_flash called without a matching begin_flash before it |
MissingRepay | 6002 | Source protocol repay instruction not found | Source protocol repay was expected but not found |
FeeMismatch | 6003 | Fee amount does not match expected fee from config | expected_fee_lamports is below the calculated minimum |
Paused | 6004 | Program is paused | Admin has paused the program via update_config |
ZeroAmount | 6005 | Amount must be greater than zero | Tried to borrow 0 tokens |
InsufficientSolForFee | 6006 | Insufficient SOL to pay the flash loan fee | Payer wallet too low to cover the fee transfer |
Unauthorized | 6007 | Caller is not the authorized authority | Admin-only instruction called by non-authority |
SlotExpired | 6008 | Transaction is too old (exceeded 150 slots) | TX sat in mempool too long |
InvalidSysvarInstructions | 6009 | Invalid Sysvar Instructions account | Wrong account passed as sysvar_instructions |