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
}0—InvalidOrderStatus— Order is not in a valid state for this operation. Check the order's status before interacting.1—InvalidAmount— Amount is zero or exceeds the remaining balance.2—InvalidMaker— Maker public key does not match the order.3—InvalidMint— Token mint does not match the order's input or output mint.4—InvalidPrice— Price parameters are invalid (e.g. zeroprice_base).5—InvalidTokenAccountAuthority— Token account authority does not match the expected owner.6—InvalidTokenProgramId— Wrong token program passed for the mint. Use SPL Token for SPL mints, SPL Token-2022 for Token-2022 mints.7—InvalidAssociatedTokenAccountAddress— ATA address does not match the expected derivation.8—InvalidExtension— Token extension is not supported by the program.9—EventDeserializationError— Failed to deserialize event data.10—ExpirationSlotExceeded— Order has expired. Cannot be filled after theexpiration_slot.11—ExecutionTimeInForceViolation— Take violates the order's time-in-force policy. For example, attempting a partial fill on anAllOrNothingorder.12—MaxCostLimitExceeded— Cost exceeds the taker'smax_cost_amount. Increase the limit or reduce the take amount.13—OrderNotExpired— Attempted to close an order that has not yet expired. Wait untilexpiration_slotis reached.
Related pages
Limit Orders Overview — Order structure, time-in-force, order status
Placing Taker Orders — TakeOrder instruction and execution code
Limit Order Events — Event structure and parsing from program logs
Last updated

