> For the complete documentation index, see [llms.txt](https://docs.wheelx.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wheelx.fi/features/ai-route-optimization.md).

# AI Route Optimization

WheelX uses AI-driven algorithms to optimize transaction routes in real-time, selecting the best execution path across multiple dimensions — price, speed, slippage, gas cost, and liquidity depth.

<figure><img src="https://4149802529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTtoew6SwbdqR04YafQFk%2Fuploads%2FHCIxTFiyoveH34XdEokq%2Fai-route-optimization-wheelx-v1.png?alt=media&amp;token=bc70ac36-231e-4622-b5c1-85a40c772fd6" alt=""><figcaption></figcaption></figure>

#### How It Works

When a user submits an intent (e.g., swap Token A on Chain X for Token B on Chain Y), the AI Router evaluates all available execution paths in parallel:

1. **Path discovery** — The router identifies every viable route across supported DEXs, bridges, and liquidity pools.
2. **Multi-dimensional scoring** — Each path is scored across five optimization dimensions:
   * **Price** — Best available output amount across aggregated liquidity sources
   * **Speed** — Estimated fill time based on current network congestion and bridge latency
   * **Slippage** — Predicted slippage based on trade size vs. pool depth
   * **Gas cost** — Total gas expenditure across all hops in the route
   * **Liquidity depth** — Available pool capacity to absorb the trade without adverse price impact
3. **Optimal selection** — The router recommends a route using the current quote and available liquidity. The user reviews the route, output, fees and recipient, then authorizes the transaction in their wallet before execution.
4. **Continuous learning** — Every executed transaction feeds back into the model, improving future routing decisions based on real-world performance data.

#### Key Differentiator: Dynamic vs Static Routing

|                     | Static Routing                        | AI Routing                                                           |
| ------------------- | ------------------------------------- | -------------------------------------------------------------------- |
| Path selection      | Fixed pre-configured routes           | Real-time dynamic evaluation                                         |
| Market response     | Does not adapt to changing conditions | Instantly adjusts to price shifts, congestion, and liquidity changes |
| Optimization scope  | Single dimension (usually price)      | Multi-dimensional (price, speed, slippage, gas, liquidity)           |
| Learning capability | No improvement over time              | Continuously improves from every executed transaction                |

#### Benefits

* **Better execution prices** — Aggregates liquidity from multiple DEXs and bridges to find the best available price
* **Faster transaction completion** — Avoids congested chains and slow bridges in real time
* **Reduced slippage** — Matches trade size to pool depth, routing large trades through deeper liquidity sources
* **Lower gas costs** — Optimizes route structure to minimize total gas across all hops
* **Adaptive to market conditions** — Responds instantly to price movements, network congestion, and liquidity shifts
