Skip to main content
This page documents all error codes that can be returned by the Kamino Lending protocol. Each error includes its message and context about when it occurs.

Authority & Permission Errors

Errors related to account ownership, permissions, and authorization.
ErrorMessageDescription
InvalidMarketAuthorityMarket authority is invalidThe market authority account does not match the expected authority
InvalidMarketOwnerMarket owner is invalidThe market owner account does not match the expected owner
InvalidAccountOwnerInput account owner is not the program addressAn account is not owned by the Kamino Lending program
InvalidSignerSigner is not allowed to perform this actionThe transaction signer lacks permission for this operation
InvalidObligationOwnerObligation owner is invalidThe obligation owner does not match the expected owner
ReferrerStateOwnerMismatchReferrer state owner does not match the given signerThe referrer state account owner mismatch
ObligationOwnersMustMatchObligation owners must matchMultiple obligations in transaction must have same owner

Validation Errors

Errors related to invalid inputs, configurations, or account states.
ErrorMessageDescription
InvalidAmountInput amount is invalidThe provided amount is zero, negative, or otherwise invalid
InvalidConfigInput config value is invalidConfiguration parameter is outside acceptable range
InvalidAccountInputInvalid account inputAn account provided to the instruction is invalid
InvalidOracleConfigInput oracle config is invalidOracle configuration parameters are invalid
InvalidFlagInvalid lending market configLending market configuration flag is invalid
InvalidBorrowRateCurvePointInvalid borrow rate curve pointBorrow rate curve configuration is invalid
InvalidUtilizationRateInvalid utilization rateUtilization rate is outside valid range [0, 1]
InvalidTwapConfigInvalid Twap configuration: Twap is enabled but one of the enabled price doesn’t have a twapTWAP validation requires all price sources to support TWAP
InvalidObligationSeedsValueSeeds must be default pubkeys for tag 0, and mint addresses for tag 1 or 2Obligation PDA seeds do not match requirements
DeprecatedInvalidObligationId[DEPRECATED] Obligation id must be 0Legacy error for deprecated obligation ID validation
InvalidOrderConfigurationGiven order configuration has wrong parametersOrder parameters are invalid or conflicting
OrderConfigurationNotSupportedByObligationGiven order configuration cannot be used with the current state of the obligationOrder type incompatible with current obligation state
NonUpdatableOrderConfigurationSome piece of the order’s configuration cannot be updated (the order should be cancelled and placed again)Certain order fields require cancellation and re-creation
InvalidTokenAccountStateToken account is in a state preventing the handler’s operation (e.g. frozen or delegate)Token account has delegate set or is frozen

Math & Overflow Errors

Errors related to mathematical operations and numeric conversions.
ErrorMessageDescription
MathOverflowMath operation overflowArithmetic operation resulted in overflow
IntegerOverflowConversion between integers failedInteger conversion would overflow or underflow

Oracle & Price Errors

Errors related to price feeds and oracle validation.
ErrorMessageDescription
SwitchboardV2ErrorSwitchboard errorError reading or validating Switchboard oracle data
CouldNotDeserializeScopeCannot deserialize the scope price accountScope oracle account data is malformed
PriceTooOldPrice too oldOracle price timestamp exceeds maximum staleness
PriceTooDivergentFromTwapPrice too divergent from twapCurrent price deviates too much from TWAP
InvalidTwapPriceInvalid twap priceTWAP calculation failed or returned invalid value
PriceNotValidPrice is not validOracle price failed validation checks
PriceIsBiggerThanHeuristicPrice is bigger than allowed by heuristicPrice exceeds heuristic upper bound
PriceIsLowerThanHeuristicPrice lower than allowed by heuristicPrice below heuristic lower bound
PriceIsZeroPrice is zeroOracle returned zero price
PriceConfidenceTooWidePrice confidence too wideOracle confidence interval too large
NoPriceFoundNo price foundNo valid price available from any oracle
InvalidPythPriceAccountPyth price account does not match configurationPyth account doesn’t match reserve config
InvalidSwitchboardAccountSwitchboard account(s) do not match configurationSwitchboard account doesn’t match reserve config
InvalidScopePriceAccountScope price account does not match configurationScope account doesn’t match reserve config

