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) | Instruction | Section |
|---|---|---|---|
0x00 | 0 | Initialize | Core |
0x01 | 1 | Deposit | Core |
0x02 | 2 | Withdraw | Core |
0x03 | 3 | Borrow | Core |
0x04 | 4 | Repay | Core |
0x05 | 5 | Liquidate | Core |
0x06 | 6 | FlashBorrow | Flash Loans |
0x07 | 7 | FlashRepay | Flash Loans |
0x08 | 8 | EnablePrivacy | Privacy |
0x09 | 9 | PrivateDeposit | Privacy |
0x0A | 10 | PrivateBorrow | Privacy |
0x0B | 11 | PrivateRepay | Privacy |
0x0C | 12 | PrivateWithdraw | Privacy |
0x0D | 13 | UpdatePool | Oracle & Admin |
0x0E | 14 | PausePool | Oracle & Admin |
0x0F | 15 | ResumePool | Oracle & Admin |
0x10 | 16 | CollectFees | Oracle & Admin |
0x11 | 17 | IkaRegister | Ika |
0x12 | 18 | IkaRelease | Ika |
0x13 | 19 | IkaSign | Ika |
0x14 | 20 | UpdateOraclePrice | Oracle & Admin |
Account Discriminators
| Account | Discriminator (ASCII) | Bytes |
|---|---|---|
LendingPool | VEILPOOL | [86, 69, 73, 76, 80, 79, 79, 76] |
UserPosition | VEILPOS! | [86, 69, 73, 76, 80, 79, 83, 33] |
EncryptedPosition | VEILENC! | [86, 69, 73, 76, 69, 78, 67, 33] |
IkaDwalletPosition | VEILIKA! | [86, 69, 73, 76, 73, 75, 65, 33] |
Error Codes
All errors are emitted as ProgramError::Custom(code).
| Code | Name | Description |
|---|---|---|
| 6000 | MissingSignature | Caller is not a signer when required |
| 6001 | AccountNotWritable | Account is not writable when required |
| 6002 | InvalidAccountOwner | Account owner is not this program |
| 6003 | InvalidDiscriminator | Account discriminator does not match |
| 6004 | InvalidPda | PDA derivation mismatch |
| 6005 | InvalidInstructionData | Instruction data is malformed |
| 6006 | ZeroAmount | Amount is zero |
| 6007 | InsufficientLiquidity | Pool has insufficient liquidity |
| 6008 | ExceedsCollateralFactor | Borrow would exceed the LTV cap |
| 6009 | Undercollateralised | Health factor is below 1.0 |
| 6010 | PositionHealthy | Liquidation attempted on healthy position |
| 6011 | ExceedsCloseFactor | Liquidation repay exceeds close-factor cap |
| 6012 | ExceedsDepositBalance | Withdraw amount exceeds deposited balance |
| 6013 | ExceedsDebtBalance | Repay amount exceeds outstanding debt |
| 6014 | NoBorrow | No debt to repay or liquidate |
| 6015 | MathOverflow | Arithmetic overflow in calculation |
| 6016 | TransferFailed | Token transfer failed |
| 6017 | InvalidTimestamp | Timestamp went backwards |
| 6018 | FlashLoanActive | Flash loan already in progress |
| 6019 | FlashLoanNotActive | FlashRepay called with no active flash loan |
| 6020 | FlashLoanRepayInsufficient | Repayment amount is less than borrowed + fee |
| 6021 | Unauthorized | Signer is not the pool authority |
| 6022 | PoolPaused | Pool is paused — deposits and borrows blocked |
| 6023 | NoFeesToCollect | No accumulated fees to collect |
| 6024 | OracleInvalid | Pyth account has bad magic, type, or negative price |
| 6025 | OraclePriceStale | Pyth aggregate status is not Trading |
| 6026 | OraclePriceFeedMismatch | Feed address does not match the anchored feed |
| 6027 | OracleConfTooWide | Confidence 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 as50_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