Skip to main content

What the API does

The Swap API turns an order into an executable transaction. You request a quote for a sell token, buy token, and amount, and Rialto returns the best route, the expected output, the fee breakdown, and a ready-to-send transaction for the RialtoRouter contract. The integration boundary is intentionally small: call the quote endpoint, then submit the returned transaction. You never build route calldata, pool calls, fee logic, slippage math, Permit2 witnesses, or settlement actions yourself.

Base URL

https://rialto-trade-api.rialto.xyz
Protected endpoints require an API key, passed as a bearer token:
Authorization: Bearer <api_key>
See Authentication and API Keys for how to obtain and scope a key.

Execution flows

Rialto supports two execution flows. Each quote tells you which settlement mode applies; choose your handling from the response rather than assuming.
  • Taker-submitted. The user’s wallet submits the onchain transaction and pays gas. Use this for native-token sells and for any flow where the taker broadcasts.
  • Gasless relayer. The user signs a Permit2 message and Rialto broadcasts the transaction and pays gas. Available for ERC20 sells.

Quickstart

  1. Call the tokens endpoint to discover supported tokens.
  2. Call the quote endpoint with the sell token, buy token, amount, taker, and slippage.
  3. Inspect the quote’s issues for balance and allowance blockers. Ask the user to approve if issues.allowance is present.
  4. If the quote includes a Permit2 payload, have the taker sign the returned EIP-712 message and insert the signature into tx.data at tx.signature_offset.
  5. Submit the returned transaction from the taker wallet, or for gasless, submit the signature to /gasless/submit and poll /gasless/status/.
The pages that follow detail authentication, the tokens and quote endpoints, executing a quote, the gasless flow, integrator onboarding, fees, and errors.

Reference

Full API reference: https://github.com/rialto-plds/rialto-api-docs/blob/main/RIALTO_SWAP_API.md