# Profiles & Referrals

## Onchain Profiles

An evently profile is a permanent onchain identity stored in `EventlyProfiles.sol v1.3`. It tracks username, stats, referrals, and points across all evently products.

### Profile Cost

| Method              | Cost                |
| ------------------- | ------------------- |
| Standard            | **Free**            |
| With community code | Free + bonus points |

Profile creation is free. No ETH required beyond gas (near-zero on MegaETH).

### Username Rules

* 3 to 20 characters
* Alphanumeric and underscore only
* Case-insensitive: stored as entered, matched in lowercase (prevents case-variant squatting)
* Unique — cannot be changed after creation

***

## Profile Data

```solidity
struct Profile {
    string username;
    uint256 swapVolumeUsd;    // Lifetime swap volume in USD cents
    uint256 swapPoints;       // Points earned from swaps
    uint256 tradePoints;      // Points earned from prediction market trades
    address referrer;         // Who referred this user
    uint256 referralEarnings; // Total USDm earned via referrals
}
```

***

## Referral System

Every evently profile comes with a unique referral link:

```
https://evently.market/?ref=YOUR_USERNAME
```

### How it works

1. Share your referral link
2. A new user connects via your link and creates a profile
3. Once they trade on prediction markets, you start earning referral rewards
4. Referral earnings are paid in USDm and claimable at any time

### Referral Rates

| Action                        | Referrer earns                                     |
| ----------------------------- | -------------------------------------------------- |
| Referred user trades a market | 0.5% of their trading volume                       |
| Activation threshold          | Referred user must trade at least **1 USDm** total |

### Rules

* Only the first referrer counts — cannot be changed after registration
* Self-referral is not possible
* Earnings accumulate in `referralEarnings` and are claimable via `claimReferralEarnings()`

***

## Community Codes

Community codes are special promo codes that grant bonus points on profile creation. They are issued by the evently team to ambassadors and community partners.

Enter a community code at profile creation to receive a points bonus.

***

## Leaderboard

The onchain leaderboard tracks the top users by Points score. Rankings are updated in real time on MegaETH.

| Metric                  | Points awarded            |
| ----------------------- | ------------------------- |
| Prediction market trade | Based on USDm volume      |
| Swap volume             | 5 points per $0.01 USD    |
| Create a market         | Bonus points              |
| Daily streak            | Streak multiplier applied |

Visit [evently.market/leaderboard](https://evently.market/leaderboard) to see current rankings.

***

## Contract

```
EventlyProfiles.sol v1.3
Address: 0x9F0708145BCCD1F5B16F610cB8a75A63fA4A9a24
Chain: MegaETH Mainnet (Chain ID 4326)
```
