Skip to main content
Start with token discovery, then request indicative pricing. Use the API tab for the generated request and response reference.

1. Discover the deployment and tokens

Choose two token id values from the response. They must be canonical C-strkeys, not symbols. Read the input token’s decimals and convert the amount into an integer string.

2. Request pricing

Set the shell variables to the selected contract IDs and raw input amount:
Inspect amountOut, the expected output after swap fees. Use atomic strings for calculations. Human-readable numeric fields are for display.

3. Requote for execution

Ask the user to choose slippage and connect their wallet. Add the sender and explicit tolerance to a fresh quote:
For example, 0.01 means 1% slippage. A live freshness check can reject a stale snapshot; retry after it catches up.

4. Inspect, sign, and confirm

For a single transaction, inspect transaction.envelopeXdr, the network, router, input, and minimum output. When transaction.simulated is true, the server has populated the source account’s current sequence + 1 and prepared Soroban resources, fees, and authorizations: sign through your wallet and submit through Stellar RPC. When it is false, populate the sequence and prepare resources first. Wait for successful execution. Request a new quote if another transaction uses the same source account before submission. If the response contains transactions[], follow the ordered plan procedure. If you are composing with lending, use the opaque route payload and simulate the outer transaction instead. Integration checklist · Quote phases · Troubleshooting