📄️ Error Overview
This section provides a comprehensive reference for all protocol-level errors emitted by the on-chain program, including:
📄️ General Errors (0–19)
This category contains foundational protocol errors that are not tied to a specific subsystem.
📄️ Authorization Errors (20–39)
These errors occur when a signer, authority, or keeper does not meet required permission constraints.
📄️ Order Errors (40–79)
These errors relate to order lifecycle, trading pair validation, and order parameter constraints.
📄️ Limit Order Errors (80–99)
These errors apply specifically to limit order lifecycle and trigger validation.
📄️ Price & Oracle Errors (100–119)
These errors occur during price resolution, oracle validation, and slippage checks.
📄️ Liquidity & Pool Errors (120–159)
These errors occur during pool initialization, liquidity provision, withdrawals, and order matching.
📄️ Risk Management Errors (160–179)
These errors enforce margin safety, leverage limits, and liquidation logic.
📄️ Fee & Funding Errors (180–199)
These errors relate to funding calculations, fee configuration, and migration logic.
📄️ Configuration Errors (200–219)
These errors relate to system configuration, keeper management, and trading pair setup.
📄️ Transfer & Token Errors (220–239)
These errors occur during SPL token validation and transfer operations.
📄️ System Errors (240–279)
These errors relate to global protocol state, feature flags, batch operations, and high-level system controls.
📄️ OrderBook Errors (280–299)
These errors apply to order book account management and internal order indexing logic.
📄️ Deal & State Errors (300–349)
These errors relate to deal lifecycle, position state management, and trigger logic.
📄️ Trading & Validation Errors (350–379)
These errors occur during trade execution, trigger validation, escrow checks, and final settlement validation.
📄️ Complete Error Map
This mapping combines all error ranges into a single lookup object.
📄️ Error Usage Examples
Basic Error Handling
📄️ Common Error Scenarios
---