> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rialto.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Requesting a Quote

> Request a firm quote and receive an executable transaction for an exact-input swap.

## Endpoint

```http theme={null}
GET /quote
```

Auth: requires an API key with quote access. Returns the best route, expected
output, route legs, platform fee, estimated network fee, and an executable
transaction for an exact-input swap.

## Required parameters

| Param | Description |
| - | - |
| sell\_token | Canonical `0x`-prefixed token address. Symbols are not accepted. |
| buy\_token | Canonical `0x`-prefixed token address. Symbols are not accepted. |
| sell\_amount | Human decimal sell amount, for example 0.01. |
| taker | Non-zero wallet address that will receive output. |
| slippage\_bps | Max slippage in basis points. 50 means 0.50%. |

slippageBps is also accepted as an alias for slippage\_bps.

Pass the canonical `address` returned by a token-discovery endpoint. Symbol
values such as `WETH` or `USDG` are rejected because symbols are not unique.

## Optional parameters

| Param | Description |
| - | - |
| chain\_id | Chain id. Defaults to the server's configured chain. |
| max\_hops | Route-depth hint; final route policy is controlled server-side. |
| permit2\_owner | Non-zero Permit2 token owner for gasless or relayed ERC20 swaps. For gasless, this must equal taker. Also accepts permit2Owner and permitOwner. |
| settlement | Fund-pull preference: auto, permit2, or allowance. Defaults to auto. Also accepts settlementPreference. |
| swap\_fee\_bps | Integrator fee in basis points. Requires an integrator key. |
| swap\_fee\_token | Accepted for API compatibility; current routing selects the fee token. |
| swap\_fee\_recipient | Ignored. The payout wallet is bound to the API key. |
| gasless\_relay | Set to true only when Rialto will submit the transaction through `/gasless/submit`. Also accepts gaslessRelay. |

## Example

```bash theme={null}
API_KEY='rialto_live_example.redacted_secret'

curl -sS 'https://rialto-trade-api.rialto.xyz/quote?sell_token=0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73&buy_token=0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168&sell_amount=0.01&taker=<taker_wallet_address>&slippage_bps=50' \
  -H "Authorization: Bearer $API_KEY"
```

## Example response

```json theme={null}
{
  "quote_id": "b7b0a3d8-9f6a-4f4a-92d2-1b0e4b5d0c6a",
  "settlement": "permit2",
  "tx": {
    "to": "<rialto_router_address_from_quote>",
    "data": "0xdbefe2d6...",
    "value": "0",
    "estimated_gas": 255053,
    "signature_offset": 548
  },
  "permit2": {
    "domain": {
      "name": "Permit2",
      "chainId": 4663,
      "verifyingContract": "<permit2_contract_address>"
    },
    "types": {
      "EIP712Domain": [
        { "name": "name", "type": "string" },
        { "name": "chainId", "type": "uint256" },
        { "name": "verifyingContract", "type": "address" }
      ],
      "PermitWitnessTransferFrom": [
        { "name": "permitted", "type": "TokenPermissions" },
        { "name": "spender", "type": "address" },
        { "name": "nonce", "type": "uint256" },
        { "name": "deadline", "type": "uint256" },
        { "name": "witness", "type": "RialtoSwap" }
      ],
      "TokenPermissions": [
        { "name": "token", "type": "address" },
        { "name": "amount", "type": "uint256" }
      ],
      "RialtoSwap": [
        { "name": "recipient", "type": "address" },
        { "name": "buyToken", "type": "address" },
        { "name": "minBuyAmount", "type": "uint256" },
        { "name": "deadline", "type": "uint64" },
        { "name": "feeRecipient", "type": "address" },
        { "name": "srcBps", "type": "uint16" },
        { "name": "dstBps", "type": "uint16" },
        { "name": "referralCode", "type": "bytes32" },
        { "name": "quoteId", "type": "bytes32" },
        { "name": "actionsHash", "type": "bytes32" }
      ]
    },
    "primaryType": "PermitWitnessTransferFrom",
    "message": {
      "permitted": {
        "token": "<sell_token_address>",
        "amount": "10000000000000000"
      },
      "spender": "<rialto_router_address_from_quote>",
      "nonce": "102222442441090043455808165797985926558",
      "deadline": "1780300214",
      "witness": {
        "recipient": "<taker_wallet_address>",
        "buyToken": "<buy_token_address>",
        "minBuyAmount": "19701021",
        "deadline": 1780300214,
        "feeRecipient": "<zero_address>",
        "srcBps": 0,
        "dstBps": 5,
        "referralCode": "<zero_bytes32>",
        "quoteId": "<quote_id_bytes32>",
        "actionsHash": "<actions_hash_bytes32>"
      }
    },
    "nonce": "102222442441090043455808165797985926558",
    "deadline": 1780300214
  },
  "issues": {
    "allowance": {
      "actual": "0",
      "spender": "<permit2_contract_address>"
    },
    "balance": null,
    "simulationIncomplete": false,
    "invalidSourcesPassed": []
  },
  "chain_id": 4663,
  "sell_token": "<sell_token_address>",
  "buy_token": "<buy_token_address>",
  "sell_amount": "10000000000000000",
  "buy_amount": "19800022",
  "min_buy_amount": "19701021",
  "platform_fee": {
    "total_bps": 5,
    "fees": [
      {
        "side": "destination",
        "token": "<buy_token_address>",
        "symbol": "USDG",
        "decimals": 6,
        "bps": "5",
        "bps_x100": 500,
        "amount": "9900",
        "amount_decimal": "0.0099",
        "recipient": "<rialto_fee_recipient_address>"
      }
    ]
  },
  "network_fee": {
    "token": "<native_eth_sentinel>",
    "symbol": "ETH",
    "decimals": 18,
    "gas": "226046",
    "gas_price": "20000000",
    "gas_price_gwei": "0.02",
    "amount": "4520920000000",
    "amount_gwei": "4520.92",
    "amount_eth": "0.00000452092"
  },
  "taker": "<taker_wallet_address>",
  "slippage_bps": 50,
  "candidate_paths": 8,
  "successful_routes": 7,
  "failed_routes": 1,
  "route": {
    "sell_amount": "10000000000000000",
    "buy_amount": "19800022",
    "gas_estimate": 106046,
    "legs": [
      {
        "pool_id": "uniswap-v3:chain-4663:<pool_address>:100",
        "sell_token": "<sell_token_address>",
        "buy_token": "<buy_token_address>",
        "sell_amount": "10000000000000000",
        "buy_amount": "19809926"
      }
    ]
  }
}
```

