Quote and execution consistency
Keep amounts, policy context, and account construction aligned across routing.
A router quote and its eventual transaction must describe the same operation. Shared pricing math helps, but consistency also depends on snapshot freshness, policy evaluation, identity, account order, and token settlement.
Freeze the inputs to the quote
Use one coherent pool, tick, and policy snapshot. Bind the direction, swap mode, amount, Clock, limits, and any explicit actor/proof context. When refreshing the pool, refresh the dependent accounts required by its hook and traversal.
A quoted actor is not signature evidence. The actual operation authority is established during execution and may be a router PDA. See wallet context.
Compare the right amounts
| Mode | Quote obligation | Execution protection |
|---|---|---|
| ExactIn | Actual consumed input and net received output | Minimum net output and price limit |
| ExactOut | Input needed to deliver the requested net output | Maximum input and price limit |
Include both the input trade fee and any configured output fee. Treat partial fills explicitly. Compare actual token debits and credits, rather than only an internal pricing return value.
Preserve hook behavior
The injected evaluator must reproduce the supported hook's decisions. Missing accounts, incompatible policy versions, unavailable identity context, and unsupported effects reject. The core library must never substitute a permissive no-hook quote for a hooked pool.
Sponsored reward quotes can evaluate public pricing without predicting wallet-specific reward bytes. Execution still binds recipient accounts and requires sponsor funding. Prepared or membership-bound policies need their required context. Read hook compatibility.
Construct the same account contract
Supply canonical visited tick pages and hook extras in the expected order, with exact signer and writable privileges. A router cannot manufacture a wallet signature or escalate a read-only outer account. The core rebuilds callback privileges within the pool's ceiling.
Measure the full transaction: tick pages, proof siblings, router accounts, external programs, and optional account creation all consume the available envelope. Address lookup tables can reduce address overhead; they do not compress proof bytes.
Observe confirmed settlement
Check transaction success and reconcile reserve deltas plus required hook effects. A failed after callback rolls back settlement. The core currently has no typed Anchor event schema, so callback logs alone are not a stable settlement feed.
The adapter contract does not establish public Jupiter routing availability. Public routing requires the provider's integration, discovery, account-packing, and admission process. See Metis integration.