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.

RelayPoolNativeGateway

Solidity API

RelayPoolNativeGateway

Gateway contract for depositing and withdrawing native ETH to/from WETH-based RelayPools

*Handles wrapping/unwrapping of ETH and provides slippage protection for all operations*

EthTransferFailed

error EthTransferFailed()

Error when ETH transfer fails

OnlyWethCanSendEth

error OnlyWethCanSendEth()

Error when contract receives ETH from non-WETH address

RemainingEth

error RemainingEth()

Error when ETH remains in contract after operation

SlippageExceeded

error SlippageExceeded()

Error when slippage protection is triggered

WETH

contract IWETH WETH

The Wrapped ETH (WETH) contract

*Used to wrap/unwrap native ETH for pool operations*

constructor

constructor(address wethAddress) public

Initializes the gateway with the WETH contract address

Parameters

NameTypeDescription
wethAddressaddressAddress of the Wrapped Native token contract

deposit

function deposit(address pool, address receiver, uint256 minSharesOut) external payable returns (uint256 shares)

Deposits native ETH into a WETH-based pool

*Wraps ETH to WETH, then deposits to the pool with slippage protection*

Parameters

NameTypeDescription
pooladdressThe address of the ERC4626 pool to deposit into
receiveraddressThe address that will receive the pool shares
minSharesOutuint256Minimum amount of shares to receive (slippage protection)

Return Values

NameTypeDescription
sharesuint256The amount of pool shares minted to the receiver

mint

function mint(address pool, address receiver, uint256 minSharesOut) external payable returns (uint256 shares)

Mints pool shares by depositing native ETH

*Wraps ETH, calculates shares, then mints with slippage protection*

Parameters

NameTypeDescription
pooladdressThe address of the ERC4626 pool to mint shares from
receiveraddressThe address that will receive the pool shares
minSharesOutuint256Minimum amount of shares to receive (slippage protection)

Return Values

NameTypeDescription
sharesuint256The amount of pool shares minted to the receiver

withdraw

function withdraw(address pool, uint256 assets, address receiver, uint256 maxSharesIn) external virtual returns (uint256 shares)

Withdraws a specific amount of native ETH from a WETH-based pool

*Withdraws WETH from pool, unwraps to ETH, with slippage protection*

Parameters

NameTypeDescription
pooladdressThe address of the ERC4626 pool to withdraw from
assetsuint256Amount of native ETH to withdraw
receiveraddressThe address that will receive the native ETH
maxSharesInuint256Maximum amount of shares to burn (slippage protection)

Return Values

NameTypeDescription
sharesuint256The amount of pool shares burned

redeem

function redeem(address pool, uint256 shares, address receiver, uint256 minAssetsOut) external virtual returns (uint256 assets)

Redeems pool shares for native ETH

*Redeems shares for WETH, unwraps to ETH, with slippage protection*

Parameters

NameTypeDescription
pooladdressThe address of the ERC4626 pool to redeem from
sharesuint256Amount of pool shares to redeem
receiveraddressThe address that will receive the native ETH
minAssetsOutuint256Minimum amount of ETH to receive (slippage protection)

Return Values

NameTypeDescription
assetsuint256The amount of native ETH sent to receiver

safeTransferETH

function safeTransferETH(address to, uint256 value) internal

Safely transfers ETH to an address

*Reverts if the ETH transfer fails*

Parameters

NameTypeDescription
toaddressRecipient of the ETH transfer
valueuint256Amount of ETH to transfer

receive

receive() external payable

Receives ETH only from WETH contract

*Required for WETH unwrapping operations*

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

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