Quote Endpoint
The quote endpoint finds the optimal swap route between two tokens and returns detailed execution information.
Endpoint
GET /api/v1/quoteRequest Parameters
Required Parameters
from
string
Input token identifier (e.g., WEGLD-bd4d79)
to
string
Output token identifier (e.g., USDC-c76f1f)
Amount Parameters
You must provide exactly one of:
amountIn
string
Amount to swap (in smallest units). Returns maximum output.
amountOut
string
Desired output amount (in smallest units). Returns required input.
Optional Parameters
slippage
number
0.01
Slippage tolerance (0.01 = 1%)
maxSplits
number
5
Maximum number of route splits
maxHops
number
10
Maximum swaps per route
includePaths
boolean
true
Include detailed path breakdown
referralId
number
0
Referral ID for fee sharing
algorithm
string
hybrid
Routing algorithm: greedy, lagrangian, or hybrid
maxBuiltinCalls
number
-
Limit smart contract calls (gas optimization)
includeLpRoutes
boolean
false
Enable LP token mint/burn routing
Arbitrage Parameters
When from equals to, the API detects arbitrage opportunities:
minProfitBps
number
10
Minimum profit in basis points
maxCycles
number
5
Maximum arbitrage cycles to find
fastMode
boolean
false
Use faster but less optimal search
Response Format
Successful Response
Response Fields
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
amountOutShort
number
Human-readable output amount
amountOutMin
string
Minimum output after slippage
amountOutMinShort
number
Human-readable minimum output
amountInMax
string
Maximum input (reverse quotes only)
amountInMaxShort
number
Human-readable max input
slippage
number
Applied slippage tolerance
priceImpact
number
Estimated price impact (0.01 = 1%)
rate
number
Exchange rate (output per input)
rateInverse
number
Inverse rate (input per output)
paths
array
Detailed route breakdown
instructions
array
Smart contract instructions
txData
string
Base64-encoded transaction data
estimatedBuiltinCalls
number
Estimated SC calls
feeBps
number
Protocol fee in basis points
feeAmount
string
Fee amount in output token
feeAmountShort
number
Human-readable fee
Path Object
When includePaths=true, each path in the paths array contains:
splitPpm
number
Path allocation in parts per million
swaps
array
Individual swaps in this path
swaps[].dex
string
DEX name (xExchange, AshSwap, JEX, OneDex)
swaps[].address
string
Pool smart contract address
Examples
Forward Quote
Get the best rate for swapping 1 EGLD to USDC:
Reverse Quote
Calculate how much EGLD needed to receive exactly 100 USDC:
Arbitrage Detection
Find profitable arbitrage cycles for WEGLD:
Large Trade with Splits
Optimize a large trade with multiple route splits:
Minimal Response
Get quote without path details for faster response:
Error Responses
Unknown Token
No Route Found
Invalid Amount
Ambiguous Request
Token Identifiers
Token identifiers on MultiversX follow the format TICKER-hexcode:
Wrapped EGLD
WEGLD-bd4d79
USDC
USDC-c76f1f
USDT
USDT-f8c08c
UTK
UTK-2f80e9
MEX
MEX-455c57
Using Transaction Data
The txData field contains the raw transaction payload ready to be submitted to the aggregator smart contract. This includes the function name and all encoded arguments:
Example txData format:
Rate Limiting
Maximum 100 requests per second per IP
Responses are not cached; each request computes fresh routes
For high-frequency applications, consider WebSocket integration
Related Topics
Pair Configuration - Verify token support before quoting
Integration Guide - Complete integration walkthrough
Relayer WebSocket - Real-time data and transaction tracking
Troubleshooting - Common API issues
Last updated
Was this helpful?