> For the complete documentation index, see [llms.txt](https://docs.zama.org/protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zama.org/protocol/confidential-swap/guides/first-swap.md).

# Make your first swap

Make your first confidential swap from the web app, from connecting a wallet to reclaiming funds if nothing fills.

You hold a confidential asset and you want to exchange it for another one. A public DEX cannot help: you would have to unwrap first, publishing the amount before you even trade.

This guide walks through the same exchange on Confidential Swaps, where the amount and the direction stay encrypted from end to end.

## What you need

* A wallet.
* Native ETH for gas.
* A confidential balance on the asset you want to sell. The protocol trades confidential ERC-7984 tokens, not the underlying ERC-20s, so you need to wrap the asset you already hold before trading it. See the [Confidential Vaults](https://docs.zama.org/protocol/confidential-vault) docs for a worked example of shielding a token into its confidential form.

## 1. Connect and pick a pair

Open the app at [app.zama.org/swap](https://app.zama.org/swap) and connect your wallet. Choose the asset you are selling and the asset you want, and enter an amount.

Only assets belonging to an **active registered pair** are offered. The protocol trades confidential ERC-7984 tokens.

## 2. Grant the operator

The first time you sell a given asset, you authorize the swap contract to pull that token on your behalf. Confidential tokens use an **operator** model rather than ERC-20 allowances: you call `setOperator(swap, until)`, which is time-bounded rather than amount-bounded.

The grant is reused for every intent until it expires, so this is a one-off per asset, not per trade.

{% hint style="warning" %}
**Privacy is weak on your first trades.** You do not need an initialized confidential balance to create an intent — an uninitialized one simply funds nothing, and what you do need is the operator grant on every asset your bundle sells. But wrapping is a public transaction: it bounds the largest trade you could possibly make on that asset, and unwrapping later publishes an amount that any observer can line up against your trades.

How you initialize your balances, and how you move assets in and out afterwards, shapes the privacy of every trade you make. To learn more, see [Protecting your privacy](/protocol/confidential-swap/protocol/privacy.md).
{% endhint %}

## 3. Set your floor

The app's **"You receive at least"** field is a floor, not a price. Market makers do not see this value and quote blindly. At resolution, the best quote is checked against your floor to determine the winner: below it, there is no winner and you reclaim your funds.

That number is the **net** amount you keep, after the protocol fee. The app converts it to the gross floor it submits on-chain, so the number you type is the number you can rely on. See [Fees and the slippage floor](/protocol/confidential-swap/protocol/fees.md) if you want the arithmetic.

The app also shows a reference amount from market prices. That is a hint, not a quote and not a guarantee.

## 4. Submit

Submitting does three things in your browser before anything reaches the chain: it builds your decoy bundle, encrypts the amounts, your real index and your floor, and produces a single input proof. Then it calls `createIntent`, which locks your funds.

Encryption happens client-side. The plaintext values never leave your browser.

## 5. Watch the auction

The tracking screen follows the intent through its windows:

* **Quoting** — market makers submit encrypted quotes. You cannot see them and neither can they see each other's.
* **Resolving** — the auction closes and the winner is published. This can happen before the quoting window ends if every market maker has already quoted.
* **Settling** — the winner has until `settlementEndsAtBlock` to execute.

Most of what is happening is encrypted, so the app shows you phase and timing rather than numbers. Once the intent settles you can decrypt your own amounts and see what you actually received.

## 6. If nothing fills

Not every intent settles. Market makers may quote below your floor, or the winner may fail to settle in time.

Reclaim returns your funds. Timing depends on what happened:

* **Nobody quoted** — reclaim as soon as quoting closes.
* **Somebody quoted but no winner cleared your floor** — reclaim immediately after resolution, with a proof that there was no winner. The app handles this for you.
* **Anything else** — reclaim once the settlement window has passed.

Your funds are always recoverable. A quoted-but-unfilled intent simply cannot be reclaimed until its settlement window ends.

## Next steps

* [How it works](/protocol/confidential-swap/protocol/how-it-works.md) — what happened on-chain during those five steps
* [Decoy bundles](/protocol/confidential-swap/protocol/decoy-bundles.md) — the mechanism that hid your trade
* [Create an intent](/protocol/confidential-swap/guides/create-an-intent.md) — doing the same thing from code


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zama.org/protocol/confidential-swap/guides/first-swap.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