Reserve State Errors

Errors related to reserve accounts and their state.
ErrorMessageDescription
ReserveStaleReserve state needs to be refreshedReserve must be refreshed before this operation
InsufficientLiquidityInsufficient liquidity availableReserve has insufficient available liquidity
NoFarmForReserveThis reserve does not have a farmFarm operations attempted on reserve without farms
ReserveDeprecatedReserve was deprecated, no longer usableReserve marked as deprecated, no operations allowed
ReserveObsoleteReserve is marked as obsoleteReserve marked obsolete, limited operations only
ReserveTokenBalanceMismatchReserve state and token account cannot driftReserve accounting doesn’t match token balance
ReserveVaultBalanceMismatchReserve token account has been unexpectedly modifiedReserve vault balance changed unexpectedly
ReserveAccountingMismatchReserve internal state accounting has been unexpectedly modifiedReserve internal accounting inconsistency detected
ReserveHasNotReceivedInitialDepositReserve has not received the initial deposit, cannot update configInitial admin deposit required before config updates
InitialAdminDepositExecutedInitial admin deposit in reserve already executedCannot execute initial deposit twice
ReserveDebtMaturityReachedCannot borrow from a reserve that reached its debt maturity timestampReserve debt term has ended

Withdraw Errors

Errors related to withdrawal operations.
ErrorMessageDescription
WithdrawTooSmallWithdraw amount too smallWithdrawal amount below minimum threshold
WithdrawTooLargeWithdraw amount too largeWithdrawal exceeds available amount
WithdrawalCapReachedWithdrawal cap is reachedReserve withdrawal cap has been reached
MaximumWithdrawValueZeroMaximum withdrawable value of this collateral is zero, LTV needs improvedCannot withdraw this collateral with current LTV
LowestLtvAssetsPriorityWithdrawing must prioritize the collateral with the lowest reserve max-LTVMust withdraw lowest-LTV collateral first

Borrow Errors

Errors related to borrowing operations.
ErrorMessageDescription
BorrowTooSmallBorrow amount too small to receive liquidity after feesBorrow amount insufficient after fees
BorrowTooLargeBorrow amount too large for deposited collateralBorrow would exceed collateral value
BorrowingDisabledBorrowing is disabledBorrowing globally disabled
BorrowLimitExceededCannot borrow above borrow limitReserve or elevation group borrow limit reached
BorrowingDisabledOutsideElevationGroupReserve does not accept any new borrows outside elevation groupBorrowing restricted to elevation group
BorrowingAboveUtilizationRateDisabledBorrowing above set utilization rate is disabledCannot borrow when utilization exceeds threshold

Repay Errors

Errors related to repayment operations.
ErrorMessageDescription
RepayTooSmallRepay amount too small to transfer liquidityRepayment amount too small
RepayTooSmallForFullLiquidationRepay amount is too small to satisfy the mandatory full liquidationFull liquidation requires higher repay amount
InsufficientRepayAmountLiquidator provided repay amount lower than required by liquidation rulesRepay amount below liquidation minimum

Liquidation Errors

Errors related to liquidation operations.
ErrorMessageDescription
LiquidationTooSmallLiquidation amount too small to receive collateralLiquidation amount below minimum
ObligationHealthyCannot liquidate healthy obligationsObligation LTV is not unhealthy
LiquidationRewardTooSmallThe reward amount is less than the minimum acceptable received liquidityLiquidation reward below minimum acceptable
LiquidationBorrowFactorPriorityLiquidation must prioritize the debt with the highest borrow factorMust liquidate highest borrow factor debt first
LiquidationLowestLiquidationLtvPriorityLiquidation must prioritize the collateral with the lowest liquidation LTVMust liquidate lowest LTV collateral first
CollateralNonLiquidatableThis collateral cannot be liquidated (LTV set to 0)Collateral with 0% LTV cannot be liquidated

Obligation Errors

