Quote endpoint — forward (given input, maximize output) or reverse (given target output, minimize input).
When sender is set, the response gains a ready-to-sign transaction
XDR envelope. With simulate=true (the default whenever sender is set)
the envelope is server-side-prepared (resource-fee + footprint attached).
Quotes are always produced on the Soroban aggregator platform.
Query Parameters
Input Soroban token contract. Resolve IDs and decimals through /api/v1/tokens.
56Output Soroban token contract; a share-token ID selects a liquidity operation.
56Exact gross input in atomic units, including any input-side fee. Exactly one of amount_in / amount_out is required. Alias: amountIn. Range: 1..=i128::MAX.
Required net output after swap fees, in atomic units. Computes the input needed; executable strategies enforce this target as a minimum. Alias: amountOut.
Maximum swaps per candidate path. Capped at 3 when the requested amount's locally derived USD value is below $10; lower limits stay lower. Alias: maxHops.
1 <= x <= 6Maximum split paths. Set 1 for a single path. Legacy 0 is treated as 1. Capped at 3 below $10 using the requested amount's local USD value; lower limits stay lower. Alias: maxSplits.
0 <= x <= 8Output tolerance: 0.01 = 1%, finite and in [0,1). Required for executable payloads; omit for indicative amounts only. Rounded down to parts per million. Reverse quotes never permit output below the requested net target.
x >= 0Include per-path swaps and split weights. Totals always include every path. Alias: includePaths.
Account G-strkey. Requires slippage; adds an unsigned standalone envelope. Without sender, slippage still enables routeXdr for contract composition.
56Active on-chain referral ID, limited to the program's u32 range. Zero means no referral and no protocol fee. Aliases: referralId, referral.
0 <= x <= 4294967295With sender, simulate and prepare resource data. False returns an unprepared envelope. Budget failures may retry smaller routes, preserving the original output minimum. Ignored without sender. Composition requires its own simulation.
Soroban execution only. Kept for compatibility. Execution platform for quotes. The protocol is Soroban-only, so the only platform is the composable aggregator plane.
aggregator Check live RPC ledger against the exact snapshot used for this quote. Reject drift above two ledgers with 409. Adds one RPC request.
Response
Best net-output route found within search/execution limits, with optional execution payload
Top-level response carrying the best route found within configured limits, prepared envelope (when
sender is set), and enrichment fields (USD value, fee breakdown,
auto-fallback metadata).
Gross input debited from the user, including any input-side fee; atomic integer string.
Gross input in whole-token units; approximate display value, not transaction arithmetic.
Expected net output after aggregator/referral fees; atomic integer string. Successful standalone simulation replaces the model estimate with its delivered output.
Net output in whole-token units; approximate display value.
Input token decimal precision.
x >= 0Output token decimal precision.
x >= 0Canonical Soroban token contract identifier.
Flat hop list (concatenation of all paths when split).
Kept in the public response for compatibility. paths is the richer
per-path breakdown when the caller asks for includePaths=true.
forward, reverse, addLiquidity, removeLiquidity, or convertLiquidity.
"forward"
Which execution plane produced this quote. Always "aggregator".
aggregator Expected net output per whole unit of gross input; approximate.
Gross input per whole unit of expected net output; approximate.
Output token contract C-strkey.
Token role: soroban for ordinary tokens or lp for share tokens.
Output role: soroban or lp.
USD value of amountIn (None when the input token has no
Reflector oracle price on the active network).
Enforced net-output floor in atomic units when slippage is supplied. Reverse quotes preserve the requested target; fallback and simulation never lower this floor.
Net-output floor in whole-token units; approximate display value.
USD value of amountOutMin (only set when slippage was set on
the request and the output token has a price).
USD value of amountOut.
Set when the server-side simulator rejected the requested
configuration (typically Budget, ExceededLimit) and the
quote was re-built with reduced maxSplits / maxHops to fit.
Carries the actual config used so the caller can surface a
"we routed through fewer paths" hint to the user.
Fee amount the router will deduct (raw u128 string). Charged on
the input token when feeOnInput=true, otherwise on the output
token. The amountOut / amountOutMin already reflect this
deduction.
Display value of feeAmount (decimals applied; loses precision
above 2^53).
Combined admin and referral fee in basis points (1 bps = 0.01%). Absent when no fee applies or an LP conversion spans fees in different tokens.
x >= 0true if the fee is charged on the input token, false if
charged on the output. Mirrors the contract's
fee_on_input = !out_whitelisted || in_whitelisted rule. Absent
when no fee applies or an LP conversion spans fees in different tokens.
Liquidity breakdown for addLiquidity / removeLiquidity quotes:
the pool, the per-constituent deposit/withdraw amounts, and the zap
pre-swap when the mint balances inside its own pool. Purely
informational (route visualization) — execution still comes from the
encoded payload. Absent for ordinary swaps.
Per-path breakdown. Populated when the request includes
includePaths=true. Even on multi-path splits the field stays absent
by default — clients that need the route detail must opt in.
Modelled execution impact as a decimal, excluding aggregator/referral fees. Uses sufficiently deep oracle-anchored prices when available, otherwise route spot rates. Absent when no reference exists; not recalculated from standalone simulation.
Base64 ScVal XDR containing the complete opaque strategy payload; requires slippage.
Pass decoded bytes to execute_strategy(sender, total_in, swap_xdr).
For LP conversion this optional atomic alternative can differ from transactions;
its presence does not prove execution-budget feasibility. Simulate the complete composed call.
Slippage tolerance as decimal (echoed from request).
Snapshot used to search this quote; independent of the simulation ledger.
Unsigned standalone transaction, present when sender and slippage are supplied.
With transaction.simulated=true, the live source sequence is already set.
Otherwise populate the sequence, simulate and assemble resource data first. Then sign, submit,
and poll for confirmation. A composed controller transaction needs its own simulation.
Ordered standalone LP-conversion steps, present with sender and slippage.
Confirm each step before preparing the next; later steps require fresh simulation.
Mutually exclusive with transaction; optional routeXdr is a separate atomic alternative.

