For the complete documentation index, see llms.txt. This page is also available as Markdown.

Error Codes

Custom error codes thrown by the Titan Limit Order program.

These are the custom error codes thrown by the Titan Limit Order program. Each maps to a specific on-chain validation failure.

#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum LimitOrderError {
    InvalidOrderStatus,                   // 0
    InvalidAmount,                        // 1
    InvalidMaker,                         // 2
    InvalidMint,                          // 3
    InvalidPrice,                         // 4
    InvalidTokenAccountAuthority,         // 5
    InvalidTokenProgramId,                // 6
    InvalidAssociatedTokenAccountAddress, // 7
    InvalidExtension,                     // 8
    EventDeserializationError,            // 9
    ExpirationSlotExceeded,               // 10
    ExecutionTimeInForceViolation,        // 11
    MaxCostLimitExceeded,                 // 12
    OrderNotExpired,                      // 13
}
  • 0InvalidOrderStatus — Order is not in a valid state for this operation. Check the order's status before interacting.

  • 1InvalidAmount — Amount is zero or exceeds the remaining balance.

  • 2InvalidMaker — Maker public key does not match the order.

  • 3InvalidMint — Token mint does not match the order's input or output mint.

  • 4InvalidPrice — Price parameters are invalid (e.g. zero price_base).

  • 5InvalidTokenAccountAuthority — Token account authority does not match the expected owner.

  • 6InvalidTokenProgramId — Wrong token program passed for the mint. Use SPL Token for SPL mints, SPL Token-2022 for Token-2022 mints.

  • 7InvalidAssociatedTokenAccountAddress — ATA address does not match the expected derivation.

  • 8InvalidExtension — Token extension is not supported by the program.

  • 9EventDeserializationError — Failed to deserialize event data.

  • 10ExpirationSlotExceeded — Order has expired. Cannot be filled after the expiration_slot.

  • 11ExecutionTimeInForceViolation — Take violates the order's time-in-force policy. For example, attempting a partial fill on an AllOrNothing order.

  • 12MaxCostLimitExceeded — Cost exceeds the taker's max_cost_amount. Increase the limit or reduce the take amount.

  • 13OrderNotExpired — Attempted to close an order that has not yet expired. Wait until expiration_slot is reached.


Last updated