Errors related to obligation accounts and their state.
ErrorMessageDescription
ObligationStaleObligation state needs to be refreshedObligation must be refreshed before operation
ObligationReserveLimitObligation reserve limit exceededObligation has too many reserves
ObligationDepositsEmptyObligation deposits are emptyOperation requires deposits
ObligationBorrowsEmptyObligation borrows are emptyOperation requires borrows
ObligationDepositsZeroObligation deposits have zero valueDeposits exist but have zero value
ObligationBorrowsZeroObligation borrows have zero valueBorrows exist but have zero value
InvalidObligationCollateralInvalid obligation collateralCollateral account or state is invalid
InvalidObligationLiquidityInvalid obligation liquidityLiquidity account or state is invalid
ObligationCollateralEmptyObligation collateral is emptyOperation requires collateral
ObligationLiquidityEmptyObligation liquidity is emptyOperation requires liquidity/borrows
ObligationCollateralLtvZeroThe obligation has one collateral with an LTV set to 0. Withdraw it before withdrawing other collateralsMust withdraw 0% LTV collateral first
ObligationEmptyObligation has no borrows or depositsObligation is completely empty
ObligationInObsoleteReserveObligation has a deposit or borrow in an obsolete reserveCannot operate on obligation with obsolete reserves
ObligationCurrentlyMarkedForDeleveragingObligation is already marked for deleveragingObligation in deleveraging state
ZeroMaxLtvAssetsInDepositsNo max LTV 0 assets allowed in deposits for repay and withdrawCannot have 0% LTV assets for this operation
ObligationCollateralExceedsElevationGroupLimitObligation have more collateral than the maximum allowed by the elevation groupToo many collateral reserves for elevation group
ObligationElevationGroupMultipleDebtReserveObligation is an elevation group but have more than one debt reserveElevation group obligations can only have one debt
ObligationsMustMatchObligations must matchMultiple obligation accounts must be identical

Deposit & Withdrawal Limit Errors

Errors related to deposit and withdrawal limits.
ErrorMessageDescription
DepositLimitExceededCannot deposit above deposit limitReserve deposit limit reached
DepositDisabledOutsideElevationGroupCan’t deposit into this reserve outside elevation groupDeposits restricted to elevation group

Flash Loan Errors

Errors related to flash loan operations.
ErrorMessageDescription
FlashBorrowCpiNo cpi flash borrows allowedFlash borrows via CPI not permitted
NoFlashRepayFoundNo corresponding repay found for flash borrowFlash borrow missing matching repay
InvalidFlashRepayInvalid repay foundFlash repay validation failed
FlashRepayCpiNo cpi flash repays allowedFlash repays via CPI not permitted
MultipleFlashBorrowsMultiple flash borrows not allowed in the same transactionOnly one flash borrow per transaction
FlashLoansDisabledFlash loans are disabled for this reserveReserve does not allow flash loans

Elevation Group Errors

Errors related to elevation group functionality.
ErrorMessageDescription
IsolatedAssetTierViolationIsolated Asset Tier ViolationOperation violates isolated asset tier rules
InconsistentElevationGroupThe obligation’s elevation group and the reserve’s are not the sameElevation group mismatch
InvalidElevationGroupThe elevation group chosen for the reserve does not exist in the lending marketNon-existent elevation group
InvalidElevationGroupConfigThe elevation group updated has wrong parameters setInvalid elevation group configuration
UnhealthyElevationGroupLtvThe current obligation must have most or all its debt repaid before changing the elevation groupLTV too high for elevation group change
ElevationGroupNewLoansDisabledElevation group does not accept any new loans or any new borrows/withdrawalsElevation group closed to new activity
ElevationGroupAlreadyActivatedObligation already part of the same elevation groupCannot join already-active elevation group
ElevationGroupBorrowLimitExceededElevation group borrow limit exceededElevation group borrow cap reached
ElevationGroupWithoutDebtReserveThe elevation group does not have a debt reserve definedElevation group missing debt reserve
ElevationGroupMaxCollateralReserveZeroThe elevation group does not allow any collateral reservesElevation group doesn’t accept collateral
ElevationGroupHasAnotherDebtReserveIn elevation group attempt to borrow from a reserve that is not the debt reserveCan only borrow from designated debt reserve
ElevationGroupDebtReserveAsCollateralThe elevation group’s debt reserve cannot be used as a collateral reserveDebt reserve cannot be collateral

