Quote Endpoint

The quote endpoint finds the optimal swap route between two tokens and returns detailed execution information.

Endpoint

GET /api/v1/quote

Request Parameters

Required Parameters

Parameter
Type
Description

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:

Parameter
Type
Description

amountIn

string

Amount to swap (in smallest units). Returns maximum output.

amountOut

string

Desired output amount (in smallest units). Returns required input.

Optional Parameters

Parameter
Type
Default
Description

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:

Parameter
Type
Default
Description

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

Field
Type
Description

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:

Field
Type
Description

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:

Token
Identifier

Wrapped EGLD

WEGLD-bd4d79

USDC

USDC-c76f1f

USDT

USDT-f8c08c

UTK

UTK-2f80e9

MEX

MEX-455c57

Use the pair-config endpoint to verify token support and get decimal information.

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

Last updated

Was this helpful?