# Optimal Routing

Optimal Routing is a concept built on user intent and provided liquidity by Solvers.

For instance, a simple Solver algorithm may select the optimal DMM based on the user’s cross-chain intent according to the following rules:

1. Select all DMMs that can meet the user’s cross-chain amount requirements.
2. Sort the DMMs based on their cross0chain fees from low to high.
3. Select the DMM with the lowest fee and execute the operation through the platform.

Another example involving the splitting and routing of large cross-chain requests: In cases of large cross-chain requests where a single DMM may not have sufficient funds to handle the entire amount, the large request can be split into several smaller requests funded by multiple DMMs. The splitting rules can be formulated based on factors such as optimal rates, available funds of the DMMs, etc.

Splitting rules:

1. Select multiple DMMs that can handle a total of up to 20% of the cross-chain funds.
2. Sort the DMMs based on their cross-chain fees from low to high.
3. Aggregate funds from 5 DMMs to fulfill the user’s request.<br>

In the case where it is not possible to find 5 DMMs that meet the above conditions, the user will be informed of the maximum amount that can currently be fulfilled.


---

# Agent Instructions: 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:

```
GET https://xbridge.gitbook.io/xbridge/x-protocol-features/optimal-routing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
