Skip to main content
Three tools move value between chains and swap tokens on EVM chains through Relay. For the plain-language version, read Bridge and swap. Every tool needs authentication; see Authentication.

Tools

A transfer usually takes a quote, then an execute. The third tool checks on it afterwards.

Request shape

A quote request looks like this:
The example quotes 10 USDC from Polygon to Base. Here is what each field means: Do not pass the user’s wallet address as the sender. The server fills it in.

Common chain ids

Chain ids are numbers. These are the ones you will use most: Solana uses a Relay-specific id here, not the word solana that the onchain tools take.

Rules

relay_execute only moves funds between the user’s own wallets. A recipient that is not one of them is refused by the server. Resolve the user’s addresses with get_wallet_addresses and the polymarket action get_deposit_wallet. If the user wants to pay someone else, point them to the Wallet page in the app. Do not try another route around it.
  • Every bridge and swap needs the user’s confirmation, and nothing here is financial advice.
  • Quote first, then confirm. Show the origin chain, token and amount, the destination chain, token and expected amount, and the route. Call relay_execute only after a yes.
  • Requote on any change. Quotes expire.
  • Named tokens need checking. If the user named a token by symbol, resolve it with onchain_search_tokens scoped to the destination chain, show a chart link with market cap, liquidity and volume, and warn if the token is thin or volatile.
  • Solana to Solana is not a Relay route. Use the Jupiter tools on the Onchain tools page.
  • Same chain, same token is a send. Use onchain_send_token.

Statuses

relay_get_status returns one of:

Tips

  • On a route that touches Solana, the gas top-up on the destination chain is switched off. Make sure the user holds native coin there.
  • A 412 on a route that starts on Solana means the user’s Solana wallet is not yet enabled for agent trading.
  • To fund Hyperliquid from another chain, bridge USDC to Arbitrum (42161), then send it to the address from the hyperliquid action get_deposit_address.
  • If a quote fails, the pair may have no route. Try USDC or the native coin as the destination.

Next

Bridge and swap

The plain-language guide.

Wallet and onramp tools

Resolve addresses and fund from fiat.