Rialto Swap API
A swap API lets an application request a token trade and receive the information needed to execute it. Developers can use it to add trading features to an app or execute buys and sells within an automated workflow. The application controls when and why to trade, while the API supplies the route and transaction.
Rialto is a trading platform with a Swap API for developers integrating token trading into their own applications. The Swap API is also called the Quote API. A request describes the trade, and the response includes pricing, fees, and a transaction for the RialtoRouter contract.
You can use the Rialto Swap API to swap stock tokens and crypto assets on Robinhood Chain.
Developers can use the Swap API to build trading and asset conversion features into a range of products:
- Trading terminals
- Wallets
- Launchpads
- Lending protocols
- Agentic finance applications
- Neobanks
- Protocol treasuries
Solvers and liquidators can also interact with the API programmatically to request quotes and execute the buys and sells their workflows require. Rialto supplies routing and an executable transaction, while the integrating system handles its own order fulfilment or liquidation logic.
A quote request can be as small as this server-side cURL call. Set the environment variables to your API key, discovered token addresses, taker wallet, and supported chain ID before running it:
curl --fail-with-body --silent --show-error --get \
'https://rialto-trade-api.rialto.xyz/quote' \
-H "Authorization: Bearer ${RIALTO_API_KEY:?Set your API key}" \
--data-urlencode "sell_token=${SELL_TOKEN:?Set the sell token address}" \
--data-urlencode "buy_token=${BUY_TOKEN:?Set the buy token address}" \
--data-urlencode "taker=${TAKER:?Set the taker wallet address}" \
--data-urlencode "chain_id=${CHAIN_ID:?Set the supported chain ID}" \
--data-urlencode 'sell_amount=0.01' \
--data-urlencode 'slippage_bps=50'
Here, 0.01 is a human-readable sell amount and 50 means 0.5% slippage. This requests a quote; it does not execute a trade. The endpoint is GET /quote within the Swap API.
Consider a wallet adding a swap screen. The user chooses two tokens and an amount. The wallet needs to show a usable quote, collect authorisation, and track the result. It also needs liquidity behind that screen. Rialto connects the application to supported liquidity sources through one API integration.
The routing engine samples candidate sources against current onchain state for the requested order size. It compares output after accounting for network costs and selects a route. Sources include propAMMs and conventional DEX pools, and an order can use more than one source when that improves the result.
Order size matters. A source that offers attractive pricing for a small trade may offer different terms for a larger one. Gas matters too: a route with more output can lose its advantage if execution costs more. These are reasons to request a quote for the user’s actual amount.
The API supplies the transaction, but the integrating application or system still has work to do. It must check balance and allowance issues, obtain the required authorisation, and handle confirmation. A user-facing app also needs to present the trade clearly. Keep the API key on your backend and validate trade requests before sending them to Rialto.
You can generate an API key at rialto.xyz/partners
The Swap API supports wallet-submitted swaps and eligible gasless swaps. In the direct flow, the taker submits the returned transaction. In the gasless flow, the user signs and Rialto relays it. The quote’s returned settlement mode determines how to handle authorisation.
Liquidity providers integrate on the other side of the router. A propAMM exposes onchain quoting and settlement functions so its liquidity can compete for routes. Application developers use the Swap API; market makers implement the liquidity-source interface.
Start with one supported pair and a quote request. Once quoting works, add authorisation, execution, and transaction status to your application or automated workflow.
You can read more about the Rialto Swap API in our documentation: https://docs.rialto.xyz/developers/swap-api-overview