> For the complete documentation index, see [llms.txt](https://docs.enoxswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enoxswap.com/products/referrals.md). Agents can also search and read this documentation through its [MCP server](https://docs.enoxswap.com/~gitbook/mcp).

# Referrals

Earn a share of the protocol fee on every swap made by people you invite. Referrals are recorded **on-chain** in the EnoxSwap contract.

## How it works

1. Connect your wallet and open the **Referrals** page.
2. Copy your personal link. It is an EnoxSwap URL that carries your address in a `ref` parameter, for example `https://enoxswap.com/referrals?ref=0xYourAddress`.
3. Share it. When someone opens it, the referrer address is saved in their browser.
4. On their **first swap**, the referrer is registered on-chain and tied to them. It cannot be changed afterwards.
5. From then on you are credited a share of the fee on every swap they make.

## What you earn

|                  |                                                                                                                   |
| ---------------- | ----------------------------------------------------------------------------------------------------------------- |
| Share of the fee | **20%** by default (`referralShareBps = 2000`), configurable by the owner up to **50%**                           |
| Paid in          | The token of the swap fee: the native coin when the input is native (BNB, ETH, POL), or the input token otherwise |
| When             | Credited at swap time, claimed by you when you choose                                                             |

{% hint style="info" %}
The live share is readable with `referralShareBps()`. The referral share comes out of the protocol fee, so it never increases what the swapper pays.
{% endhint %}

## Claiming

Rewards accrue in the contract. Withdraw them any time:

* native coin: `claimETH()`
* any token: `claimToken(tokenAddress)`

You can read your balances with `pendingETH(address)` and `pendingToken(address, token)`, and lifetime earnings with `referralEarnedETH(address)` / `referralEarnedToken(address, token)`.

## Rules enforced by the contract

* You cannot refer yourself.
* A user can only have one referrer, set once.
* Circular referrals (A refers B and B refers A) are rejected.
* Rewards are claimed by pull, so they cannot be blocked by anyone else.

## Referrals for integrators

The [swap widget](https://docs.enoxswap.com/products/embed-widget.md) and [Pay button](https://docs.enoxswap.com/products/pay.md) both accept a referral address, so a website that embeds EnoxSwap can earn the referral share on trades made through it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.enoxswap.com/products/referrals.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
