💰Monetization
How to take fees from the users using Rango Basic API?
Last updated
How to take fees from the users using Rango Basic API?
Last updated
In the quote endpoint, you should include the referrerFee
field, which represents the fee amount you want to charge the user as a percentage (1.12 means 1.12 percent). Note that the maximum amount fee you could charge the user is 3 percent. It is required to calculated quote fee correctly for the user. The default fee is 10 bps or 0.1 percent.
In the swap endpoint, you should pass both referrerAddress
and referrerFee
fields. The referrerFee
is the same as the field in quote
endpoint, and the referrerAddress
is the wallet address which you wish to receive your collected fees.
For the referrerAddress
, you can use EVM, Starknet, or Osmosis wallet addresses depending on the route. While we also support fee charging on the Solana blockchain, this feature is not yet available for all dApps due to its complexity and is not ready for public use.
Here is a sample code for setting affiliate fee parameters in quote method:
Here is a sample code for setting affiliate fee parameters in swap method: