Skip to main content
GET
/
api
/
v1
/
quote
Get swap route
curl --request GET \
  --url https://swap.xoxno.com/api/v1/quote
const options = {method: 'GET'};

fetch('https://swap.xoxno.com/api/v1/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://swap.xoxno.com/api/v1/quote"

response = requests.get(url)

print(response.text)
false
{
  "from": "WEGLD-bd4d79",
  "to": "USDC-c76f1f",
  "amountIn": "1000000000000000000",
  "amountOut": "42500000",
  "amountInShort": 1,
  "amountOutShort": 42.5,
  "amountOutMin": "42075000",
  "amountOutMinShort": 42.075,
  "slippage": 0.01,
  "priceImpact": 0.0012,
  "rate": 42.5,
  "rateInverse": 0.0235,
  "paths": [],
  "txData": "c3dhcEV4YWN0QW1...",
  "feeBps": 30,
  "feeAmount": "127500",
  "feeAmountShort": 0.1275
}
{
"error": "specify either amount_in or amount_out, not both"
}
{
"error": "routing failed: no path between tokens"
}

Query Parameters

from
string
required

Input token identifier (e.g., WEGLD-bd4d79).

to
string
required

Output token identifier (e.g., USDC-c76f1f).

amountIn
string

Amount to swap in smallest units. Returns maximum achievable output. Mutually exclusive with amountOut.

amountOut
string

Desired output amount in smallest units. Returns required input. Mutually exclusive with amountIn.

slippage
number
default:0.01

Slippage tolerance as a decimal (0.01 = 1%).

maxSplits
integer
default:6

Maximum number of route splits for the optimizer.

maxHops
integer
default:6

Maximum swaps per individual route path.

includePaths
boolean
default:false

Include detailed path breakdown in response. Set to true when you need route details; defaults to false to reduce response size.

algorithm
enum<string>
default:hybrid

Split allocation algorithm. greedy allocates chunks by marginal output, lagrangian balances marginal rates across convex AMM paths, and hybrid runs both and returns the larger output.

Available options:
greedy,
lagrangian,
hybrid
sender
string

Sender bech32 address. When provided, the API returns a complete transaction object ready for signing (fetches nonce, simulates gas).

referralId
integer
default:0

Referral ID for fee sharing.

maxBuiltinCalls
integer

Cap on smart contract calls per transaction (gas optimization).

includeLpRoutes
boolean
default:false

Allow LP tokens as intermediate hops. Auto-enabled when from or to is an LP token.

strict
boolean
default:true

Arbitrage mode only: when true, applies stricter profitability filters. Set to false for a broader but noisier cycle search. Only used when from equals to.

Response

Swap route found.

Swap route and execution details.

from
string

Input token identifier.

to
string

Output token identifier.

amountIn
string

Input amount in smallest units.

amountOut
string

Output amount in smallest units.

amountInShort
number

Human-readable input amount (divided by token decimals).

amountOutShort
number

Human-readable output amount.

amountOutMin
string

Minimum output after slippage, in smallest units. Present for forward quotes.

amountOutMinShort
number

Human-readable minimum output. Present for forward quotes.

amountInMax
string

Maximum input after slippage, in smallest units. Present for reverse quotes only.

amountInMaxShort
number

Human-readable maximum input. Present for reverse quotes only.

amountInUsd
number

USD value of input amount. Omitted if price unavailable.

amountOutUsd
number

USD value of output amount. Omitted if price unavailable.

amountOutMinUsd
number

USD value of minimum output after slippage. Omitted if price unavailable.

slippage
number

Applied slippage tolerance.

priceImpact
number

Estimated price impact as a decimal (0.01 = 1%).

rate
number

Exchange rate: output units per input unit.

rateInverse
number

Inverse rate: input units per output unit.

paths
object[]

Detailed route breakdown. Present when includePaths=true.

txData
string

Hex-encoded transaction data for the aggregator endpoint call. Omitted when transaction is present.

feeBps
integer

Protocol fee in basis points.

feeAmount
string

Fee amount in smallest units.

feeAmountShort
number

Human-readable fee amount.

feeToken
string

Token identifier the fee is charged on.

transaction
object

Complete transaction ready for signing. Present only when sender is provided.

arbitrage
object

Arbitrage metadata. Present only for same-token (from == to) forward quotes.