# How SafeSwap Works

{% hint style="info" %}
Click [**here**](/user-guides/swap-tokens.md) to view a **detailed tutorial** on how to swap your tokens with SafeSwap.
{% endhint %}

<figure><img src="/files/RSTOXvX6jbrsJjzgkvbf" alt=""><figcaption></figcaption></figure>

## 1. Initiate Swap <a href="#id-1-initiate" id="id-1-initiate"></a>

To initiate a swap, the user must select:

* a source **and** destination blockchain (both)
* connect a source **and** destination wallet (both)
* select the preferred token
* and fill in the amount to swap

## 2. Secure Swap <a href="#id-2-secure" id="id-2-secure"></a>

SafeSwap’s integrated UI creates a unique secret code which delivers hash data to the contract.

## 3. Lock Native Tokens on Source Chain <a href="#id-3-lock" id="id-3-lock"></a>

If a swap is initiated, SafeSwap will lock all tokens received from the source wallet in the related locked token pool on the source blockchain.

## 4. Unlock Native Tokens on Destination Chain <a href="#id-4-unlock" id="id-4-unlock"></a>

SafeSwap accounts for the required tokens necessary and uses the unique code to unlock tokens from a locked token pool on the destination blockchain.

## 5. Claim to Wallet <a href="#id-5-claim" id="id-5-claim"></a>

The user can claim the swapped tokens and they are transferred to the connected destination wallet.


---

# 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://docs.safeswap.io/learn/how-safeswap-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.
