> For the complete documentation index, see [llms.txt](https://docs.rango.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rango.exchange/api-integration/basic-api-single-step/monetization.md).

# Monetization

## How Rango affiliate system works?

{% content-ref url="/pages/XLBy76udAgbv1sqg98A8" %}
[Monetization](/technical/monetization.md)
{% endcontent-ref %}

## How to set affiliate parameters?

* The Single-step API provides two endpoints for getting a quote and creating transactions, [quote](/api-integration/basic-api-single-step/api-reference/get-quote.md) and [swap](/api-integration/basic-api-single-step/api-reference/create-transaction-swap.md) endpoints.
* 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](/api-integration/basic-api-single-step/api-reference/get-quote.md) method:

{% tabs %}
{% tab title="Typescript" %}

```typescript
const quote = await rango.quote({
    from: {"blockchain": "BSC", "symbol": "BNB", "address": null},
    to: {"blockchain": "AVAX_CCHAIN", "symbol": "USDT.E", "address": "0xc7198437980c041c805a1edcba50c1ce5db95118"},
    amount: "100000000000000000", // 0.1 BSC.BNB
    slippage: "1.0",
    referrerFee: "0.1" // charge users 0.1% fee for the input token 
})
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
     --url 'https://api.rango.exchange/basic/quote?from=BSC.BNB&to=AVAX_CCHAIN.USDT.E--0xc7198437980c041c805a1edcba50c1ce5db95118&amount=100000000000000000&slippage=3&referrerFee=0.1&apiKey=c6381a79-2817-4602-83bf-6a641a409e32'  
```

{% endtab %}
{% endtabs %}

Here is a sample code for setting affiliate fee parameters in [swap](/api-integration/basic-api-single-step/api-reference/create-transaction-swap.md) method:

{% tabs %}
{% tab title="Typescript" %}

<pre class="language-typescript"><code class="lang-typescript">const swap = await rango.swap({
    from: {"blockchain": "BSC", "symbol": "BNB", "address": null},
    to: {"blockchain": "AVAX_CCHAIN", "symbol": "USDT.E", "address": "0xc7198437980c041c805a1edcba50c1ce5db95118"},
    amount: "100000000000000000" // 0.1 BSC.BNB
    slippage: "1.0",
    fromAddress: "0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
    toAddress: "0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
    disableEstimate: true,
<strong>    referrerFee: "0.1",
</strong><strong>    referredAddress: "0x7g44bb1763eebead07cf8815a62fcd7b30311fb1"
</strong>})
</code></pre>

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
     --url 'https://api.rango.exchange/basic/swap?from=BSC.BNB&to=AVAX_CCHAIN.USDT.E--0xc7198437980c041c805a1edcba50c1ce5db95118&amount=100000000000000000&slippage=3&fromAddress=0x9F8cCdaFCc39F3c7D6EBf637c9151673CBc36b88&toAddress=0x9F8cCdaFCc39F3c7D6EBf637c9151673CBc36b88&referrerFee=0.1&referrerAddress=0x7g44bb1763eebead07cf8815a62fcd7b30311fb1&apiKey=c6381a79-2817-4602-83bf-6a641a409e32' 
```

{% endtab %}
{% endtabs %}
