Ana içeriğe geç

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

RuleDescription
One referrer per addressCannot change referrer once set
No self-referralsreferee and referrer must be different addresses
One-time registrationCalling 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
ParameterValue
Reward Rate500 basis points (5%)
Maximum Reward Rate1,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:

  1. Looks up the referee's referrer.
  2. If a referrer exists, calculates 5% of the received fee as the reward.
  3. Adds the reward to the referrer's pending balance.
  4. 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:

  1. Share your wallet address as the referral code. The MonoHub frontend supports referral links in the format: https://monohub.xyz/?ref=0xYourAddress

  2. The referee visits the link. The frontend stores the referrer address locally.

  3. On the referee's first interaction, the frontend calls register() with the referee's connected wallet and the stored referrer address.

  4. From that point forward, every trade the referee makes on MonoPump accrues rewards to the referrer.

Contract Administration

FunctionAccessDescription
setRewardBps(uint256)OwnerUpdate the reward percentage (max 10%)
setAuthorized(address, bool)OwnerAuthorize or deauthorize callers for accrueReward()

The contract accepts direct LYTH transfers via receive() to allow funding from any source.