Get Quote - Relay

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

Skip to main content

cURL

cURL

curl --request POST \
  --url https://api.relay.link/quote \
  --header 'Content-Type: application/json' \
  --data '
{
  "user": "0x03508bb71268bba25ecacc8f620e01866650532c",
  "originChainId": 8453,
  "destinationChainId": 10,
  "originCurrency": "0x0000000000000000000000000000000000000000",
  "destinationCurrency": "0x0000000000000000000000000000000000000000",
  "amount": "1000000000000000000",
  "tradeType": "EXACT_INPUT"
}
'
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    user: '0x03508bb71268bba25ecacc8f620e01866650532c',
    originChainId: 8453,
    destinationChainId: 10,
    originCurrency: '0x0000000000000000000000000000000000000000',
    destinationCurrency: '0x0000000000000000000000000000000000000000',
    amount: '1000000000000000000',
    tradeType: 'EXACT_INPUT'
  })
};

fetch('https://api.relay.link/quote', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.relay.link/quote"

payload = {
    "user": "0x03508bb71268bba25ecacc8f620e01866650532c",
    "originChainId": 8453,
    "destinationChainId": 10,
    "originCurrency": "0x0000000000000000000000000000000000000000",
    "destinationCurrency": "0x0000000000000000000000000000000000000000",
    "amount": "1000000000000000000",
    "tradeType": "EXACT_INPUT"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

200

400

401

429

500

{
  "steps": [\
    {\
      "id": "deposit",\
      "action": "Confirm transaction in your wallet",\
      "description": "Depositing funds to the relayer to execute the swap for USDC",\
      "kind": "transaction",\
      "requestId": "0x92b99e6e1ee1deeb9531b5ad7f87091b3d71254b3176de9e8b5f6c6d0bd3a331",\
      "items": [\
        {\
          "status": "incomplete",\
          "data": {\
            "from": "0x0CccD55A5Ac261Ea29136831eeaA93bfE07f5Db6",\
            "to": "0xf70da97812cb96acdf810712aa562db8dfa3dbef",\
            "data": "0x00fad611",\
            "value": "1000000000000000000",\
            "maxFeePerGas": "12205661344",\
            "maxPriorityFeePerGas": "2037863396",\
            "chainId": 1\
          },\
          "check": {\
            "endpoint": "/intents/status?requestId=0x92b99e6e1ee1deeb9531b5ad7f87091b3d71254b3176de9e8b5f6c6d0bd3a331",\
            "method": "GET"\
          }\
        }\
      ]\
    }\
  ],
  "fees": {
    "gas": {
      "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"
    },
    "relayer": {
      "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"
    },
    "relayerGas": {
      "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"
    },
    "relayerService": {
      "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"
    },
    "app": {
      "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"
    },
    "subsidized": {
      "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"
    }
  },
  "feeSponsorship": {
    "quoted": {
      "selectedComponents": [],
      "capHit": true,
      "components": {
        "execution": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        },
        "swap": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        },
        "relay": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        },
        "app": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        },
        "rent": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        }
      },
      "sponsoredTotal": {
        "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"
      },
      "userPaysTotal": {
        "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"
      },
      "maxSubsidizationAmount": "<string>"
    },
    "actual": {
      "selectedComponents": [],
      "capHit": true,
      "components": {
        "execution": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        },
        "swap": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        },
        "relay": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        },
        "app": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        },
        "rent": {
          "selected": true,
          "total": {
            "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"
          },
          "sponsored": {
            "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"
          },
          "userPays": {
            "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"
          }
        }
      },
      "sponsoredTotal": {
        "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"
      },
      "userPaysTotal": {
        "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"
      },
      "maxSubsidizationAmount": "<string>",
      "sponsorPayment": {
        "amount": "<string>",
        "address": "<string>",
        "chainId": 123
      }
    }
  },
  "details": {
    "operation": "<string>",
    "sender": "<string>",
    "recipient": "<string>",
    "currencyIn": {
      "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"
    },
    "currencyOut": {
      "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"
    },
    "refundCurrency": {
      "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"
    },
    "currencyGasTopup": {
      "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"
    },
    "totalImpact": {
      "usd": "<string>",
      "percent": "<string>"
    },
    "swapImpact": {
      "usd": "<string>",
      "percent": "<string>"
    },
    "expandedPriceImpact": {
      "swap": {
        "usd": "<string>"
      },
      "execution": {
        "usd": "<string>"
      },
      "relay": {
        "usd": "<string>"
      },
      "app": {
        "usd": "<string>"
      },
      "sponsored": {
        "usd": "<string>"
      }
    },
    "rate": "<string>",
    "slippageTolerance": {
      "origin": {
        "usd": "<string>",
        "value": "<string>",
        "percent": "<string>"
      },
      "destination": {
        "usd": "<string>",
        "value": "<string>",
        "percent": "<string>"
      }
    },
    "timeEstimate": 123,
    "userBalance": "<string>",
    "fallbackType": "<string>",
    "isFixedRate": true,
    "fixedRateFee": {
      "usd": "<string>"
    },
    "route": {
      "origin": {
        "inputCurrency": {
          "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"
        },
        "outputCurrency": {
          "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"
        },
        "router": "<string>",
        "includedSwapSources": [\
          "<string>"\
        ]
      },
      "destination": {
        "inputCurrency": {
          "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"
        },
        "outputCurrency": {
          "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"
        },
        "router": "<string>",
        "includedSwapSources": [\
          "<string>"\
        ]
      }
    }
  },
  "protocol": {
    "v2": {
      "orderId": "<string>",
      "hubType": "onchain",
      "orderData": "<unknown>",
      "orderSignature": "<string>",
      "paymentDetails": {
        "chainId": "<string>",
        "depository": "<string>",
        "currency": "<string>",
        "amount": "<string>"
      }
    }
  }
}
{
  "message": "<string>",
  "errorCode": "<string>",
  "errorData": "<string>",
  "requestId": "<string>",
  "approxSimulatedBlock": 123,
  "failedCallData": {
    "from": "<string>",
    "to": "<string>",
    "data": "<string>",
    "value": "<string>"
  }
}
{
  "message": "<string>",
  "errorCode": "<string>"
}
{
  "message": "<string>"
}
{
  "message": "<string>",
  "errorCode": "<string>",
  "requestId": "<string>"
}

