> ## Documentation Index
> Fetch the complete documentation index at: https://docs.soroswap.finance/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Soroswap Aggregator API: base URL https://api.soroswap.finance, pick the network with ?network=mainnet or ?network=testnet (omitted means mainnet).
> Auth: Authorization: Bearer sk_... on every call. Get a key at https://console.soroswap.finance/register. A missing or invalid key returns 401 with code and registerUrl (POST /send returns 403 instead); an expired JWT or a missing role returns 403. Free plan 1 request/s; see https://docs.soroswap.finance/api/plans.md.
> Flow: POST /quote (assetIn, assetOut as C... contract addresses, amount as an integer string in the smallest unit, tradeType, protocols) -> POST /quote/build with the unchanged quote and from -> the user signs the XDR -> POST /send. Build right after quoting: a Soroban XDR is valid for 180 seconds. Submit it as is, never re-simulate it.
> Partner id: every account has one (9 hex chars, permanent). Read partnerId from GET /partner, or in the console at https://console.soroswap.finance under Fees & payouts. The partner fee itself is switched on by Soroswap; see https://docs.soroswap.finance/api/fees.md.
> AI tools: docs MCP at https://docs.soroswap.finance/mcp (claude mcp add --transport http soroswap-docs https://docs.soroswap.finance/mcp), skill with npx skills add https://docs.soroswap.finance. Other clients: https://docs.soroswap.finance/api/build-with-ai.md.
> Units and Stellar pitfalls: https://docs.soroswap.finance/api/stellar-gotchas.md. Errors and retries: https://docs.soroswap.finance/api/errors.md.

# How to Swap

> Swapping assets in the Soroswap app: selecting tokens, confirming the trade, and adjusting slippage tolerance.

The **Swap** section allows you to exchange one asset for another using liquidity provided by **Soroswap AMM** or, when available, optimized routes through the **Soroswap Aggregator**.

\
**Select the assets**\
Choose the asset you want to swap *from* and the asset you want to receive. You can search or pick from the available list.

![](https://mintcdn.com/soroswap/1xzCGA5zGx88_Gb9/images/grabacion-de-pantalla-2025-04-25-a-las-12-43-52.gif?s=aed16defe3eaa8319a9c27f0ac7ad0a4)

**Enter the amount**\
Input how much you want to swap. The app will automatically estimate how much you’ll receive.

![](https://mintcdn.com/soroswap/1xzCGA5zGx88_Gb9/images/captura-de-pantalla-2025-04-25-a-las-12-52-39.png?fit=max\&auto=format\&n=1xzCGA5zGx88_Gb9\&q=85\&s=847384fc5d46af064726f2ea38a8eeff)

**Best route via Aggregator (automatic)**\
If a better price is available by splitting the trade across multiple AMMs (e.g. Aquarius, SushiSwap V3 or the Soroswap AMM), the **Aggregator** will route the swap automatically—no manual setup needed.

![](https://mintcdn.com/soroswap/1xzCGA5zGx88_Gb9/images/aggregator.png?fit=max\&auto=format\&n=1xzCGA5zGx88_Gb9\&q=85\&s=fff7c52c8ee1c342f5d0b0127928bc1d)

**Approve trustline (if needed)**\
If it’s your first time using the asset, you’ll need to sign a trustline to authorize it in your wallet.

**Confirm the swap**\
Review the swap details and sign the transaction in your wallet.

**Check the result**\
Once confirmed, your wallet balance will update. You can also view the transaction on [Stellar.Expert](https://stellar.expert/) or [StellarChain](https://stellarchain.io/).

#### ⚙️ Adjusting slippage tolerance

You can control how much price variation you’re willing to accept:

* Open the **Settings** panel
* Select a predefined slippage value (e.g. 0.5%) or enter a custom one
* Click **Save** to apply changes

> 📘 Need a full walkthrough with screenshots and tips? Follow the [Swap Tutorial](https://docs.soroswap.finance/tutorials/doing-swap.md)

***

🔄 **Next step:** Provide Liquidity\
🧠 **Learn more:** How the Aggregator Works


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.