# Error codes (/invest/advanced/error-codes)

When a vault transaction fails, your wallet or a block explorer shows an error. It usually appears as a number, such as `custom program error: 0x1785`, or as a name, such as `StaleValuation`. This page lets you look up both.

## How to read an error [#how-to-read-an-error]

**What.** The vault program is built with Anchor, a common Solana framework, and Anchor numbers a program's own errors from 6000 upward. The vault's errors are numbered in a fixed order. So the first one, `CreatorNotAllowed`, is 6000, and each next one is one higher. Explorers often show the number in hexadecimal (base 16, written with a `0x` prefix); the table below gives both forms.

**Why it matters.** Most failures are not problems with your funds. A failed transaction changes nothing on chain except the network fee. The error tells you whether to retry, wait, or change what you asked for.

**Example.** An explorer shows `custom program error: 0x1785`. To convert, multiply each hexadecimal digit by its power of 16: 0x1785 = 1 × 4,096 + 7 × 256 + 8 × 16 + 5 = 6,021. Error 6021 is `StaleValuation`: a leg needs refreshing. Retrying after a few seconds, once the app has refreshed the legs, usually works.

Errors from other programs (the SPL Token program, an adapter or a protocol) have their own numbers and names. Adapter errors appear inside the vault's transaction when the vault calls the adapter.

## The errors you are most likely to see [#the-errors-you-are-most-likely-to-see]

| Error | What it means | What to do |
| --- | --- | --- |
| `StaleValuation` | A leg was not valued recently enough (each vault sets the limit, at most about one minute). | Retry after the legs are refreshed. If it persists, a protocol may be down; see [A protocol stops working](/invest/incidents/protocol-outage). |
| `VaultNotActive` | The vault is not taking deposits, for example because it is in Recovery. | Check the vault's state on its page. |
| `VaultFrozen` | Senior has taken a loss, so withdrawals are paused. | Wait for recovery or settlement; see [When a protocol fails](/invest/incidents). |
| `CoverageViolation` | The action would leave too little or too much Junior. | Choose a smaller amount, or the other tranche. |
| `VaultCapExceeded` | The vault is full. | Deposit less, or wait for room. |
| `AmountTooSmall` | Below the vault's minimum deposit, or zero. | Increase the amount. |
| `MinSharesNotMet`, `BelowMinUsdcOut` | The price moved past the limit you set. | Review the new quote and retry. |
| `NotEligibleYet` | Your withdrawal's waiting period has not ended. | Wait until the eligible time shown in the app. |
| `InsufficientIdle` | Not enough cash in the vault right now. | Your request stays queued; it is funded when cash returns. |
| `OutflowLimitReached` | The vault's limit on how much Senior can take out in a 24-hour window is used up. | Your request stays queued for the next 24-hour window. |
| `Paused` | The guardian or admin paused this action. | Wait for an announcement. |
| `PendingClaim` | A queued exit needs re-valuing first. | Retry after a refresh. |

*Table: the errors a holder is most likely to meet, and the usual next step.*

## Full list [#full-list]

