Skip to content

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

FieldTypeRequiredDescription
tokenInstringYesInput token address
tokenOutstringYesOutput token address
amountInstringOne ofExact input amount in raw units
amountOutstringOne ofDesired output amount in raw units
slippageTolerancenumberYesSlippage tolerance in basis points (50 = 0.5%)
maxHopsnumberYesMaximum hops (1-3)
userAddressstringNoUser wallet for TSP session
preferredTokensstring[]NoPreferred intermediate tokens
excludedPoolsstring[]NoPool 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

FieldTypeDescription
routeIdstringUnique route identifier
typestring"single_hop" or "multi_hop"
inputobjectInput token, amount (raw), decimals
outputobjectOutput token, amount (raw), decimals
pathstring[]Token addresses in route order
stepsarrayPer-hop details
totalFeesobjectAggregated fees across all hops
incentiveobjectWBR incentive info
priceImpactstringOverall price impact (WAD)
spotPricestringOracle spot price (WAD)
executionPricestringEffective execution price (WAD)
confidencenumberRoute confidence (0-1)
pricesarrayOracle price data per token

Step Fees

FieldTypeDescription
swapFeestringBase swap fee (raw amount)
swapFeePctstringSwap fee percentage (WAD)
takerFeestringTaker fee (raw amount)
takerFeePctstringTaker fee percentage (WAD)
slippageFeestringDynamic slippage fee (raw amount)
slippagePctstringSlippage percentage (WAD)
wbfFeestringWeight Breaking Fee (raw amount)
wbfFeePctstringWBF percentage (WAD)
wbrRewardstringWeight Breaking Reward (raw amount)
tokenstringFee denomination token

Incentive

FieldTypeDescription
maxBpsnumberMax incentive in basis points
displayPctstringHuman-readable percentage
tokenOutstringToken receiving the incentive
isImprovingbooleanWhether trade improves pool balance

Prices

FieldTypeDescription
pythPricestringPyth oracle price (WAD)
cexPricestringCEX reference price (WAD)
blendFactorstringBlend ratio (WAD): 0 = Pyth, 1e18 = CEX
blendedPricestringFinal price used for calculations

Errors

CodeReason
400Invalid tokens, missing amount, or invalid parameters