# 2. How It Works

#### 2.1 Routing Engine

MOOR’s router continuously indexes pools across integrated DEXes and computes the most efficient swap route.\
It evaluates:

* Pool depth and fees
* Slippage vs. liquidity ratio
* Real-time gas metrics
* Multi-hop vs. direct execution

Execution is handled **on-chain via a single atomic transaction**, ensuring transparency and minimizing failed trades.

#### 2.2 Execution Flow

```
User initiates swap  
↓  
MoorRouter scans all DEX pools  
↓  
Optimal route computed (split or direct)  
↓  
Atomic multi-DEX transaction executed  
↓  
User receives best-possible output  
```


---

# 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://moor-finance.gitbook.io/moor-finance-docs/2.-how-it-works.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.
