Skip to content

Aggregator Quote

POST /aggregator/quote

Returns a swap quote with signed calldata ready for on-chain execution. Designed for aggregator integrations that submit transactions directly.

Request

bash
curl -X POST https://mainnet.router.ryze.pro/aggregator/quote \
  -H "Content-Type: application/json" \
  -d '{
    "tokenIn": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "tokenOut": "0x4200000000000000000000000000000000000006",
    "amountIn": "100000000",
    "sender": "0xYourWalletAddress",
    "slippageBps": 50,
    "deadline": 1713200000
  }'

Parameters

FieldTypeRequiredDefaultDescription
tokenInstringYes--Input token address
tokenOutstringYes--Output token address
amountInstringYes--Input amount (raw units)
senderstringYes--User wallet address
slippageBpsnumberNo50Slippage tolerance in bps
deadlinenumberNonow + 1800sTransaction deadline (Unix)

Response

json
{
  "tokenA": {
    "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "symbol": "USDC",
    "decimals": 6
  },
  "tokenB": {
    "address": "0x4200000000000000000000000000000000000006",
    "symbol": "WETH",
    "decimals": 18
  },
  "tokenAToB": {
    "amountIn": "100000000",
    "amountOut": "62500000000000000",
    "minAmountOut": "62187500000000000",
    "priceImpact": "100000000000000",
    "effectiveRate": "1598400000000000000000",
    "hops": [
      {
        "poolAddress": "0x7B41aA91947398CD9244AD4e314C253D9B1B5206",
        "tokenIn": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "tokenOut": "0x4200000000000000000000000000000000000006"
      }
    ],
    "txData": "0x..."
  },
  "lastUpdated": "2026-04-15T12:00:00Z",
  "priceA": "1000000000000000000",
  "priceB": "1600250000000000000000"
}

Response Fields

FieldTypeDescription
tokenAobjectInput token metadata
tokenBobjectOutput token metadata
amountInstringInput amount (raw)
amountOutstringExpected output (raw)
minAmountOutstringMinimum output after slippage
priceImpactstringPrice impact (WAD)
effectiveRatestringExecution rate (WAD)
hopsarrayRoute details
txDatastringHex-encoded calldata
priceA / priceBstringOracle prices (WAD)

txData

The txData field contains hex-encoded calldata for MultiHopRouter.swapExactIn. It includes:

  1. Swap parameters (tokenIn, tokenOut, amountIn, minAmountOut, path, deadline, recipient)
  2. Pyth oracle price update bytes
  3. Signed CEX price data (v, r, s signatures)

To execute the swap, send a transaction to the MultiHopRouter contract with this calldata:

javascript
const tx = await walletClient.sendTransaction({
  to: MULTIHOP_ROUTER_ADDRESS,
  data: response.tokenAToB.txData,
  value: 0n, // unless tokenIn is native ETH
});

Errors

CodeReason
400Invalid request, missing fields, invalid sender, or invalid amount
404No pool found for the token pair