| Code | Hex | Name | Message |
| --- | --- | --- | --- |
| 6000 | `0x1770` | `CreatorNotAllowed` | Signer is not allowed to create vaults |
| 6001 | `0x1771` | `AdapterNotApproved` | Adapter program is not approved in the registry |
| 6002 | `0x1772` | `TooManyEntries` | List is full |
| 6003 | `0x1773` | `InvalidParams` | Invalid vault parameters |
| 6004 | `0x1774` | `InvalidLegParams` | Invalid leg parameters |
| 6005 | `0x1775` | `VaultNotDraft` | Vault must be in Draft state |
| 6006 | `0x1776` | `VaultNotActive` | Vault must be Active |
| 6007 | `0x1777` | `AccountsNotInitialized` | Vault token accounts are not initialized yet |
| 6008 | `0x1778` | `AccountsAlreadyInitialized` | Vault token accounts are already initialized |
| 6009 | `0x1779` | `TooManyLegs` | Vault already has the maximum number of legs |
| 6010 | `0x177a` | `InvalidBoundAccounts` | Leg-bound accounts are missing or too many |
| 6011 | `0x177b` | `LegAccountsMismatch` | Accounts passed for the leg do not match its bound account list |
| 6012 | `0x177c` | `LegListMismatch` | Leg accounts passed to activation are missing or out of order |
| 6013 | `0x177d` | `TargetsDoNotSumToFull` | Leg targets plus idle target must equal 100% |
| 6014 | `0x177e` | `SeedAlreadyProvided` | A Junior seed was already provided |
| 6015 | `0x177f` | `SeedTooSmall` | Junior seed is smaller than required |
| 6016 | `0x1780` | `AmountTooSmall` | Amount is below the minimum |
| 6017 | `0x1781` | `VaultCapExceeded` | Deposit would exceed the vault cap |
| 6018 | `0x1782` | `CoverageViolation` | Action would break the coverage limits |
| 6019 | `0x1783` | `MinSharesNotMet` | Fewer shares than the minimum requested |
| 6020 | `0x1784` | `ZeroShares` | Amount is too small to mint any shares |
| 6021 | `0x1785` | `StaleValuation` | A leg valuation is too old; refresh the legs first |
| 6022 | `0x1786` | `InvalidValuationReport` | Adapter returned a malformed valuation report |
| 6023 | `0x1787` | `AdapterFlagged` | Adapter flagged the leg as unsafe |
| 6024 | `0x1788` | `MissingReturnData` | Adapter did not return a valuation report |
| 6025 | `0x1789` | `UnauthorizedExecutor` | Signer is not the vault executor |
| 6026 | `0x178a` | `InsufficientIdle` | Not enough idle USDC |
| 6027 | `0x178b` | `IdleBelowMinimum` | Action would leave idle USDC below the minimum |
| 6028 | `0x178c` | `LegCapExceeded` | Action would exceed the leg cap |
| 6029 | `0x178d` | `LegWeightExceeded` | Action would exceed the leg maximum weight |
| 6030 | `0x178e` | `TransitBalanceMismatch` | Adapter did not move the exact USDC amount |
| 6031 | `0x178f` | `ValueIncreaseTooLow` | Leg value increased less than allowed by slippage |
| 6032 | `0x1790` | `WithdrawSlippageExceeded` | USDC received is below the allowed slippage |
| 6033 | `0x1791` | `NotEligibleYet` | Withdrawal request is not eligible yet |
| 6034 | `0x1792` | `AlreadyFunded` | Withdrawal request is already funded |
| 6035 | `0x1793` | `NotFunded` | Withdrawal request is not funded yet |
| 6036 | `0x1794` | `BelowMinUsdcOut` | Payout is below the requested minimum |
| 6037 | `0x1795` | `InvalidMint` | Token account has the wrong mint |
| 6038 | `0x1796` | `InvalidTokenOwner` | Token account has the wrong owner |
| 6039 | `0x1797` | `MathOverflow` | Math overflow |
| 6040 | `0x1798` | `PendingClaim` | A leg has an in-flight claim whose value is not fresh enough for this action |
| 6041 | `0x1799` | `InvalidCapabilities` | The selected action mode is not enabled for this leg |
| 6042 | `0x179a` | `InvalidActionReport` | The asynchronous adapter returned an invalid action report |
| 6043 | `0x179b` | `InvalidReturnAsset` | The action return account or mint does not match the configured custody |
| 6044 | `0x179c` | `PendingActionIncomplete` | The asynchronous action is not ready for final settlement |
| 6045 | `0x179d` | `InsufficientLegValue` | Requested asynchronous withdrawal exceeds the leg's recognised value |
| 6046 | `0x179e` | `NoPendingAction` | The leg has no pending action to re-value |
| 6047 | `0x179f` | `InvalidActionAccount` | The action account is missing, a signer, or one of the vault's or leg's own accounts |
| 6048 | `0x17a0` | `NotGuardian` | Only the guardian or the admin can do this |
| 6049 | `0x17a1` | `NotPendingAdmin` | Only the proposed admin can accept |
| 6050 | `0x17a2` | `Paused` | This part of the vault is paused |
| 6051 | `0x17a3` | `InvalidPauseScope` | Invalid pause scope |
| 6052 | `0x17a4` | `LimitNotLower` | Guardian changes can only lower a limit |
| 6053 | `0x17a5` | `LegCloseOnly` | The leg is close-only and takes no new money |
| 6054 | `0x17a6` | `AdapterPinMismatch` | The adapter was upgraded or the wrong ProgramData account was passed |
| 6055 | `0x17a7` | `VaultFrozen` | Senior has taken a loss: withdrawals are paused until recovery or settlement |
| 6056 | `0x17a8` | `NotInRecovery` | The vault is not in Recovery |
| 6057 | `0x17a9` | `RecoveryNotFinished` | Every impaired leg must be retired and Senior restored first |
| 6058 | `0x17aa` | `LegNotEmpty` | The leg still holds value or has an action in flight |
| 6059 | `0x17ab` | `NotInSettlement` | The vault is not in Settlement |
| 6060 | `0x17ac` | `NothingToClaim` | Nothing to claim |
| 6061 | `0x17ad` | `TimelockNotElapsed` | The change's delay has not passed yet |
| 6062 | `0x17ae` | `ChangeExpired` | The change was not executed in time |
| 6063 | `0x17af` | `ChangeMismatch` | The queued change does not match this action |
| 6064 | `0x17b0` | `MustQueueChange` | Once a vault is active this change must be queued |
| 6065 | `0x17b1` | `OutflowLimitReached` | Today's Senior outflow limit is used up; the request stays queued |
| 6066 | `0x17b2` | `NotTopLevel` | Instruction must be called directly in the transaction, not through CPI |
| 6067 | `0x17b3` | `MissingEndTrade` | begin_trade must be followed by end_trade for the same leg, with no other vault instruction in between |
| 6068 | `0x17b4` | `TradeOpen` | A trade is open; no other vault instruction may run until end_trade |
| 6069 | `0x17b5` | `NoOpenTrade` | No trade is open for this leg |
| 6070 | `0x17b6` | `TradeTooLarge` | Trade is larger than the leg's max_trade_usdc |
| 6071 | `0x17b7` | `TokenAccountNotBound` | Token account is not bound to the leg's adapter |
| 6072 | `0x17b8` | `TradeExceedsPosition` | Exit amount exceeds the leg's token balance |
| 6073 | `0x17b9` | `TokenLegNeedsTrade` | Token legs move only through begin_trade / end_trade, not allocate or deallocate |
| 6074 | `0x17ba` | `CostBudgetExceeded` | Trade cost would exceed the vault's rolling 7-day cost budget |
| 6075 | `0x17bb` | `InvalidCostBudget` | Invalid cost budget |
| 6076 | `0x17bc` | `NotATokenLeg` | The leg is not a token leg |
| 6077 | `0x17bd` | `LegStressed` | The leg's market trades outside its band: it is neither bought nor sold until it is back |
| 6078 | `0x17be` | `NotPendingAuthority` | Signer is not the proposed protocol authority |
| 6079 | `0x17bf` | `LegSuspended` | The leg is suspended: it takes no new money until the guardian or admin lifts the suspension |
| 6080 | `0x17c0` | `InvalidLegMode` | Only an active or close-only leg can be suspended, and only a suspended leg resumed |
| 6081 | `0x17c1` | `MarkNotHigher` | A raised mark must be above the leg's current mark |

*Table: all 82 vault program errors with their code and the message the program returns.*

## Advanced details [#advanced-details]

- If a new error is ever inserted in the middle of the list, every later code shifts. Match on the name from the program's IDL rather than on the number when you write tooling.
- `RecoveryNotFinished`'s message says impaired legs must be retired. An impaired leg can also have its impairment lifted by a queued `RaiseMark` change instead of being retired.
