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

# SDEX

> Stellar's native order book exchange, how it differs from Soroswap AMMs, and how the Aggregator API routes through it.

What Stellar SDEX is, how it differs from Soroswap.Finance, and how the Soroswap Aggregator API quotes it. For the integration details, see [Routing through SDEX](https://docs.soroswap.finance/api/sdex.md).

### What is Stellar SDEX?

[**Stellar SDEX**](https://developers.stellar.org/docs/learn/encyclopedia/sdex) **(Stellar Decentralized Exchange)** is the native decentralized exchange of the Stellar network. It allows users to trade assets directly on the Stellar blockchain through a system of order books. Here’s how it operates:

* **Order Books:** Stellar SDEX uses order books to facilitate trades. Users place buy and sell offers in the order book, which are matched based on price and time priority.
* **Order Types:** Users can create various types of orders, such as market or limit orders. Orders are automatically matched against existing orders in the book.
* **Asset Exchange:** Trades are executed by matching buy and sell orders within the order books. Assets are exchanged directly between users without needing an intermediary.
* **Path Payments:** If there is no direct order for an asset pair, Stellar allows path payments to find the best route through multiple assets to complete the trade.

| Feature | Stellar SDEX | Soroswap.Finance |
| - | - | - |
| **Exchange Model** | [Order book](https://developers.stellar.org/docs/learn/encyclopedia/sdex/liquidity-on-stellar-sdex-liquidity-pools#order-books) (buy and sell orders) | [Automated Market Makers (AMMs)](https://docs.soroswap.finance/amm/how-it-works.md) |
| **Pricing Mechanism** | Based on matching orders in the order book | Based on mathematical formulas[ (e.g., x \* y = k)](https://docs.soroswap.finance/amm/glossary.md#x-y-k) |
| **Liquidity Provision** | Users place orders in the order book | Users deposit assets into liquidity pools |
| **Transaction Execution** | Executes orders directly based on price-time priority | Executes transactions through AMM, adjusting prices according to reserves |
| **Order Types** | Limit and passive orders | Interactions with AMM, no traditional limit orders |
| **Aggregator Integration** | Quoted by the [Aggregator API](https://docs.soroswap.finance/api/sdex.md) as a classic path | Integrated into [the Aggregator API](https://docs.soroswap.finance/index.md) |


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