Epicentral LabsEpicentral Labs

Error Handling

Understanding the error handling in the Staking Program.

Edit on GitHub

Error Handling

The program defines comprehensive error types:

Error NameDescription
VaultMismatchThe provided vault account does not match the pool vault.
InsufficientStakeBalanceInsufficient staked amount or vault balance for this unstake operation.
ArithmeticErrorArithmetic operation failed (overflow, underflow, or conversion error).
AprUnchangedThe provided APR is identical to the current APR.
InvalidStakeMintThe provided stake mint does not match the config stake mint.
InvalidRewardMintThe provided reward mint does not match the config reward mint.
UnauthorizedUserThe signer is not the owner of this stake account.
OverflowArithmetic overflow or underflow occurred.
MintDecimalsTooHighThe provided mint decimals are too high. Maximum allowed is 12.
InvalidTimestampTimestamp cannot be earlier than the last interest index update.
ZeroStakeAmountStake amount must be greater than zero.
StakeAccountNotEmptyCannot close stake account with non-zero staked amount.
UnclaimedRewardsCannot close stake account with unclaimed pending rewards.
ConfigPoolMismatchThe stake pool's config does not match the provided config account.
StakePoolMismatchThe provided stake pool does not match the stake account's pool.
InvalidAprBpsThe provided APR (in basis points) is invalid.
VaultNotEmptyThe vault account is not empty.

Last updated on

On this page