Skip to main content
Integrate the Stellar Aggregator by reading token metadata, choosing an execution plane, requesting a quote, and signing the returned TransactionEnvelope.

Prerequisites

Flow

1

Load token metadata

Call /api/v1/tokens and store the canonical id, decimals, kind, and sacPeer.
2

Choose the execution plane

Use platform=aggregator for Soroban composition. Use platform=all only when a direct-user UI can accept either plane.
3

Quote for display

Call /api/v1/quote without sender for price display.
4

Requote with sender at confirmation

Pass sender to receive transaction.envelopeXdr. Keep simulate=true unless your client prepares Soroban resources itself.
5

Refresh sequence, sign, submit

Set the sequence number from the live account, sign with the sender key, and submit through Stellar tooling.

Implementation Checklist

Classic SDEX operations do not compose inside another Soroban contract. Reject Classic results for Lending -> Aggregator flows.

Minimal TypeScript Shape

Verify Before Signing

  • The selected token has degree > 0 in /api/v1/tokens.
  • Amounts are raw atomic unit strings.
  • platform matches the flow you can execute.
  • transaction.envelopeXdr is present.
  • simulated is true when you rely on the server-prepared Soroban footprint.
  • The quote was requested after the latest user change to token, amount, sender, slippage, or platform.