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.

Refunds

Learn how Relay handles refunds.

The Relay platform tracks refunds when a bridge or swap cannot complete. Solvers can return funds on the origin chain instead of filling on the destination chain. This page describes platform refund behavior; see protocol refunds for how those transfers settle.

What is a refund?

A refund returns funds to a user when a swap or bridge cannot be completed. Refunds are paid on the origin chain to the refundTo address supplied on the quote. If refundTo is not set, automatic refund is disabled.

What causes refunds to happen?

A refund is triggered when the swap or bridge fails to complete. A failure can occur for a variety of reasons including but not exclusive to:

  • *Transactions Reverting:* Before giving a quote, we simulate the transaction to ensure it will succeed.

Between the time the quote is given and the user accepts & deposits funds, the transaction could revert. Transactions reverting could be caused by if there is a contested mint or execution was delayed.

  • *User's Wallet Address is Different Than Transaction Depositing Address:* This happens when the user

switches wallets right before signing the transaction. Users must execute the transaction with the wallet address that received the quote.

  • *User Deposits Too Little:* The user explicitly deposits a lower amount than Relay requested.
  • *Destination Chain is Unavailable:* Occasionally, the destination chain will

have a network outage beyond our control. An example could be an RPC that is down or the chain is experiencing a large reorganization.

  • *User Sends Deposits With the Same Request ID in the Calldata Multiple Times*
  • *User Send Deposits Without a Request ID in the Calldata*
  • *Quote Regeneration leads to high slippage*: Quotes are regenerated upon execution. Each quote contains a currencyOut.minimumAmount which details the minimum a user will receive, if regeneration leads to a lower currencyOut.minimumAmount, the user will be refunded.

Refund amounts and costs

The refund amount may be less than what you originally deposited due to several factors:

  • Gas costs are deducted: The gas cost of processing the refund transaction is deducted from the refunded amount.
  • Origin swaps: If your transaction included an origin swap, you will only receive what the depository contract actually received after the swap, not your original deposit amount.

For example, if your deposit transaction swaps a memecoin into USDC, the refundable amount is the USDC deposited after that swap, minus refund gas costs.

Fees on refunded requests

Relay does not keep Platform Fees or app fees on a refunded request.

FeeTreatment on a refunded request
Platform FeesNot retained
App feesNot collected

On a refunded request, paidAppFees on /requests/v2 is empty or zero. To check, see Verifying Fee Collection.

When is there no refund given?

If the refund amount is not enough to cover the cost of gas, Relay will mark the bridge or swap as failed & no refund will be sent.

What currency is used for refunds?

The refund currency can vary by route. Relay will always attempt to refund the user in the original currency they sent. Usually this is one of the currencies in the solverCurrencies in the chain api response, which are native or stable coins.

Are refunds automatic & instant?

Automatic refunds require `refundTo` to be set and a refundable balance large enough to cover gas. A solver submits the refund when the route's checks permit it; completion depends on the origin chain. Screening failures and other execution errors can prevent automatic refunds.

How can I force a refund for testing purposes?

You can force a refund by passing debug-force-refund as the referrer.

curl -X POST \
  'https://api.relay.link/quote/v2' \
  -H 'Content-Type: application/json' \
  -d '{
    "referrer": "debug-force-refund",
    "user":"0xf3d63166F0Ca56C3c1A3508FcE03Ff0Cf3Fb691e",
    "originChainId":8453,
    "destinationChainId": 10,
    "originCurrency":"0x0000000000000000000000000000000000000000",
    "destinationCurrency":"0x0000000000000000000000000000000000000000",
    "recipient":"0xf3d63166F0Ca56C3c1A3508FcE03Ff0Cf3Fb691e",
    "tradeType":"EXACT_INPUT",
    "amount":"1000000000000000000"
  }'

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

PreviousCost & Fee StructureNextInput Validation
Relay© 2026 Uneven Labs, Inc. All rights reserved.XGitHubSupport