Referral Program
The Monolythium Referral Program rewards users who bring new traders to the platform. Referrers earn 5% of platform fees generated by their referees. The system is implemented in the on-chain Referral contract and integrated with MonoPump.
How Referrals Work
Referrer shares link --> Referee registers --> Referee trades on MonoPump
|
v
Platform fee collected
|
v
5% of fee accrued to referrer
|
v
Referrer claims rewards
The referral relationship is one-to-one and permanent: each address can have exactly one referrer, set once and never changed.
Registration
Self-Registration
Users register their referral relationship by calling:
function register(address referee, address referrer) external
For self-registration, msg.sender must equal the referee parameter. This prevents front-running attacks where a malicious actor registers themselves as the referrer for another user before that user can choose their own referrer.
Authorized Registration
Authorized contracts (such as MonoPump) can register referral relationships on behalf of users during their first trade. This enables seamless onboarding where the referral link is embedded in the trading flow.
Constraints
| Rule | Description |
|---|---|
| One referrer per address | Cannot change referrer once set |
| No self-referrals | referee and referrer must be different addresses |
| One-time registration | Calling register() again for an already-referred address reverts |
Reward Accrual
When a referred user trades on MonoPump (buys or sells tokens), the platform fee is sent to the Referral contract. The contract calculates the referrer's share:
Referral Reward = Platform Fee * rewardBps / 10,000
| Parameter | Value |
|---|---|
| Reward Rate | 500 basis points (5%) |
| Maximum Reward Rate | 1,000 basis points (10%) |
The reward is added to the referrer's pendingRewards balance. Rewards accumulate across all referees -- if a referrer has brought 10 users, they earn 5% of fees from all 10.
Integration with MonoPump
MonoPump is authorized to call accrueReward() on the Referral contract:
function accrueReward(address referee) external payable onlyAuthorized
On each buy or sell, MonoPump sends the platform fee (or sell tax) to the Referral contract. The contract:
- Looks up the referee's referrer.
- If a referrer exists, calculates 5% of the received fee as the reward.
- Adds the reward to the referrer's pending balance.
- If no referrer exists, the fee remains in the contract (available for distribution by the owner).
Claiming Rewards
Referrers claim accumulated rewards using a pull-based pattern:
function claim() external
This transfers the full pendingRewards balance to the caller. The function reverts if there is nothing to claim.
Claim Example
Referrer pending balance: 2.5 LYTH
|
|--- claim() -->
|
v
Referrer receives 2.5 LYTH
Pending balance reset to 0
How to Generate and Share Referral Codes
Referral codes on Monolythium are simply wallet addresses. To refer someone:
-
Share your wallet address as the referral code. The MonoHub frontend supports referral links in the format:
https://monohub.xyz/?ref=0xYourAddress -
The referee visits the link. The frontend stores the referrer address locally.
-
On the referee's first interaction, the frontend calls
register()with the referee's connected wallet and the stored referrer address. -
From that point forward, every trade the referee makes on MonoPump accrues rewards to the referrer.
Contract Administration
| Function | Access | Description |
|---|---|---|
setRewardBps(uint256) | Owner | Update the reward percentage (max 10%) |
setAuthorized(address, bool) | Owner | Authorize or deauthorize callers for accrueReward() |
The contract accepts direct LYTH transfers via receive() to allow funding from any source.