> ## 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.

# Provide Liquidity

> Depositing two assets into a Soroswap pool to earn trading fees, and receiving pool tokens.

Providing liquidity on **Soroswap** allows users to earn rewards by depositing two assets into a liquidity pool. Liquidity providers (LPs) facilitate asset swaps for other users, and in return, they earn a share of the trading fees collected by the protocol.

### How to Provide Liquidity

1. **Access the app**\
   Open [app.soroswap.finance](https://app.soroswap.finance).
2. **Connect your wallet**\
   Use a Stellar/Soroban-compatible wallet. Make sure you have enough XLM for transaction fees.
3. **Navigate to the Liquidity section**\
   In the app, select **Liquidity** to view existing pools

![](https://mintcdn.com/soroswap/1xzCGA5zGx88_Gb9/images/grabacion-de-pantalla-2025-04-28-a-las-13-30-30.gif?s=2f95ef15a6d5a71513c1b0c53a175cb3)

4. **Deposit both assets**

* Enter the amounts of each asset you want to deposit.
* The ratio must match the current pool price (or, when creating a new pool, you set the initial price).

5. **Receive pool tokens**\
   After a successful deposit, you’ll receive pool tokens that represent your share of the pool’s liquidity.

### Key Notes

* **Initial liquidity providers** set the initial price of a new pool.
* **All liquidity pools follow the formula**: `x * y = k`, where `k` is constant.
* **Removing liquidity**: You can withdraw your assets at any time by burning your pool tokens, receiving your share of the assets plus accumulated fees.

***

> 📘 Need a full walkthrough? Check\
> [Adding Liquidity](https://docs.soroswap.finance/tutorials/adding-liquidity.md) l [Remove Liquidity](https://docs.soroswap.finance/tutorials/remove-liquidity.md)


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