Referrer Errors

Errors related to the referrer system.
ErrorMessageDescription
ReferrerAccountNotInitializedReferrer account not initializedReferrer account doesn’t exist
ReferrerAccountMintMissmatchReferrer account mint does not match the operation reserve mintReferrer account mint mismatch
ReferrerAccountWrongAddressReferrer account address is not a valid program addressInvalid referrer account PDA
ReferrerAccountReferrerMissmatchReferrer account referrer does not match the owner referrerReferrer mismatch
ReferrerAccountMissingReferrer account missing for obligation with referrerObligation has referrer but account missing
InsufficientReferralFeesToRedeemInsufficient referral fees to claim or no liquidity availableNot enough referral fees to claim
ShortUrlNotAsciiAlphanumericReferrer short_url is not ascii alphanumericShort URL contains invalid characters

Fee & Protocol Errors

Errors related to fees and protocol operations.
ErrorMessageDescription
InsufficientProtocolFeesToRedeemInsufficient protocol fees to claim or no liquidity availableNot enough protocol fees or liquidity
CannotSocializeObligationWithCollateralObligation hasn’t been fully liquidated and debt cannot be socializedCannot socialize debt with remaining collateral

Interest Rate Errors

Errors related to interest rate calculations.
ErrorMessageDescription
NegativeInterestRateInterest rate is negativeCalculated interest rate is negative

Emergency Mode Errors

Errors related to emergency mode functionality.
ErrorMessageDescription
GlobalEmergencyModeEmergency mode is enabledMarket in emergency mode, operations restricted

Instruction & CPI Errors

Errors related to instruction execution and cross-program invocations.
ErrorMessageDescription
IncorrectInstructionInPositionWrong instruction at expected positionInstruction ordering validation failed
CpiDisabledCPI disabled for this instructionCross-program invocation not allowed
TransactionIncludesRestrictedProgramsTransaction includes restricted programsTransaction contains forbidden programs

Timestamp Errors

Errors related to timestamp validation.
ErrorMessageDescription
LastTimestampGreaterThanCurrentThe last interval start timestamp is greater than the current timestampInvalid timestamp ordering
CannotCalculateReferralAmountDueToSlotsMismatchCannot calculate referral amount due to slots mismatchSlot mismatch prevents referral calculation

LTV & Risk Errors

Errors related to loan-to-value ratios and risk management.
ErrorMessageDescription
NetValueRemainingTooSmallNet value remaining too smallNet value too low after operation
WorseLtvBlockedCannot get the obligation in a worse positionOperation would worsen LTV
LiabilitiesBiggerThanAssetsCannot have more liabilities than assets in a positionLiabilities exceed assets
WorseLtvThanUnhealthyLtvCannot get the obligation liquidatableOperation would make obligation liquidatable

User Metadata Errors

Errors related to user metadata accounts.
ErrorMessageDescription
UserMetadataOwnerAlreadySetUser metadata owner is already setCannot change user metadata owner

Market & Configuration Errors

Errors related to market configuration and updates.
ErrorMessageDescription
OperationNotPermittedMarketImmutableCannot update lending market because it is set as immutableMarket marked immutable
LendingMarketsMustMatchLending markets must matchMultiple markets in transaction must match
NoUpgradeAuthorityCannot initialize global config because there is no upgrade authority to the programProgram missing upgrade authority

Order & Trading Errors

