> 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/overview/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="/files/ND1j3pTkUoq3R4p9qHdC" 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 path with the highest composite score is selected and executed. Less optimal paths are discarded.
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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wheelx.fi/overview/features/ai-route-optimization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
