Skip to Content
Program ReferenceOverview & Error Codes

Program Reference

Instruction Discriminator Table

Each instruction is identified by the first byte of its instruction data. There is no Anchor-style hash prefix — just a raw u8 at index 0.

Disc (hex)Disc (dec)InstructionSection
0x000InitializeCore
0x011DepositCore
0x022WithdrawCore
0x033BorrowCore
0x044RepayCore
0x055LiquidateCore
0x066FlashBorrowFlash Loans
0x077FlashRepayFlash Loans
0x088EnablePrivacyPrivacy
0x099PrivateDepositPrivacy
0x0A10PrivateBorrowPrivacy
0x0B11PrivateRepayPrivacy
0x0C12PrivateWithdrawPrivacy
0x0D13UpdatePoolOracle & Admin
0x0E14PausePoolOracle & Admin
0x0F15ResumePoolOracle & Admin
0x1016CollectFeesOracle & Admin
0x1117IkaRegisterIka
0x1218IkaReleaseIka
0x1319IkaSignIka
0x1420UpdateOraclePriceOracle & Admin

Account Discriminators

AccountDiscriminator (ASCII)Bytes
LendingPoolVEILPOOL[86, 69, 73, 76, 80, 79, 79, 76]
UserPositionVEILPOS![86, 69, 73, 76, 80, 79, 83, 33]
EncryptedPositionVEILENC![86, 69, 73, 76, 69, 78, 67, 33]
IkaDwalletPositionVEILIKA![86, 69, 73, 76, 73, 75, 65, 33]

Error Codes

All errors are emitted as ProgramError::Custom(code).

CodeNameDescription
6000MissingSignatureCaller is not a signer when required
6001AccountNotWritableAccount is not writable when required
6002InvalidAccountOwnerAccount owner is not this program
6003InvalidDiscriminatorAccount discriminator does not match
6004InvalidPdaPDA derivation mismatch
6005InvalidInstructionDataInstruction data is malformed
6006ZeroAmountAmount is zero
6007InsufficientLiquidityPool has insufficient liquidity
6008ExceedsCollateralFactorBorrow would exceed the LTV cap
6009UndercollateralisedHealth factor is below 1.0
6010PositionHealthyLiquidation attempted on healthy position
6011ExceedsCloseFactorLiquidation repay exceeds close-factor cap
6012ExceedsDepositBalanceWithdraw amount exceeds deposited balance
6013ExceedsDebtBalanceRepay amount exceeds outstanding debt
6014NoBorrowNo debt to repay or liquidate
6015MathOverflowArithmetic overflow in calculation
6016TransferFailedToken transfer failed
6017InvalidTimestampTimestamp went backwards
6018FlashLoanActiveFlash loan already in progress
6019FlashLoanNotActiveFlashRepay called with no active flash loan
6020FlashLoanRepayInsufficientRepayment amount is less than borrowed + fee
6021UnauthorizedSigner is not the pool authority
6022PoolPausedPool is paused — deposits and borrows blocked
6023NoFeesToCollectNo accumulated fees to collect
6024OracleInvalidPyth account has bad magic, type, or negative price
6025OraclePriceStalePyth aggregate status is not Trading
6026OraclePriceFeedMismatchFeed address does not match the anchored feed
6027OracleConfTooWideConfidence interval exceeds 2 % of price

Data Conventions

  • All integers are little-endian
  • Rates are WAD-scaled (WAD = 1_000_000_000_000_000_000, i.e. 1e18). A rate of 5% is stored as 50_000_000_000_000_000.
  • Prices from Pyth are raw with exponent. USD value = oracle_price × 10^oracle_expo.
  • Timestamps are Unix seconds (i64).
Last updated on