Skip to main content

Routing and Quotes

A robust router evaluates executable routes rather than choosing a pool by TVL alone. The largest pool is not always the best price, and the best quoted price is not always executable.

Mainnet routing contracts

Route classQuoterExecution router
Basic stable and volatile poolsUse the compatible views for the basic router0x2F0E010edC989bB4Dc3BFaF07750480bC16285d4
Slipstream concentrated pools0xeE7DA209878f5748E18058C6C007B6Cd85ab451b0xb17125089BcAEf75f7C06d4b578ec624982CB2a8
Mixed basic and Slipstream routes0x5354231C96Df65a0ab7360c8C9aE2168990138AdExecute each route with its compatible deployed router

Pin these addresses and their matching ABIs together. The deployment page is the canonical address record.

Candidate discovery

  1. Fetch live pools and exclude unsupported or inactive factories.
  2. Keep pools containing the input token, output token or an approved connector asset.
  3. Model tokens as graph vertices and pools as edges.
  4. Support parallel edges, because the same pair can have stable, volatile and multiple concentrated pools.
  5. Search direct and bounded multi-hop paths; a maximum of three pool hops is a common practical limit.

Quote evaluation

For each candidate path:

  • call the compatible quoter with the exact input;
  • discard reverting or zero-output quotes;
  • estimate gas where practical;
  • validate token behaviour;
  • compare final output after fees and estimated execution cost;
  • select the route that best matches the application's objective.

The pool with the most liquidity can produce a worse quote than a smaller pool with a more appropriate curve, active range or fee setting.

Mixed routes

A mixed route can traverse basic and concentrated pools. Its encoded path must preserve logical token direction even when that direction is opposite to a pool's internal token0/token1 order.

Never copy route-type constants from another deployment without checking Raphael's router and quoter implementation.

Execution

Once a route is selected:

  1. derive the minimum output from the user's slippage tolerance;
  2. request only the required token approval;
  3. set a short, reasonable deadline;
  4. simulate the exact call;
  5. submit through the correct Raphael router;
  6. confirm the receipt and actual output.

Refresh stale quotes. A quote is not a reservation of pool state; it is a snapshot of one block that the next block may contradict.