> For the complete documentation index, see [llms.txt](https://surgeai.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://surgeai.gitbook.io/docs/technical/fdv-locked.md).

# FDV locked

FDV (Fully Diluted Valuation) is a key metric in the Surge contract system that determines token unlocking based on project performance. It represents the total value of all tokens when fully unlocked, providing a transparent and performance-based vesting mechanism.

### 🎯 Purpose of FDV System

#### Why FDV Matters

* **Performance-Based Unlocking**: Tokens unlock based on project success, not just time
* **Transparent Valuation**: Clear metrics for investors and project teams
* **Incentive Alignment**: Aligns team incentives with project performance
* **Market Protection**: Prevents premature token dumping

#### Core Principles

1. **Dynamic Calculation**: FDV increases as project value grows
2. **Milestone-Based**: Unlocking tied to specific performance milestones
3. **Gradual Release**: Tokens unlock progressively, not all at once
4. **Market Responsive**: System adapts to market conditions

### 📊 FDV Calculation System

#### Base Parameters

* **Initial FDV**: 60000 SUI
* **Precision**: Uses square root for calculation stability
* **Maximum Supply**: 1,000,000,000 tokens

#### Mathematical Formula

**Square Root FDV (for stability)**

```
sqrt_fdv = √(real_fdv)
```

**Target FDV for Round N**

```
target_fdv = initial_fdv × (1 + growth_rate)^round
```

**Real FDV Calculation**

```
real_fdv = sqrt_fdv²
```

### 🔄 Milestone Progression

#### Round 0 (Initial)

* **Target FDV**: 60,000 SUI
* **Unlock Percentage**: 2%
* **Tokens Unlocked**: 20,000,000 AI

#### Round 1

* **Target FDV**: 300,000 SUI
* **Unlock Percentage**: 2%
* **Tokens Unlocked**: 20,000,000 AI

#### Round 2

* **Target FDV**: 1,200,000 SUI
* **Unlock Percentage**: 2%
* **Tokens Unlocked**: 20,000,000 AI

### 📈 FDV Growth Schedule example

| Round | Target FDV (SUI) | Unlock % | Cumulative % | Tokens Unlocked |
| ----- | ---------------- | -------- | ------------ | --------------- |
| 0     | 60,000           | 0%       | 10%          | 0               |
| 1     | 300,000          | 2%       | 12%          | 20,000,000      |
| 2     | 1,200,000        | 2%       | 14%          | 20,000,000      |
| 3     | 4,800,000        | 2%       | 16%          | 20,000,000      |
| 4     | 8,600,000        | 2%       | 18%          | 20,000,000      |
| 5     | 14,000,000       | 2%       | 20%          | 20,000,000      |
| 6     | 17,000,000       | 3%       | 23%          | 30,000,000      |
| 7     | 20,000,000       | 3%       | 26%          | 30,000,000      |
| 8     | 23,000,000       | 3%       | 29%          | 30,000,000      |
| 9     | 26,000,000       | 4%       | 33%          | 40,000,000      |
| 10    | 29,000,000       | 4%       | 37%          | 40,000,000      |
| 11    | 57,000,000       | 5%       | 42%          | 50,000,000      |
| 12    | 86,000,000       | 5%       | 47%          | 50,000,000      |
| 13    | 115,000,000      | 6%       | 53%          | 60,000,000      |
| 14    | 140,000,000      | 6%       | 59%          | 60,000,000      |
| 15    | 170,000,000      | 7%       | 66%          | 70,000,000      |
| 16    | 200,000,000      | 7%       | 73%          | 70,000,000      |
| 17    | 230,000,000      | 8%       | 81%          | 80,000,000      |
| 18    | 260,000,000      | 9%       | 90%          | 90,000,000      |
| 19    | 290,000,000      | 10%      | 100%         | 100,000,000     |

### 🎯 How FDV Affects Token Unlocking

#### Triggering Mechanism

1. **Project Performance**: FDV increases based on project milestones
2. **Market Conditions**: Real FDV reflects current market valuation
3. **Milestone Achievement**: When real FDV reaches target FDV
4. **Automatic Unlocking**: Tokens unlock automatically upon milestone completion

#### Unlocking Process

```move
// Trigger milestone when FDV target is reached
milestone::trigger_milestone<AI, USDA>(
    wallet,
    project_manager,
    ctx
);
```

#### Progress Calculation

* **Current Progress**: (current\_sqrt\_fdv - prev\_target) / (target\_sqrt\_fdv - prev\_target) × 100
* **Milestone Completion**: When progress reaches 100%
* **Partial Unlocking**: Pro-rated unlocking based on progress

### 🔧 Technical Implementation

#### Key Functions

**Get Target FDV for Round**

```move
public fun get_sqrt_fdv_target(round: u8): u64 {
    if (round == 0) {
        return INITIAL_SQRT_FDV
    };
    
    let mut target = INITIAL_SQRT_FDV;
    let mut i = 0u8;
    
    while (i < round) {
        target = target * (100 + SQRT_FDV_INCREASE_RATE) / 100;
        i = i + 1;
    };
    
    target
}
```

**Convert Sqrt FDV to Real FDV**

```move
public fun sqrt_fdv_to_real_fdv(sqrt_fdv: u64): u64 {
    let sqrt_fdv_128 = (sqrt_fdv as u128);
    let real_fdv = sqrt_fdv_128 * sqrt_fdv_128;
    (real_fdv as u64)
}
```

**Calculate Unlock Percentage**

```move
public fun get_unlock_percentage(round: u8): u64 {
    if (round == 0) {
        return INITIAL_UNLOCK_PERCENTAGE
    };
    
    let mut percentage = INITIAL_UNLOCK_PERCENTAGE;
    let mut i = 0u8;
    
    while (i < round) {
        if (percentage > MIN_UNLOCK_PERCENTAGE) {
            let decrease = percentage * UNLOCK_DECREASE_RATE / 100;
            if (percentage > decrease) {
                percentage = percentage - decrease;
            } else {
                percentage = MIN_UNLOCK_PERCENTAGE;
            }
        };
        i = i + 1;
    };
    
    percentage
}
```

### 📊 FDV Monitoring

#### Current Status Tracking

* **Current Real FDV**: Actual project valuation
* **Target FDV**: Required FDV for next milestone
* **Progress Percentage**: How close to next milestone
* **Expected Round**: Which round current FDV corresponds to

#### Status Queries

```move
// Get current milestone information
let (current_sqrt_fdv, target_sqrt_fdv, current_real_fdv, target_real_fdv, expected_round) = 
    milestone_constants::get_current_milestone_info(current_sqrt_fdv, current_round);

// Get progress percentage
let progress = milestone_constants::get_milestone_progress_percentage(current_sqrt_fdv, current_round);
```

### ⚡ Performance Optimization

#### Square Root Calculation

* **Stability**: Square root prevents overflow in calculations
* **Precision**: 6-digit precision for accurate calculations
* **Efficiency**: Optimized Newton's method for square root

#### Batch Updates

* **Multiple Wallets**: Update multiple wallets simultaneously
* **Gas Efficiency**: Reduce transaction costs
* **Atomic Operations**: Ensure consistency across updates

### 🔒 Security Features

#### Validation Checks

* **FDV Range**: Ensures FDV stays within reasonable bounds
* **Unlock Limits**: Prevents excessive token unlocking
* **Progress Validation**: Verifies milestone progress accuracy

#### Error Handling

* **Overflow Protection**: Prevents mathematical overflow
* **Boundary Checks**: Validates input parameters
* **Graceful Degradation**: Handles edge cases gracefully

### 📈 Benefits of FDV System

#### For Project Teams

* **Performance Incentives**: Rewards successful project development
* **Market Alignment**: Unlocking tied to market performance
* **Investor Confidence**: Transparent and predictable system

#### For Investors

* **Risk Mitigation**: Gradual unlocking reduces dumping risk
* **Performance Tracking**: Clear metrics for project evaluation
* **Market Protection**: Prevents premature token releases

#### For the Ecosystem

* **Market Stability**: Reduces token price volatility
* **Long-term Focus**: Encourages sustainable project development
* **Transparency**: Clear and auditable unlocking mechanism

***

**Note**: The FDV system is designed to provide a fair and transparent token unlocking mechanism. All calculations are performed on-chain and are publicly verifiable.