POST

https://api.relay.linkhttps://api.testnets.relay.link

/

quote

Try it

cURL

cURL

fetch('https://api.relay.link/quote', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));


import requests

url = "https://api.relay.link/quote"

response = requests.post(url, json=payload, headers=headers)

print(response.text)


200

400

401

429

500

{ "message": "", "errorCode": "" }


{ "message": "" }


{ "message": "", "errorCode": "", "requestId": "" }


#### Headers

[​](https://docs.relay.link/references/api/get-quote#parameter-x-api-key)

x-api-key

string

Optional API key for authentication and higher rate limits.

#### Body

application/json

[​](https://docs.relay.link/references/api/get-quote#body-user)

user

string

default:0x03508bb71268bba25ecacc8f620e01866650532c

required

Address that is depositing funds on the origin chain and submitting transactions or signatures

[​](https://docs.relay.link/references/api/get-quote#body-origin-chain-id)

originChainId

number

default:8453

required

[​](https://docs.relay.link/references/api/get-quote#body-destination-chain-id)

destinationChainId

number

default:10

required

[​](https://docs.relay.link/references/api/get-quote#body-origin-currency)

originCurrency

string

default:0x0000000000000000000000000000000000000000

required

[​](https://docs.relay.link/references/api/get-quote#body-destination-currency)

destinationCurrency

string

default:0x0000000000000000000000000000000000000000

required

[​](https://docs.relay.link/references/api/get-quote#body-amount)

amount

string

default:1000000000000000000

required

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)

Pattern: `^[0-9]+$`

[​](https://docs.relay.link/references/api/get-quote#body-trade-type)

tradeType

enum<string>

default:EXACT\_INPUT

required

Whether to use the amount as the output or the input for the basis of the swap

Available options:

`EXACT_INPUT`,

`EXACT_OUTPUT`,

`EXPECTED_OUTPUT`

[​](https://docs.relay.link/references/api/get-quote#body-recipient)

recipient

string

Address that is receiving the funds on the destination chain, if not specified then this will default to the user address

[​](https://docs.relay.link/references/api/get-quote#body-txs)

txs

object\[\]

Showchild attributes

[​](https://docs.relay.link/references/api/get-quote#body-txs-gas-limit)

txsGasLimit

number

Total gas limit for the destination chain call transactions

[​](https://docs.relay.link/references/api/get-quote#body-authorization-list)

authorizationList

object\[\]

Authorization list for EIP-7702 transactions to be executed on destination chain

Showchild attributes

[​](https://docs.relay.link/references/api/get-quote#body-additional-data)

additionalData

object

Additional data needed for specific routes

Showchild attributes

[​](https://docs.relay.link/references/api/get-quote#body-referrer)

referrer

string

[​](https://docs.relay.link/references/api/get-quote#body-referrer-address)

referrerAddress

string

Pattern: `^0x[a-fA-F0-9]{40}$`

[​](https://docs.relay.link/references/api/get-quote#body-refund-to)

refundTo

string

Address to send the refund to in the case of failure, if not specified then the recipient address or user address is used

[​](https://docs.relay.link/references/api/get-quote#body-recovery-address)

recoveryAddress

string

Origin-chain address used for deposit-address fund recovery. Requires useDepositAddress=true.

[​](https://docs.relay.link/references/api/get-quote#body-refund-on-origin)

refundOnOrigin

boolean

deprecated

Always refund on the origin chain in case of any issues

[​](https://docs.relay.link/references/api/get-quote#body-topup-gas)

topupGas

boolean

If set, the destination fill will include a gas topup to the recipient (only supported for EVM chains if the requested currency is not the gas currency on the destination chain)

[​](https://docs.relay.link/references/api/get-quote#body-topup-gas-amount)

topupGasAmount

string

The destination gas topup amount in USD decimal format, e.g 100000 = $1. topupGas is required to be enabled. Defaults to 2000000 ($2)

[​](https://docs.relay.link/references/api/get-quote#body-enable-true-exact-output)

enableTrueExactOutput

boolean

default:false

Enabling will send any swap surplus when doing exact output operations to the solver EOA, otherwise it will be swept to the recipient

[​](https://docs.relay.link/references/api/get-quote#body-explicit-deposit)

explicitDeposit

boolean

default:true

Enable this to avoid direct transfers to the depository (only relevant for EVM and v2 protocol flow)

[​](https://docs.relay.link/references/api/get-quote#body-use-external-liquidity)

useExternalLiquidity

boolean

Enable this to use canonical+ bridging, trading speed for more liquidity

[​](https://docs.relay.link/references/api/get-quote#body-use-fallbacks)

useFallbacks

boolean

Enable this for specific fallback routes

[​](https://docs.relay.link/references/api/get-quote#body-use-permit)

usePermit

boolean

Enable this to use permit (eip3009) when bridging, only works on supported currency such as usdc

[​](https://docs.relay.link/references/api/get-quote#body-permit-expiry)

permitExpiry

number

How long the permit remains valid, in seconds. Defaults to 10 minutes.

[​](https://docs.relay.link/references/api/get-quote#body-include-protocol-data)

includeProtocolData

boolean

Return protocol data for on-chain intent validation. This includes protocol.v2.orderSignature and may increase quote latency.

[​](https://docs.relay.link/references/api/get-quote#body-use-deposit-address)

useDepositAddress

boolean

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. For new requests, EXACT\_OUTPUT is only supported when strict is also enabled.

[​](https://docs.relay.link/references/api/get-quote#body-strict)

strict

boolean

When used with useDepositAddress, enables a strict deposit address that is tied to a specific order. Underpayments fail and refund, exact payments fill, and overpayments fill the quoted amount while refunding the excess in a separate refund leg. EXACT\_OUTPUT deposit-address requests are only supported in strict mode. Open-ended deposit addresses remain the flexible path for variable deposited amounts. Requires a refundTo address.

[​](https://docs.relay.link/references/api/get-quote#body-slippage-tolerance)

slippageTolerance

string

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.

Pattern: `^([0-9]{1,4}|10000)$`

[​](https://docs.relay.link/references/api/get-quote#body-late-payment-slippage-tolerance)

latePaymentSlippageTolerance

string

Slippage tolerance for destination gas in the event that the deposit occurs after the order deadline, and more gas is required for the solver to execute the destination transaction. Must be 0–10000 bps.

Pattern: `^([0-9]{1,4}|10000)$`

[​](https://docs.relay.link/references/api/get-quote#body-app-fees)

appFees

object\[\]

Showchild attributes

[​](https://docs.relay.link/references/api/get-quote#body-gas-limit-for-deposit-specified-txs)

gasLimitForDepositSpecifiedTxs

number

If the request involves specifying transactions to be executed during the deposit transaction, an explicit gas limit must be set when requesting the quote

[​](https://docs.relay.link/references/api/get-quote#body-force-solver-execution)

forceSolverExecution

boolean

Force executing swap requests via the solver (by default, same-chain swap requests are self-executed)

[​](https://docs.relay.link/references/api/get-quote#body-subsidize-fees)

subsidizeFees

boolean

If the sponsor should pay for the fees associated with the request. Includes gas topup amounts.

[​](https://docs.relay.link/references/api/get-quote#body-sponsored-fee-components)

sponsoredFeeComponents

enum<string>\[\]

The fee components to sponsor for swap execution kinds. Requires subsidizeFees=true. Defaults to execution, swap, relay, and app when omitted; rent remains user-paid unless explicitly selected.

Minimum array length: `1`

Available options:

`execution`,

`swap`,

`relay`,

`app`,

`rent`

[​](https://docs.relay.link/references/api/get-quote#body-max-subsidization-amount)

maxSubsidizationAmount

string

The max subsidization amount in USDC decimal format, e.g 1000000 = $1. subsidizeFees must be enabled. The sponsor will cover fees up to this cap and the user pays any remainder.

[​](https://docs.relay.link/references/api/get-quote#body-subsidize-rent)

subsidizeRent

boolean

deprecated

Deprecated compatibility alias that adds "rent" to sponsoredFeeComponents.

[​](https://docs.relay.link/references/api/get-quote#body-included-swap-sources)

includedSwapSources

string\[\]

Swap sources to include for swap routing.

[​](https://docs.relay.link/references/api/get-quote#body-excluded-swap-sources)

excludedSwapSources

string\[\]

Swap sources to exclude for swap routing.

[​](https://docs.relay.link/references/api/get-quote#body-included-origin-swap-sources)

includedOriginSwapSources

string\[\]

Swap sources to include for swap routing on origin.

[​](https://docs.relay.link/references/api/get-quote#body-included-destination-swap-sources)

includedDestinationSwapSources

string\[\]

Swap sources to include for swap routing on destination.

[​](https://docs.relay.link/references/api/get-quote#body-origin-gas-overhead)

originGasOverhead

number

The gas overhead for the origin chain, this is used to calculate the gas fee for the origin chain when the solver is executing a gasless transaction on the origin chain

[​](https://docs.relay.link/references/api/get-quote#body-deposit-fee-payer)

depositFeePayer

string

The payer to be set for deposit transactions on solana. This account must have enough for fees and rent.

[​](https://docs.relay.link/references/api/get-quote#body-max-route-length)

maxRouteLength

number

Maximum number of hops to use in solana swap routing. Can reduce transaction size.

[​](https://docs.relay.link/references/api/get-quote#body-use-shared-accounts)

useSharedAccounts

boolean

Prevents certain ATA creation instructions in solana routing

[​](https://docs.relay.link/references/api/get-quote#body-include-compute-unit-limit)

includeComputeUnitLimit

boolean

Whether to include compute unit limit instruction for solana origin requests.

[​](https://docs.relay.link/references/api/get-quote#body-override-price-impact)

overridePriceImpact

boolean

Whether to ignore price impact errors.

[​](https://docs.relay.link/references/api/get-quote#body-disable-origin-swaps)

disableOriginSwaps

boolean

Whether to disable origin swaps.

[​](https://docs.relay.link/references/api/get-quote#body-fixed-rate)

fixedRate

string

The rate to charge for fixed spread quotes.

[​](https://docs.relay.link/references/api/get-quote#body-ttl)

ttl

number

Time-to-live for the quote, in seconds, measured from when the quote was generated. If the request is not filled within this window it is refunded instead of filled.

#### Response

200

application/json

Default Response

[​](https://docs.relay.link/references/api/get-quote#response-steps)

steps

object\[\]

An array of steps detailing what needs to be done to bridge, steps includes multiple items of the same kind (signature, transaction, etc)

Showchild attributes

Example:

[
{
"id": "deposit",
"action": "Confirm transaction in your wallet",
"description": "Depositing funds to the relayer to execute the swap for USDC",
"kind": "transaction",
"requestId": "0x92b99e6e1ee1deeb9531b5ad7f87091b3d71254b3176de9e8b5f6c6d0bd3a331",
"items": [
{
"status": "incomplete",
"data": {
"from": "0x0CccD55A5Ac261Ea29136831eeaA93bfE07f5Db6",
"to": "0xf70da97812cb96acdf810712aa562db8dfa3dbef",
"data": "0x00fad611",
"value": "1000000000000000000",
"maxFeePerGas": "12205661344",
"maxPriorityFeePerGas": "2037863396",
"chainId": 1
},
"check": {
"endpoint": "/intents/status?requestId=0x92b99e6e1ee1deeb9531b5ad7f87091b3d71254b3176de9e8b5f6c6d0bd3a331",
"method": "GET"
}
}
]
}
]


[​](https://docs.relay.link/references/api/get-quote#response-fees)

fees

object

Showchild attributes

[​](https://docs.relay.link/references/api/get-quote#response-fee-sponsorship)

feeSponsorship

object

Granular fee sponsorship details derived from the solver's internal sponsorship resolution.

Showchild attributes

[​](https://docs.relay.link/references/api/get-quote#response-details)

details

object

A summary of the swap and what the user should expect to happen given an input

Showchild attributes

[​](https://docs.relay.link/references/api/get-quote#response-protocol)

protocol

object

Protocol information for the quote

Showchild attributes

Was this page helpful?

YesNo

[Get Currencies](https://docs.relay.link/references/api/get-currencies) [Intent Status](https://docs.relay.link/references/websockets/intent-status)

Ctrl+I

Assistant

Responses are generated using AI and may contain mistakes.