Swap Advanced Params

Swap Advanced Parameters

Disabling Estimate

By default, when you call the swap method, Rango API performs some validations e.g. having enough balance for the input amount and the swap fee, and gives an error if doesn't meet the criteria. If you want to disable it and do it on your own side, you could pass true value for the disableEstimate argument.

Configuring dApp Fee

By default, Rango does not charge a fee on your behalf unless you setreferrerAddress and referrerFee parameters when your dApp sends a request to the swap method. In this case, Rango charges an additional fee equal to (referrerFee / 100) x inputAmount and transfer it to your referrerAddress wallet as the referral reward.

Please check our comprehensive document on Rango Affiliate service for more details on this.

💸pageRango Affiliate Program

Filtering Swappers

You could pass swappers argument to the swap method in order to filter dexes and bridges to some limited ones. For example, if you want to only use PancakeSwap for Swapping inside BSC, you could pass PancakeSwap swapper id in swappers arg like this:

const swap = await rangoClient.swap({
  // other fields,
  swappers: ['PancakeSwapBsc']

Relaying Messages

When transferring tokens using Rango cross-chain API, you could pass a random message from the source chain to the destination and call your contract on the destination. In order to do so, you need to pass your contracts on source & destination chains plus an arbitrary hex message.

In order to do that, you should specify sourceContract, destinationContract and imMessage arguments in both quote and swap methods. You could also use messagingProtocols field to filter protocols used for message passing.

You could read our guide for message passing here:

pageMessage Passing API

Last updated