> For the complete documentation index, see [llms.txt](https://docs.primestaking.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.primestaking.xyz/products/xdc-liquid-staking/referral-program.md).

# Referral Program

Share your invite link. When someone stakes XDC for the first time through your link, they become your referral - permanently and on-chain - and you earn a share of the protocol fee their staking generates, for as long as they stay staked.

***

## How it works

1. **Get your link.** Connect your wallet on the [Referral page](https://primestaking.xyz/xdc-liquid-staking/referral) and copy your personal invite link (`primestaking.xyz/xdc-liquid-staking?ref=<your address>`).
2. **They stake through it.** When an invitee opens your link and makes their **first** stake (at least the minimum bind amount, currently **100 XDC**), the `ReferralRegistry` binds you as their referrer in the same transaction that deposits their XDC. The binding is one-time and immutable.
3. **You earn a fee share.** Each epoch, your reward is a share of the protocol fee generated by your referees' staked balances, proportional to how much they staked and for how long.
4. **You claim.** Epoch rewards are published as an on-chain Merkle distribution (`ReferralRewards`); claim yours from the Referral page whenever you like. There is no expiry.

***

## How earnings are calculated

For each epoch:

```
your payout = referralShare × protocolFeeCollected
              × (your referees' time-weighted psXDC balance ÷ total time-weighted supply)
```

* **Time-weighted** means balance multiplied by how long it was held during the epoch - more staked, longer staked, more earned.
* The payout table is computed from on-chain data and published as a Merkle root; the contract only ever pays what the posted root says and can never be posted underfunded.

***

## Why extra wallets gain nothing

Referral payouts scale with **referred capital and time only**. Splitting the same capital across many wallets earns exactly what one wallet earns - there are no signup or per-wallet bonuses anywhere. Referring your own second wallet just returns a small slice of the fee your own stake generated (always less than the fee itself), so the protocol never pays out more than it collected. This makes the program safe to run openly.

***

## Contracts

| Contract           | Address                                                                                                                | Role                                                                                                                                     |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `ReferralRegistry` | [`0x9765BE3fd9e0d450bD46Ef2A30A0Feb4B15616B3`](https://xdcscan.com/address/0x9765BE3fd9e0d450bD46Ef2A30A0Feb4B15616B3) | Binds one immutable referrer per wallet on the first stake; forwards the stake to the vault. Minimum bind: 100 XDC.                      |
| `ReferralRewards`  | [`0xD910E7E0dC457Ccd425E9a5cF716b0F6B7045549`](https://xdcscan.com/address/0xD910E7E0dC457Ccd425E9a5cF716b0F6B7045549) | Epoch Merkle distributor. Roots are immutable per epoch and must be fully funded before posting; unclaimed liability can never be swept. |

Both contracts are **non-upgradeable** and never custody user principal - the registry forwards deposits straight to the vault (shares mint to the staker), and the distributor only holds each epoch's referral-fee allocation.

→ [How Rewards Work](/products/xdc-liquid-staking/xdc-staking-rewards.md) → [Deployed Contracts & Addresses](/products/contract-addresses.md)