Exact amounts and route legs depend on live liquidity.

## Key response fields

| Field | Description |
| - | - |
| chain\_id | Chain id for the quote. |
| quote\_id | UUID handle for the server-stored quote. Bound into the Permit2 witness as a bytes32 quoteId, so the signature is tied to this exact quote. |
| settlement | Execution mode: permit2 or allowance. |
| tx | Ready-to-send transaction object. In direct flow, send this from the taker wallet after any required approval or signature step. In gasless flow, Rialto submits this transaction after /gasless/submit. |
| permit2 | EIP-712 typed-data payload. Present only for Permit2 settlement. The `permit2_owner` requested for a gasless quote must sign it. |
| issues | Frontend blockers and execution hints for balance and allowance. |
| sell\_token | Sell token address. |
| buy\_token | Buy token address. |
| sell\_amount | Raw integer sell amount in token smallest units. |
| buy\_amount | Expected raw integer buy amount before slippage. |
| min\_buy\_amount | Slippage-protected raw minimum buy amount encoded into tx.data. |
| platform\_fee | Platform fee breakdown. |
| integrator\_fee | Present when an integrator fee was accepted for this key. |
| referral / referral\_fee | Present when referral attribution or referral fee policy applies. |
| network\_fee | Estimated transaction gas cost, if available. |
| taker | Recipient/taker address. |
| slippage\_bps | Slippage tolerance used for quote. |
| route.legs | Ordered route legs and pools. |

## The issues object

Inspect issues before submitting. It flags conditions that should block or gate
execution.

| Field | Meaning |
| - | - |
| issues.balance | Non-null when the taker lacks enough sell-token balance. Do not submit. |
| issues.allowance | Non-null when an ERC20 approval is needed before submitting tx. Approve issues.allowance.spender for at least sell\_amount. |
| issues.simulationIncomplete | true when the backend could not complete all quote simulation checks. |
| issues.invalidSourcesPassed | Reserved field; currently an empty array. |

## Notes

Quotes depend on live liquidity and can go stale quickly. Request a fresh quote if
the user waits. The exact amounts and route legs depend on live liquidity at
request time.

Use the returned settlement mode as the source of truth when executing a quote.
See [Settlement Modes](/developers/settlement-modes) for when to request Permit2
or allowance mode explicitly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.