title

Relay enables instant bridging (deposits & withdrawals) on supported chains. Learn more about how it works, how to integrate Relay, and how to get your chain supported below.

How it Works

Relay’s instant bridging is powered by cross-chain relaying. This model results in low-cost, low-latency (1-10 seconds) cross-chain transactions. When a user wishes to bridge, they receive a quote from Relay that describes the time and cost of bridging. When they accept the quote, the order is validated and they submit a transfer directly to the relayer. The relayer then fulfills the bridge on the destination chain.

While the Relay Protocol is still in development, users rely on Reservoir for order validation and relaying. Applications trust Reservoir to perform cross-chain relaying, and refund money in the case of disputes. The team will be releasing a fully decentralized and trustless protocol shortly, which you can learn more about in the Relay Protocol Documentation

Integrating Instant Bridging

The Relay SDK facilitates interacting with the underlying Relay API. To get started make sure that you install and configure the Relay SDK. Ensure that everything is configured properly before moving on to implementing the getQuote and execute action.

Instant Bridge

import { getClient, Execute } from "@reservoir0x/relay-sdk";
import { createWalletClient, http } from 'viem'

...

wallet = createWalletClient({
  account: address,
  transport: http()
})

//In this example we're bridging from zora to base

const quote = await getClient()?.actions.getQuote({
  wallet,
  chainId: 7777777, // The chain id to bridge from
  toChainId: 8453, // The chain id to bridge to
  amount: '100000000000000000', // Amount in wei to bridge
  currency: '0x0000000000000000000000000000', // ERC20 Address
  toCurrency: '0x0000000000000000000000000000', // ERC20 Address
  recipient, // A valid address to send the funds to
})

await getClient()?.actions.execute({
  quote,
  wallet,
  onProgress: (steps, fees, currentStep, currentStepItem) => {
    console.log(steps, fees, currentStep, currentStepItem)
  }
})

Adding Relay to Your Chain

Relay can easily be added to any EVM-chain, such as OP stack rollups, Arbitrum Orbit chains, or more. Please feel free to Reach Out to discuss getting your chain supported today!