GET routes
Get all options for sending a given USD value from a source address to destination address, across multiple chains.
Ranks routes by cost and execution speed. Only considers options where source address has sufficient balance. Currently same-chain transfers and swaps are supported. Bridging coming soon.
Endpoint
/routes
Request
Parameters
fromAmountUsd (string): Desired send amount, in USD.
fromAddress (string: 0x...): Address of sender. Balances on all chains will be considered.
toAccounts (IAccount[]): Destination address and chains that should be considered.
IAccount
address (string: 0x...): Address of recipient
chainId (number): EVM chain ID.
optionalRecipientId (string): ID that will be returned with any routes that use this recipient.
Response
Returns an object containing a single key routes
. routes
is an array of IRoute
s with the following structure.
type (string):
DIRECT
orINDIRECT
. Direct routes are when a single currency is being transferred on a single chain. INDIRECT are routes that require swapping between currencies and/or bridging chains.pair (IPair): Currency + chain being sent and currency + chain of recipient.
totalFeesUsd (string): 1.00 = $1.00 in fees (gas, swap, bridge, etc).
estimatedTxMs (number): Number of miliseconds until the transaction is accepted to the first block.
fromAmount (string): Amount of source currency to send.
availableFromAmount (string): Amount of source currency available to send.
optionalReciepientId (string): Echo'd value supplied with request.
steps (IStep[]): Each step involved in moving the funds (transfer, swap, bridge, etc).
tags (string[]): CHEAPEST | FASTEST
IPair
fromAccount (object): Account that is sending.
fromCurrency (object): Currency that is being sent
toAccount (object): Account that is receiving.
toCurrency (object): Currency that is being received.
IStep
type (string): TRANSFER | CROSS | SWAP
name (string)
sendAmount (string)
subtotalFeesUsd (string)
fees (object[])
pair (IPair)
Example
Get the best possible paths to send $1 from 0x2680d6E9b4B54fBf1B8e912909531a1306e0e6A9
to 0x80dDd67686cE46acE9F9a34E26f4ffbD7D7f8e4b
on Base or Optimism.
Request
Response
Last updated