# Smart Order Routing

SwapMode's Smart Order Routing (SOR) system represents a state-of-the-art routing procedure that meticulously factors in several considerations to secure the most favorable prices for users. This advanced SOR not only evaluates prices across both the V2 and V3 pools, but it also weighs the gas costs and slippage linked with each transaction. Such meticulousness ensures users access the most competitive prices, all while keeping gas fees to a minimum. As the matrix of V2 and V3 welcomes new pool types, the SOR remains in a perpetual state of growth and adaptation. This guarantees that all pools within the matrix can facilitate trades and act as liquidity reservoirs. Moreover, any custom pool constructed atop V2 and V3 can tap into this amalgamated liquidity, ensuring traders consistently enjoy the best possible swap rates.

In SwapMode V3, the smart order router meticulously scans for the best rates across every pool for a specific pair, weighing factors like fee tiers, liquidity, and slippage. The router then pinpoints the most cost-effective path in terms of gas expenses, ensuring users secure the optimal swap rates with the lowest gas cost and the least possible slippage.

SwapMode unveils an advanced smart router that substantially elevates the trading engine through the integration of split routing capabilities and access to the entirety of liquidity. This enhanced smart router astutely pinpoints the best trading route by harnessing liquidity from both V2 and V3 pools, complemented by multi-hop and split routing functionalities.


---

# 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://swapmode.gitbook.io/swapmode/swapmode-1/smart-order-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.
