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. |
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.
Visual flow
Worked example
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. |