Route Request Parameters

Building with Squid, fundamentally starts with requesting a route.

The getRoute type is used to define the parameters required for bridging assets between different blockchain networks.



const params = {
  fromChain: number | string; //the chainID assets are being bridged FROM
  toChain: number | string; //the chainID assets are being bridged TO
  fromToken: string;  //the asset address being swapped FROM, "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" for native assets
  toToken: string;  // The asset address being swapped TO, "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" for native assets
  fromAmount: string; // The unadjusted decimal amount of assets to send. Mutually exclusive with toAmount.
  toAmount: string; // The unadjusted decimal amount of assets to receive (exact output). Mutually exclusive with fromAmount. Requires ExactOutputRouting feature flag.
  fromAddress: string; // The address FROM which assets are being sent to be bridged
  toAddress: string; // The address TO which bridged assets will be sent to
  slippage: number; //OPTIONAL, If set it determines the max slippage across the route (0.01-99.99) 1 = 1% slippage.
  quoteOnly: boolean; //OPTIONAL, If true, returns only a quote for the route. Omits transaction data needed for execution. Defaults to false
  fallbackAddresses?:{ 
    //For Cosmos routes where either the source or destination chains are not of coinType 118, the SDK necessitates an additional argument. 
    ///This argument is fallbackAddresses, which is an array of objects containing an address and its associated coin type.
    //See more here
    coinType: number;
    address: string;
  };
};

Parameter Summaries

Parameter
Type
Required
Description

fromChain

number | string

Yes

The chain ID of the network from which assets are being bridged.

toChain

number | string

Yes

The chain ID of the network to which assets are being bridged.

fromToken

string

Yes

The address of the asset being swapped from. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native assets.

toToken

string

Yes

The address of the asset being swapped to. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native assets.

fromAmount

string

One of fromAmount / toAmount

The unadjusted decimal amount of assets to send. Mutually exclusive with toAmount.

toAmount

string

One of fromAmount / toAmount

The unadjusted decimal amount of assets to receive (exact output). The system calculates the required fromAmount. Requires ExactOutputRouting feature flag. See Exact Output.

fromAddress

string

Yes

The address from which assets are being sent for bridging.

toAddress

string

Yes

The address to which bridged assets will be sent.

slippage

number

No

Maximum allowable slippage across the route (0.01–99.99). A value of 1 = 1% slippage.

quoteOnly

boolean

No

If true, returns only a quote without transaction data. Defaults to false.

customContractCalls

ContractCall[]

No

Custom contract calls to be included in the route.

fallbackAddresses

{ coinType, address }[]

No

For Cosmos routes where source or destination chains are not coinType 118.

bypassGuardrails

boolean

No

Waives Squid's slippage guardrails. If set to true, the integrator is liable for any loss of funds during the route.

Last updated