Swap Quote
POST /quote
Computes the optimal swap route across Ryze pools with full fee breakdown, price impact, and oracle prices.
Request
bash
curl -X POST https://mainnet.router.ryze.pro/quote \
-H "Content-Type: application/json" \
-d '{
"tokenIn": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tokenOut": "0x4200000000000000000000000000000000000006",
"amountIn": "100000000",
"slippageTolerance": 50,
"maxHops": 3,
"userAddress": "0xYourWalletAddress"
}'Parameters
| Field | Type | Required | Description |
|---|---|---|---|
tokenIn | string | Yes | Input token address |
tokenOut | string | Yes | Output token address |
amountIn | string | One of | Exact input amount in raw units |
amountOut | string | One of | Desired output amount in raw units |
slippageTolerance | number | Yes | Slippage tolerance in basis points (50 = 0.5%) |
maxHops | number | Yes | Maximum hops (1-3) |
userAddress | string | No | User wallet for TSP session |
preferredTokens | string[] | No | Preferred intermediate tokens |
excludedPools | string[] | No | Pool addresses to exclude |
INFO
Provide exactly one of amountIn or amountOut. Use amountIn for "exact input" quotes and amountOut for "exact output" quotes.
Response
json
{
"routeId": "a1b2c3d4",
"type": "single_hop",
"input": {
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "100000000",
"decimals": 6
},
"output": {
"token": "0x4200000000000000000000000000000000000006",
"amount": "62500000000000000",
"decimals": 18
},
"path": [
"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"0x4200000000000000000000000000000000000006"
],
"steps": [
{
"pool": "0x7B41aA91947398CD9244AD4e314C253D9B1B5206",
"tokenIn": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tokenOut": "0x4200000000000000000000000000000000000006",
"amountIn": "100000000",
"amountOut": "62500000000000000",
"priceImpact": "100000000000000",
"fees": {
"swapFee": "30000",
"swapFeePct": "300000000000000",
"takerFee": "10000",
"takerFeePct": "100000000000000",
"slippageFee": "5000",
"slippagePct": "50000000000000",
"wbfFee": "0",
"wbfFeePct": "0",
"wbrReward": "2000",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
}
],
"totalFees": {
"swapFee": "30000",
"swapFeePct": "300000000000000",
"takerFee": "10000",
"takerFeePct": "100000000000000",
"slippageFee": "5000",
"slippagePct": "50000000000000",
"wbfFee": "0",
"wbfFeePct": "0",
"wbrReward": "2000",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
},
"incentive": {
"maxBps": 75,
"displayPct": "0.075%",
"tokenOut": "0x4200000000000000000000000000000000000006",
"isImproving": true
},
"priceImpact": "100000000000000",
"spotPrice": "1600000000000000000000",
"executionPrice": "1599840000000000000000",
"confidence": 1.0,
"timestamp": "2026-04-15T12:00:00Z",
"prices": [
{
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"pythPrice": "1000000000000000000",
"cexPrice": "1000000000000000000",
"blendFactor": "500000000000000000",
"blendedPrice": "1000000000000000000"
},
{
"token": "0x4200000000000000000000000000000000000006",
"pythPrice": "1600000000000000000000",
"cexPrice": "1600500000000000000000",
"blendFactor": "500000000000000000",
"blendedPrice": "1600250000000000000000"
}
]
}Response Fields
Top Level
| Field | Type | Description |
|---|---|---|
routeId | string | Unique route identifier |
type | string | "single_hop" or "multi_hop" |
input | object | Input token, amount (raw), decimals |
output | object | Output token, amount (raw), decimals |
path | string[] | Token addresses in route order |
steps | array | Per-hop details |
totalFees | object | Aggregated fees across all hops |
incentive | object | WBR incentive info |
priceImpact | string | Overall price impact (WAD) |
spotPrice | string | Oracle spot price (WAD) |
executionPrice | string | Effective execution price (WAD) |
confidence | number | Route confidence (0-1) |
prices | array | Oracle price data per token |
Step Fees
| Field | Type | Description |
|---|---|---|
swapFee | string | Base swap fee (raw amount) |
swapFeePct | string | Swap fee percentage (WAD) |
takerFee | string | Taker fee (raw amount) |
takerFeePct | string | Taker fee percentage (WAD) |
slippageFee | string | Dynamic slippage fee (raw amount) |
slippagePct | string | Slippage percentage (WAD) |
wbfFee | string | Weight Breaking Fee (raw amount) |
wbfFeePct | string | WBF percentage (WAD) |
wbrReward | string | Weight Breaking Reward (raw amount) |
token | string | Fee denomination token |
Incentive
| Field | Type | Description |
|---|---|---|
maxBps | number | Max incentive in basis points |
displayPct | string | Human-readable percentage |
tokenOut | string | Token receiving the incentive |
isImproving | boolean | Whether trade improves pool balance |
Prices
| Field | Type | Description |
|---|---|---|
pythPrice | string | Pyth oracle price (WAD) |
cexPrice | string | CEX reference price (WAD) |
blendFactor | string | Blend ratio (WAD): 0 = Pyth, 1e18 = CEX |
blendedPrice | string | Final price used for calculations |
Errors
| Code | Reason |
|---|---|
400 | Invalid tokens, missing amount, or invalid parameters |