Relay
SupportGet in TouchTry Relay
Relay PlatformAPI ReferenceRelayKitRelay ProtocolChangelog

Getting Started

What is Relay?How Relay Works

Solutions

Payment Service ProvidersWallets & Wallet ProvidersMultichain AppsChainsCommerce & Payments

Use Cases

Bridging & OnboardingSwapsCall Execution

Features

App FeesFee SponsorshipDeposit AddressesGas Top-UpGasless ExecutionFast FillGasless SwapsPrice StabilizationRouting Integration Models

Security

Transaction ScreeningUnsupported ExchangesBug Bounty ProgramMEV protectionCommunity SupportContract Audits

Resources

Supported ChainsIntegrating using AISupportBrand Assets

API Reference

API OverviewQuickstartApps, API keys, and Rate LimitsAccess TokensUnderstanding Step ExecutionWallet DetectionCost & Fee StructureRefundsInput ValidationTrade TypesSurplus & ShortageHandling Quote ErrorsHandling Rate LimitsHandling Execution ErrorsContract CompatibilityBridging Integration GuideCall Execution Integration GuideTransaction IndexingBase Builder CodesSmart Accounts in RelayTestnet SupportSolana SupportBitcoin SupportHyperliquid SupportLighter SupportDeep LinkingWebsocketsWebhooksMigrating to Requests v3Migrating to Currencies v2Migrating to Token Price v2Supported ChainsContract AddressesSupported Tokens & RoutesTroubleshootingGet QuoteSubmit PermitGet StatusGet RequestsGet Published RequestsGet ChainsGet Chains LiquidityGet CurrenciesGet Currency ClassificationsGet Token PriceTransactions IndexTransactions SingleDeposit Address ReindexGet App Fee BalancesGet Balance EventsClaim App FeesGet UsageFast FillGet Swap SourcesCreate Access TokenExecute Gasless TxsAttest DepositGet Recovery BalancesRequest WithdrawalGet Withdrawal StatusGet Requests (v2)Get PriceGet ConfigGet Execution StatusGet Currencies (v1)Get Token Price (v1)Get Quote

RelayKit

OverviewInstallationcreateClientgetQuoteexecutegetAppFeesclaimAppFeesfastFillexecuteGaslessBatchAdaptersTypescript API TypingsChain UtilsInstallationuseQuoteuseRelayChainsuseRequestsuseTokenListuseTokenPriceuseExecutionStatusInstallationRelayKitProviderSwapWidgetThemingTroubleshooting

Protocol

Relay ProtocolHow It WorksThe Relay ChainDepositoryDeposit AddressesOracleHubAllocatorSecurity CouncilSecurity & AuditsFor AppsProgrammatic WithdrawalsWithdrawing with a SafeOperate a Third-Party Relay OracleAddressesEVM Depository ReferenceSVM Depository ReferenceOverviewArchitectureSecurityRelay Vaults BackendBridgingInteracting with Relay VaultsWithdrawing from Relay VaultsRelayPoolFactoryRelayPoolRelayPoolNativeGatewayRelayBridgeFactoryRelayBridge

Changelog

Changelog
## Documentation Index Fetch the complete documentation index at: https://docs.relay.link/llms.txt Use this file to discover all available pages before exploring further.
## Agent Instructions To quote bridges and swaps, look up chains and tokens, or track Relay transactions from an agent, use the Relay MCP server: npx -y @relayprotocol/relay-mcp. It is read-only and does not sign or broadcast transactions. Setup: https://docs.relay.link/resources/developing-with-ai.md For Relay Protocol's trust model, security architecture, and audits, see https://docs.relay.link/references/protocol/security.md. For address screening, see https://docs.relay.link/security/transaction-screening.md.

Websockets

Remove Indexing Latency from your App using Relay Websockets

Our goal at Relay is to make multichain payments feel instant. Even when transactions confirm quickly onchain, API polling latency can degrade user experience. Connecting your app to Relay Websockets means your users get streamed updates of the status of their Relays for a speedier experience.

