## 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.Get Price
This API returns a lightweight quote without calldata or steps.
[!WARNING] This API has been replaced by the Get Quote API, which supports bridging, swapping and calling through a single unified API.
OpenAPI
openapi: 3.0.3
info:
title: Cross-chain solver
version: 1.0.0
servers:
- url: https://api.relay.link
description: Mainnet API
- url: https://api.testnets.relay.link
description: Testnet API
security: []
paths:
/price:
post:
requestBody:
content:
application/json:
schema:
properties:
user:
type: string
description: >-
Address that is depositing funds on the origin chain and
submitting transactions or signatures
recipient:
type: string
description: >-
Address that is receiving the funds on the destination
chain, if not specified then this will default to the user
address
originChainId:
type: number
destinationChainId:
type: number
originCurrency:
type: string
destinationCurrency:
type: string
amount:
type: string
pattern: ^[0-9]+$
description: >-
Amount to swap as the base amount (can be switched to exact
input/output using the dedicated flag), denoted in the
smallest unit of the specified currency (e.g., wei for ETH)
tradeType:
type: string
description: >-
Whether to use the amount as the output or the input for the
basis of the swap
enum:
- EXACT_INPUT
- EXACT_OUTPUT
- EXPECTED_OUTPUT
txs:
type: array
items:
type: object
properties:
to:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
value:
type: string
data:
type: string
pattern: ^0x[a-fA-F0-9]*$
referrer:
type: string
refundTo:
type: string
description: >-
Address to send the refund to in the case of failure, if not
specified then the recipient address or user address is used
refundOnOrigin:
type: boolean
description: Always refund on the origin chain in case of any issues
deprecated: true
useExternalLiquidity:
type: boolean
deprecated: true
description: >-
Deprecated: canonical+ bridging has been removed and this
flag is ignored
useFallbacks:
type: boolean
deprecated: true
description: >-
Deprecated: fallback routes have been removed and this flag
is ignored
usePermit:
type: boolean
description: >-
Enable this to use permit (eip3009) when bridging, only
works on supported currency such as usdc
useDepositAddress:
type: boolean
description: >-
Enable this to use a deposit address when bridging, in
scenarios where calldata cannot be sent alongside the
transaction. only works on native currency bridges.
slippageTolerance:
type: string
pattern: ^([0-9]{1,4}|10000)$
description: >-
Slippage tolerance for the swap, if not specified then the
slippage tolerance is automatically calculated to avoid
front-running. This value is in basis points (1/100th of a
percent), e.g. 50 for 0.5% slippage. Must be 0–10000 bps.
appFees:
type: array
items:
type: object
properties:
recipient:
type: string
pattern: ^0x[a-fA-F0-9]{40}$
description: Address that will receive the app fee
fee:
type: string
pattern: ^[0-9]+$
description: >-
App fees to be charged for execution in basis points,
e.g. 100 = 1%
description: App fees to be charged for execution
required:
- user
- originChainId
- destinationChainId
- originCurrency
- destinationCurrency
- amount
- tradeType
type: object
required: true
responses:
'200':
description: Default Response
content:
application/json:
schema:
type: object
properties:
fees:
type: object
properties:
gas:
description: Origin chain gas fee
type: object
example:
currency:
chainId: 8453
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
symbol: USDC
name: USD Coin
decimals: 6
metadata:
logoURI: >-
https://ethereum-optimism.github.io/data/USDC/logo.png
verified: false
isNative: false
amount: '30754920'
amountFormatted: '30.75492'
amountUsd: '30.901612'
minimumAmount: '30454920'
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
minimumAmount:
type: string
relayer:
description: >-
Combination of the relayerGas and relayerService to
give you the full relayer fee
type: object
example:
currency:
chainId: 8453
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
symbol: USDC
name: USD Coin
decimals: 6
metadata:
logoURI: >-
https://ethereum-optimism.github.io/data/USDC/logo.png
verified: false
isNative: false
amount: '30754920'
amountFormatted: '30.75492'
amountUsd: '30.901612'
minimumAmount: '30454920'
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
minimumAmount:
type: string
relayerGas:
description: Destination chain gas fee
type: object
example:
currency:
chainId: 8453
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
symbol: USDC
name: USD Coin
decimals: 6
metadata:
logoURI: >-
https://ethereum-optimism.github.io/data/USDC/logo.png
verified: false
isNative: false
amount: '30754920'
amountFormatted: '30.75492'
amountUsd: '30.901612'
minimumAmount: '30454920'
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
minimumAmount:
type: string
relayerService:
description: >-
Fees paid to the relay solver, note that this value
can be negative (which represents network rewards for
moving in a direction that optimizes liquidity
distribution)
type: object
example:
currency:
chainId: 8453
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
symbol: USDC
name: USD Coin
decimals: 6
metadata:
logoURI: >-
https://ethereum-optimism.github.io/data/USDC/logo.png
verified: false
isNative: false
amount: '30754920'
amountFormatted: '30.75492'
amountUsd: '30.901612'
minimumAmount: '30454920'
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
minimumAmount:
type: string
app:
description: >-
Fees paid to the app. Currency will be the same as the
relayer fee currency. This needs to be claimed later
by the app owner and is not immediately distributed to
the app
type: object
example:
currency:
chainId: 8453
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
symbol: USDC
name: USD Coin
decimals: 6
metadata:
logoURI: >-
https://ethereum-optimism.github.io/data/USDC/logo.png
verified: false
isNative: false
amount: '30754920'
amountFormatted: '30.75492'
amountUsd: '30.901612'
minimumAmount: '30454920'
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
minimumAmount:
type: string
subsidized:
description: >-
The amount of fees for the request that are subsidized
by the request sponsor. Does not include deposit
origin gas unless it is a permit based deposit.
type: object
example:
currency:
chainId: 8453
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
symbol: USDC
name: USD Coin
decimals: 6
metadata:
logoURI: >-
https://ethereum-optimism.github.io/data/USDC/logo.png
verified: false
isNative: false
amount: '30754920'
amountFormatted: '30.75492'
amountUsd: '30.901612'
minimumAmount: '30454920'
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
minimumAmount:
type: string
details:
type: object
description: >-
A summary of the swap and what the user should expect to
happen given an input
properties:
operation:
type: string
description: >-
The operation that will be performed, possible options
are send, swap, wrap, unwrap, bridge
sender:
type: string
description: The address that deposited the funds
recipient:
type: string
description: The address that will be receiving the swap output
currencyIn:
type: object
example:
currency:
chainId: 8453
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
symbol: USDC
name: USD Coin
decimals: 6
metadata:
logoURI: >-
https://ethereum-optimism.github.io/data/USDC/logo.png
verified: false
isNative: false
amount: '30754920'
amountFormatted: '30.75492'
amountUsd: '30.901612'
minimumAmount: '30454920'
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
minimumAmount:
type: string
currencyOut:
type: object
example:
currency:
chainId: 8453
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
symbol: USDC
name: USD Coin
decimals: 6
metadata:
logoURI: >-
https://ethereum-optimism.github.io/data/USDC/logo.png
verified: false
isNative: false
amount: '30754920'
amountFormatted: '30.75492'
amountUsd: '30.901612'
minimumAmount: '30454920'
properties:
currency:
type: object
properties:
chainId:
type: number
address:
type: string
symbol:
type: string
name:
type: string
decimals:
type: number
metadata:
type: object
properties:
logoURI:
type: string
verified:
type: boolean
isNative:
type: boolean
amount:
type: string
amountFormatted:
type: string
amountUsd:
type: string
minimumAmount:
type: string
totalImpact:
type: object
description: >-
The difference between the input and output values,
including fees
properties:
usd:
type: string
percent:
type: string
swapImpact:
type: object
description: The impact of the swap, not factoring in fees
properties:
usd:
type: string
percent:
type: string
rate:
type: string
description: >-
The swap rate which is equal to 1 input unit in the
output unit, e.g. 1 USDC -> x ETH. This value can
fluctuate based on gas and fees.
slippageTolerance:
type: object
properties:
total:
type: string
description: >-
The total slippage tolerance applied to the order,
in basis points (1/100th of a percent), e.g. 50
for 0.5% slippage. The origin and destination
breakdowns are alternative allocations of this
budget and are not additive.
origin:
type: object
description: The slippage tolerance on the origin chain swap
properties:
usd:
type: string
value:
type: string
percent:
type: string
destination:
type: object
description: >-
The slippage tolerance on the destination chain
swap
properties:
usd:
type: string
value:
type: string
percent:
type: string
timeEstimate:
type: number
description: Estimated swap time in seconds
userBalance:
type: string
description: >-
The user's balance in the given currency on the origin
chain
'400':
description: Default Response
content:
application/json:
schema:
type: object
properties:
message:
type: string
errorCode:
type: string
errorData:
type: string
'401':
description: Default Response
content:
application/json:
schema:
type: object
properties:
message:
type: string
errorCode:
type: string
'500':
description: Default Response
content:
application/json:
schema:
type: object
properties:
message:
type: string
errorCode:
type: string
This documentation is built and hosted on Mintlify, a developer documentation platform.