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

# Stellar execution planes

> How to choose Soroban, Classic SDEX, or cross-plane comparison when requesting Stellar Aggregator quotes.

Choose the Stellar execution plane before building a quote that the user or contract will execute.

## Definition

Stellar swaps can execute through Soroban contracts or Classic SDEX operations. The `platform` parameter restricts which plane the Aggregator searches and which envelope shape it can return.

## Decision table

| Flow                                           | `platform`   | Why                                                 |
| ---------------------------------------------- | ------------ | --------------------------------------------------- |
| Lending contract calls the Aggregator          | `aggregator` | Keeps execution inside Soroban.                     |
| App needs a Soroban `batch_execute` envelope   | `aggregator` | Returns a Soroban-compatible `TransactionEnvelope`. |
| Direct-user UI can sign a Classic path payment | `sdex`       | Restricts the route to Classic SDEX.                |
| Direct-user UI wants one route across planes   | `all`        | Runs both searches and returns one selected quote.  |

<Warning>
  Classic SDEX operations do not compose inside another Soroban contract. Do not use `platform=all` for a contract-to-contract flow unless your app rejects Classic results.
</Warning>

## Visual flow

```mermaid theme={"system"}
flowchart TB
    Request[Quote request] --> Platform{Choose platform}
    Platform -->|aggregator| Soroban[Soroban sources<br/>Soroswap, Aquarius, Phoenix]
    Platform -->|sdex| Classic[Classic SDEX]
    Platform -->|all| Compare[Run both planes<br/>return selected quote]
    Soroban --> Envelope[Soroban TransactionEnvelope<br/>batch_execute ready]
    Classic --> PathPayment[Classic path payment route]
```

## Worked example

```bash theme={"system"}
curl "https://stellar-swap.xoxno.com/api/v1/quote?\
from=XLM&\
to=USDC&\
amount_in=1000000000&\
platform=aggregator&\
sender=GA..."
```

Verify the result:

* `transaction.envelopeXdr` is present when `sender` is set.
* `platform` in the response matches the execution plane you intended.
* `simulated` is `true` when you rely on the prepared Soroban footprint.

## Edge cases

| Case                                  | Behavior                                    | Fix                                                       |
| ------------------------------------- | ------------------------------------------- | --------------------------------------------------------- |
| `platform=all` returns only one quote | The service drops the losing plane.         | Make separate explicit requests for side-by-side display. |
| `simulate=false` with `sender`        | The caller must prepare Soroban resources.  | Simulate and prepare before signing.                      |
| Alias token IDs                       | `USDC` and `XLM` resolve from the snapshot. | Use C-strkeys or SEP-11 IDs for deterministic flows.      |

## Related endpoints

* [Stellar quote](/stellar-aggregator/quote)
* [Stellar tokens](/stellar-aggregator/tokens)
* [Quote freshness](/resources/quote-freshness)
