Swap Advanced Params
Swap Advanced Parameters
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.By default, there is no fee charged by Rango for a swap created for your dApp unless
referrerAddress
and referrerFee
set by the dApp through 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.20% of this fee is taken by Rango by default. But our team is open to negotiating about the shared percent and we offer some exceptional discounts for the first 6 months.
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']
})
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:
Last modified 6mo ago