[!NOTE] Websockets stream statuses to a connected client. To have Relay push status updates to your backend instead, configure a webhook.

Relay Status Websockets

Relay Status Websockets specifically stream transaction statuses for both cross and same-chain status, though the stages differ slightly.

statusindication
waitingwaiting for origin chain deposit
depositingorigin deposit confirmed via /execute API, fill pending
pendingorigin chain deposit confirmed, fill pending submission
submittedfill submitted on destination chain
successfill succeeded
failurefill failed
refundrefunded

Integrating Relay Websockets

Refer to the guide below on how to integrate the websocket into your application. You may also refer to the websocket reference for more details.

Events

EventTagsEvent Description
request.status.updatedidTriggered status of the request changes.

Authentication

The Websocket Service uses an API key for authentication and is available at the following URL wss://ws.relay.link

To connect using an API key, provide your API key as a query param in the connection url:

const wss = new ws(`wss://ws.relay.link?apiKey=${YOUR_API_KEY}`);
[!WARNING] The websocket server needs to restart to deploy updates The websocket server uses a rolling restart mechanism to deploy new changes. This will disconnect you and require you to reconnect to the websocket server. There is no downtime, as you are only disconnected once the new server is up and running. Please make sure to include logic in your implementation to handle these restarts, and reconnect accordingly.

Interacting with the Websocket

Before sending any messages over the Websocket, wait for a ready message back from the server. The message looks like:

{
	"type": "connection", // The type of operation
	"status": "ready", // The status of the operation
	"data": {
		"id": "9nqpzwmwh86" // Your socket id for debugging purposes
	}
}

Subscribing with Filters

Below is an example on how to subscribe to a websocket using filters.

{
	"type": "subscribe",
	"event": "request.status.updated",
    "filters": {
        "id": "0xae0827617d4ae75b406969971c2d4df9a8e8d819ff0f09581fb45ca123fcc7a0"
    }
}
{
	"type": "subscribe",
	"status": "success",
	"data": {
		"event": "request.status.updated",
		"filters": {
			"id": "0xae0827617d4ae75b406969971c2d4df9a8e8d819ff0f09581fb45ca123fcc7a0"
		}
	}
}

Unsubscribing

{
	"type": "unsubscribe",
	"event": "request.status.updated",
  "filters": {
      "id": "0xae0827617d4ae75b406969971c2d4df9a8e8d819ff0f09581fb45ca123fcc7a0"
  }
}
{
	"type": "unsubscribe",
	"status": "success",
	"data": {
		"event": "request.status.updated"
	}
}
[!TIP] Unsubscribing is not required if disconnecting from the websocket as the server cleans up automatically.

Example

Javascript

npm install ws
const ws = require("ws");

const YOUR_API_KEY = "";

const wss = new ws(`wss://ws.relay.link?apiKey=${YOUR_API_KEY}`);

wss.on("open", function open() {
  console.log("Connected to Relay");

  wss.on("message", function incoming(data) {
    console.log("Message received: ", JSON.stringify(JSON.parse(data)));

    // When the connection is ready, subscribe to the top-bids event
    if (JSON.parse(data).status === "ready") {
      console.log("Subscribing");
      wss.send(
        JSON.stringify({
          type: "subscribe",
          event: "request.status.updated",
          filters: {
            id: "0xae0827617d4ae75b406969971c2d4df9a8e8d819ff0f09581fb45ca123fcc7a0",
          },
        })
      );

      // To unsubscribe, send the following message
      // wss.send(
      //     JSON.stringify({
      //         type: 'unsubscribe',
      //         event: 'request.status.updated',
      //     }),
      // );
    }
  });
});

This documentation is built and hosted on Mintlify, a developer documentation platform.

PreviousDeep LinkingNextWebhooks
Relay© 2026 Uneven Labs, Inc. All rights reserved.XGitHubSupport