Error Handling
Understanding the error handling in the Staking Program.
Error Handling
The program defines comprehensive error types:
| Error Name | Description |
|---|---|
VaultMismatch | The provided vault account does not match the pool vault. |
InsufficientStakeBalance | Insufficient staked amount or vault balance for this unstake operation. |
ArithmeticError | Arithmetic operation failed (overflow, underflow, or conversion error). |
AprUnchanged | The provided APR is identical to the current APR. |
InvalidStakeMint | The provided stake mint does not match the config stake mint. |
InvalidRewardMint | The provided reward mint does not match the config reward mint. |
UnauthorizedUser | The signer is not the owner of this stake account. |
Overflow | Arithmetic overflow or underflow occurred. |
MintDecimalsTooHigh | The provided mint decimals are too high. Maximum allowed is 12. |
InvalidTimestamp | Timestamp cannot be earlier than the last interest index update. |
ZeroStakeAmount | Stake amount must be greater than zero. |
StakeAccountNotEmpty | Cannot close stake account with non-zero staked amount. |
UnclaimedRewards | Cannot close stake account with unclaimed pending rewards. |
ConfigPoolMismatch | The stake pool's config does not match the provided config account. |
StakePoolMismatch | The provided stake pool does not match the stake account's pool. |
InvalidAprBps | The provided APR (in basis points) is invalid. |
VaultNotEmpty | The vault account is not empty. |
Last updated on