Errors related to borrow orders and order execution.
ErrorMessageDescription
OrderIndexOutOfBoundsObligation order of the given index cannot existOrder index exceeds bounds
OperationNotPermittedWithCurrentObligationOrdersSingle debt, single collateral obligation orders have to be cancelled before changing the deposit/borrow countCancel orders before changing reserves
OrderCreationDisabledCreation of new orders is disabledCannot create new orders
BorrowOrderDebtLiquidityMintMismatchThere is no borrow order requesting debt in the given assetBorrow order mint doesn’t match
BorrowOrderMaxBorrowRateExceededReserve used for fill exceeds the maximum borrow rate specified by the orderBorrow rate too high for order
BorrowOrderMinDebtTermInsufficientReserve used for fill defines a debt term shorter than specified by the orderDebt term too short for order
BorrowOrderFillTimeLimitExceededBorrow order can no longer be filledOrder fill deadline passed
BorrowOrderExecutionDisabledExecution of borrow orders is disabledCannot execute borrow orders
BorrowOrderFillValueTooSmallAvailable liquidity could not satisfy the minimum required borrow order fill valueInsufficient liquidity for order fill
DebtReachedReserveDebtTermCannot increase the debt that has reached its end of term configured by the reserveDebt term ended, cannot increase
ExpectationNotMetThe on-chain state does not meet expectation specified by the caller, so the operation must be aborted (to avoid race conditions)State changed, operation aborted

Token & Account Errors

Errors related to token accounts and SPL token operations.
ErrorMessageDescription
UnsupportedTokenExtensionMint has a token (2022) extension that is not supportedToken-2022 extension not supported
InvalidTokenAccountCan’t have an spl token mint with a t22 accountSPL token mint with Token-2022 account
CTokenUsageBlockedCToken minting/redeeming is blocked for this reservecToken operations disabled
CannotUseSameReserveCannot call ix with same reserveInstruction requires different reserves
UserTokenBalanceMismatchThe user’s token account has changed its balance in an unexpected wayUser token balance changed unexpectedly

Withdraw Ticket Errors

Errors related to the withdraw ticket system for queued withdrawals.
ErrorMessageDescription
WithdrawTicketIssuanceDisabledIssuing new withdraw tickets is disabled by the marketCannot create new withdraw tickets
WithdrawTicketRedemptionDisabledRedeeming withdraw tickets is disabled by the marketCannot redeem withdraw tickets
WithdrawTicketStillValidRecovering collateral is only available after the withdraw ticket has been marked invalidTicket still valid, cannot recover
WithdrawTicketRequiresFullRedemptionThe withdraw ticket’s current state requires that it is fully redeemed (e.g. due to owner ATA creation), but there is not enough liquidityMust fully redeem ticket but insufficient liquidity
WithdrawQueuedLiquidityValueTooSmallAvailable liquidity could not satisfy the minimum required ticketed withdrawal valueInsufficient liquidity for queued withdrawal
WithdrawTicketInvalidCannot use ticket that was already marked invalidTicket marked invalid

Troubleshooting Tips

Common Error Scenarios

Stale State Errors (ReserveStale, ObligationStale)
  • Call refresh_reserve before reserve operations
  • Call refresh_obligation before obligation operations
  • These are required before most state-changing operations
Insufficient Liquidity Errors
  • Check reserve available liquidity before borrow/withdraw
  • Consider using withdrawal queue for large withdrawals
  • May need to wait for repayments to free up liquidity
Oracle/Price Errors
  • Ensure oracle accounts match reserve configuration
  • Check price staleness and update frequency
  • Verify confidence intervals are acceptable
LTV Errors (BorrowTooLarge, WithdrawTooLarge)
  • Check current obligation LTV after refresh
  • Account for price movements affecting collateral value
  • Consider depositing more collateral before borrowing
Elevation Group Errors
  • Verify obligation and reserve elevation groups match
  • Check elevation group configuration and limits
  • Ensure elevation group accepts new loans
Order Errors
  • Verify order configuration parameters
  • Check fill time limits haven’t expired
  • Ensure sufficient liquidity for order execution

Error Handling Best Practices

  1. Always refresh state - Call refresh instructions before operations
  2. Check limits - Verify borrow/deposit limits before operations
  3. Handle race conditions - Use ExpectationNotMet to detect state changes
  4. Validate oracles - Ensure oracle accounts match configuration
  5. Monitor elevation groups - Verify elevation group compatibility
  6. Test with small amounts - Start with minimum amounts to validate operations

Getting Help

If you encounter an error you cannot resolve:
  1. Check the error message and this reference
  2. Verify all account inputs match expected configuration
  3. Ensure state is refreshed before operations
  4. Review the integration guides for proper usage
  5. Consult the program reference for detailed instruction requirements

Build docs developers (and LLMs) love