Errors and rejection behavior
Treat unsupported capabilities as explicit failures and inspect the offending input.
Use symbolic errors from the matching build. Numeric Anchor error assignments are not presented as a stable deployed API.
Core validation
| Error family | Check |
|---|---|
InvalidMintOrder | Distinct mint keys in canonical byte order |
InvalidTickSpacing, InvalidRange, InvalidPrice | Domain, alignment, endpoint order, fixed-point units |
InvalidFee, InvalidFeeSplit | Cap, denominators, unique beneficiaries, exact share sum |
UnsupportedPoolMode, UnsupportedHook | Whether the requested mode/profile exists |
InvalidHookTarget, InvalidHookAccounts | Configured executable, exact extra-account classes, owners, keys, and protected aliases |
InvalidHookPermission, InvalidHookContext | Per-phase privileges, declared programs, bounded accounts, and phase/intent/settlement consistency |
MissingHookResponse | Return data and actual producer program |
PoolEntered | Whether the operation attempts nested entry |
PositionNotEmpty | Remaining liquidity or fee claims before close |
SlippageExceeded | User limits against actual token amounts |
InvalidTickDirectory, InvalidTickArray | Canonical owner/PDA, spacing, layout, and ordered unique pages |
MissingTickArray, TickMissing | Required initialized page or boundary absent |
TickArrayCapacity, TickArrayLimit, TickTraversalLimit | Reserved record capacity, 16-page budget, and bounded traversal |
ArithmeticFailure, MathFailure | Width, overflow, underflow, and math-domain errors |
Source: programs/grapl-amm/src/errors.rs.
Hook replies
Malformed tags, unsupported versions, wrong phases, denied permission, invalid fee shape, and cap violations are errors. A failure must not become an implicit acknowledgement or default fee.
Source: programs/grapl-amm/src/hooks/abi/wire.rs and reply.rs.
Client errors
Amount utilities throw RangeError with the supplied value and expected shape. Validate decimal precision before serialization; do not cast a negative value into an unsigned representation.
If a quote is possible but a wallet is ineligible, that is an execution-policy failure, not proof that the route is safe. See troubleshooting.
Issuance, curves, and composition
InvalidTokenIssuance rejects invalid factory supply or final authority. InvalidCurve rejects invalid reserve plans, insufficient real backing, premature or repeated graduation, and unauthorized remainder collection. Swap and zap limits use SlippageExceeded; ExactOut does not turn a failed exact target into a partial success. Account substitutions and hook denials still use the generic validation families above.