# Smart Routing

### Routing on Tower

When swapping Token A for Token B, there might be dozens of possible paths across different DEXs and liquidity pools. A direct A→B swap on one DEX might yield a worse price than going A→C→B across two different DEXs. Without an aggregator, users would never know.

Tower's routing engine evaluates every possible path and selects the one that delivers the most output tokens for the given input.

#### What Tower's Router Analyzes

For every trade, the routing engine considers:

* **Liquidity depth across pools:** Deeper pools mean less price impact. The router favors pools with sufficient liquidity for the given trade size.
* **Slippage impact:** Large trades on shallow pools cause significant price movement. The router calculates the actual slippage for each possible path.
* **Gas efficiency:** More complex routes (multi-hop, multi-pool) cost more gas. The router balances better pricing against higher transaction costs.
* **Trade splitting:** For larger trades, the router may split the order across multiple pools or DEXs simultaneously to minimize total price impact.

<figure><img src="/files/6c4BL6p7ZyCZp8zeKZBZ" alt=""><figcaption></figcaption></figure>

All of this happens in milliseconds. A trade is entered, and Tower returns the best price it found.


---

# 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://tower-exchange.gitbook.io/tower-exchange/getting-started/smart-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.
