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

# Soroswap vs UniswapV2

> Feature by feature comparison table between UniswapV2 and Soroswap.

> [!NOTE]
>
> These pages are a design-time comparison written while Soroswap was being ported from UniswapV2, kept for the rationale it records. The Rust snippets and function signatures shown here reflect an early version of the contracts, not what is deployed today. For the current API, see [Contracts](https://docs.soroswap.finance/amm/technical-reference/contracts).

Here we can see a comparison of the implementation of UniswapV2 and Soroswap.

| **Feature** | **UniswapV2** | **Soroswap** |
| - | - | - |
| **Algorithm** | Automated Market Maker (AMM) with constant product formula | Optimized routing algorithm for multi-pool efficiency |
| **Liquidity Pools** | Direct swaps between two tokens; liquidity in equal value pairs | Supports multi-hop swaps through intermediate pools |
| **Smart Contracts** | Two core contracts: factory and router | Advanced contracts with aggregated liquidity and custom routing |
| **Routing** | Direct matching within or between pools | Sophisticated routing with multiple paths for optimal rates |
| **Efficiency** | Fast execution; may not always provide optimal rates | Improved efficiency with better trading rates through optimization |
| **Liquidity Provision** | 50/50 ratio token pairs; straightforward addition/removal | Complex arrangements; support for multiple AMMs and protocols |
| **Incentives** | Fees from trades within pools | Aggregated fees and potentially higher returns |
| **Security** | Extensive testing and audits; proven track record | Rigorous audits; advanced security measures |
| **User Experience** | Simple, user-friendly interface | Enhanced features; advanced routing and multi-chain support |
| **Documentation** | Well-established, extensive community support | Comprehensive documentation and support for new features |


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