# User Flow

## Step 1 - User Command

The user initiates a swap by typing a simple command such as Swap 2 ETH for DAI on the platform (e.g., Telegram).

## Step 2 - Command Interpretation

Type AI’s NLP engine interprets the command, extracting the essential information including the tokens to be swapped and the amounts.

## Step 3 - Route Optimization

The ML component analyzes available liquidity pools and DEXs to find the best possible swap route. For example, it might find that Uniswap offers the best rate for this particular swap.

## Step 4 - Rate Confirmation

Type AI then confirms the current rate, for instance, 2 ETH = 3200 USDT , and estimates the gas fees for the transaction, e.g., Estimated gas calculated $5 .

## Step 5 - User Approval&#x20;

A confirmation message is sent to the user for approval. Upon receiving approval, Type AI proceeds to the next step.

## Step 6 - Transaction Execution

Type AI interacts with the necessary smart contracts on the blockchain to execute the swap. It manages all the transaction details, including gas fees and approvals.

## Step 7 - Confirmation

Once the swap is successfully executed, a confirmation message is sent to the user, Swap executed .


---

# 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://type-ai.gitbook.io/type-ai/user-guide/user-flow.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.
