> For the complete documentation index, see [llms.txt](https://docs.getrekt.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getrekt.trade/referral-fees.md).

# referral fees

GetRekt lets referrers participate in bootstrapping the LP. When a referred trader realizes a loss funded by actual USDC, the protocol reserves a referral reward and sends the remaining allocation to the LP.

{% hint style="info" %}
**New product specification.** Referral binding, reserves and claims are not implemented in the current contracts.
{% endhint %}

## 30% of the post-fee loss

First deduct the existing 2% protocol fee. Split the remaining 98% of the loss: 30% goes to the eligible referrer and 70% goes to the LP. The fee is allocated equally to development and staking under their respective accounting rules.

| Realized cash loss | Protocol fee | Referrer   | LP cash    |
| ------------------ | ------------ | ---------- | ---------- |
| 10 USDC            | 0.20 USDC    | 2.94 USDC  | 6.86 USDC  |
| 100 USDC           | 2 USDC       | 29.40 USDC | 68.60 USDC |
| 1,000 USDC         | 20 USDC      | 294 USDC   | 686 USDC   |

“Up to 30%” refers to the post-fee base. The specified eligible rate is 30%; no referral tiers or hidden volume requirements are defined. The effective share of the trader's gross cash loss is 29.4%, before integer rounding. The trader is never charged an extra referral fee on top of that loss.

## Which activity qualifies?

| Activity                                               | Referral reward          | $REKT loss reward |
| ------------------------------------------------------ | ------------------------ | ----------------- |
| Referred cash position closes at a loss                | Yes, on realized loss    | Yes               |
| Referred cash position is hard-bust liquidated         | Yes, on full lost margin | Yes               |
| Debt-collateral position loses or is liquidated        | No                       | Yes               |
| Position wins or closes without a loss                 | No                       | No                |
| Deposit, withdrawal, bridge fee, gas or unrealized PnL | No                       | No                |

Debt loss cancels a liability. It creates neither USDC referral income nor a queued referral claim. Cash and debt must remain separate even when they belong to the same trader.

## Binding and claiming

The implementation specification binds an eligible referrer before opening a position and records that relationship for the position's lifetime. It must not allow a referrer to be added or changed after the outcome is known. Direct same-address self-referrals are excluded; a same-address check alone cannot detect someone controlling several wallets.

With no valid referrer, the entire post-fee amount goes to LP cash: a 100 USDC loss supplies 98 USDC to the LP. No unassigned referral share is diverted to the team.

Referral allocations must be backed by USDC and recorded separately from LP cash and trader collateral. An owner-authorized claim sends the available reward to the referrer's Sui wallet and consumes that balance exactly once. Accrual at settlement does not mean a wallet transfer happens automatically or without gas.

## Referral allocation and FIFO

The new cash-loss split takes place before the LP receives its portion. That LP portion then pays older trader claims in FIFO order. For example, a 100 USDC referred cash loss contributes 68.6 USDC to a waiting queue, not 100 USDC.

Referral and fee reserves cannot also be counted as cash available to that queue. This allocation changes the legacy cash-loss fee waiver while a queue exists; it is a new economic rule that requires contract changes. It can make queued winners wait longer than a model that sends the entire loss to LP cash.

## Exact amounts

USDC uses six decimal places. The proposed integer allocation is:

```
fee_atoms = floor(loss_atoms × 2 / 100)
remaining_atoms = loss_atoms − fee_atoms
referral_atoms = valid_referrer ? floor(remaining_atoms × 30 / 100) : 0
lp_atoms = remaining_atoms − referral_atoms
```

Remainders from the referral calculation stay with the LP. The split must sum to the exact realized loss for every settlement, including the smallest units. Minting uses the gross eligible loss, not the smaller LP or referral allocation. [Emissions](broken://pages/af415c261799018d5354ee742284d48baa28670b).


---

# 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.getrekt.trade/referral-fees.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.
