> For the complete documentation index, see [llms.txt](https://xrptundra.gitbook.io/xrp-tundra/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xrptundra.gitbook.io/xrp-tundra/xrp-tundra-cryo-vaults-tundra-s/how-tundra-s-rewards-are-calculated.md).

# How TUNDRA-S Rewards Are Calculated

### Mathematical Framework <a href="#id-03e98c1a-ab3b-4fef-a733-c3662adb92e8" id="id-03e98c1a-ab3b-4fef-a733-c3662adb92e8"></a>

TUNDRA-S rewards are calculated using a transparent, deterministic mathematical framework that ensures fair distribution based on stake amount, duration, and vault tier. This section explains the precise mechanisms that determine how rewards are calculated for participants in our Solana Cryo Vaults.

### Core Calculation Components <a href="#id-7699e170-744d-4aa1-bfa7-085190358e16" id="id-7699e170-744d-4aa1-bfa7-085190358e16"></a>

The reward calculation combines several key variables:

* **Principal Amount (P)**: The quantity of TUNDRA-S tokens staked
* **Time Factor (T)**: Duration of the stake in days
* **Base Rate ®**: The annual percentage yield for the specific vault tier
* **Tier Multiplier (M)**: Additional multiplier based on vault tier
* **Bonus Factors (B)**: Additional multipliers from special conditions

### Base Reward Formula <a href="#id-4bcd8d89-93c1-48cf-bc23-c3bcce47c46d" id="id-4bcd8d89-93c1-48cf-bc23-c3bcce47c46d"></a>

The foundation of our reward calculation uses a compound interest model:

```
Base Reward = P × [(1 + (R/365))^T - 1]
```

Where:

* P is the principal amount of TUNDRA-S staked
* R is the annual base rate expressed as a decimal (e.g., 5% = 0.05)
* T is the time in days the tokens are staked

This formula calculates the reward using daily compounding, which maximizes returns for long-term stakers.

### Tier-Specific Calculations <a href="#c0c5bde3-dfd2-421e-b6c2-14d4b530deb7" id="c0c5bde3-dfd2-421e-b6c2-14d4b530deb7"></a>

Each vault tier implements a modified version of the base formula with specific parameters:

#### Permafrost Vault (7-30 days) <a href="#id-6e363c7e-2d70-40aa-a565-a710a77d159b" id="id-6e363c7e-2d70-40aa-a565-a710a77d159b"></a>

```
Permafrost Reward = P × [(1 + (R_p/365))^T - 1]
```

Where R\_p is the Permafrost base rate (typically 4-6% APY)

#### Glacier Vault (30-60 days) <a href="#c70de6bb-c97e-4f55-9513-66d8a3382241" id="c70de6bb-c97e-4f55-9513-66d8a3382241"></a>

```
Glacier Reward = P × [(1 + (R_g/365))^T - 1] × M_g
```

Where:

* R\_g is the Glacier base rate (typically 6-8% APY)
* M\_g is the Glacier tier multiplier (typically 1.2-1.4)

#### Polar Vault (60-90 days) <a href="#id-9b3c18f1-4d2a-40c1-9573-ffd701227f7e" id="id-9b3c18f1-4d2a-40c1-9573-ffd701227f7e"></a>

```
Polar Reward = P × [(1 + (R_po/365))^T - 1] × M_po
```

Where:

* R\_po is the Polar base rate (typically 8-10% APY)
* M\_po is the Polar tier multiplier (typically 1.5-1.8)

#### Blizzard Vault <a href="#id-5fc5f0c7-dc34-4c86-b2ac-9994a05f3dd5" id="id-5fc5f0c7-dc34-4c86-b2ac-9994a05f3dd5"></a>

```
Blizzard Reward = P × [(1 + (R_b/365))^T - 1] × M_b × B
```

Where:

* R\_b is the Blizzard base rate (typically 10-12% APY)
* M\_b is the Blizzard tier multiplier (typically 1.8-2.0)
* B represents additional bonus multipliers from liquidity provision

### Time-Weighted Adjustments <a href="#id-62cb028f-fc24-4deb-b84d-4976180cd1bc" id="id-62cb028f-fc24-4deb-b84d-4976180cd1bc"></a>

To incentivize longer commitments within each tier, we implement a time-weight factor:

```
Time Weight (W_t) = 1 + [(T - T_min) / (T_max - T_min)] × 0.5
```

Where:

* T is the actual staking duration in days
* T\_min is the minimum duration for the tier
* T\_max is the maximum duration for the tier

This creates a linear increase in rewards as the staking duration approaches the maximum for each tier, providing up to a 50% boost for maximum-duration stakers.

### Solana-Specific Calculation Mechanics <a href="#id-023953b4-f994-4466-ae04-ae01ea7eff63" id="id-023953b4-f994-4466-ae04-ae01ea7eff63"></a>

TUNDRA-S rewards leverage Solana’s technical capabilities for efficient calculation:

#### Epoch-Based Accrual <a href="#aeda0b25-1a2d-4b44-b22f-ebfc27d0de4d" id="aeda0b25-1a2d-4b44-b22f-ebfc27d0de4d"></a>

Rewards accrue based on Solana’s epoch structure:

```
Epoch Reward = P × [(1 + (R/365))^(E_d) - 1] × (E_d/T)
```

Where:

* E\_d is the length of a Solana epoch in days (approximately 2-3 days)
* T is the total staking period in days

This allows for frequent, predictable reward calculations aligned with Solana’s consensus mechanism.

#### Real-Time Tracking <a href="#e8637053-0d49-4c14-a82a-3390d777f4cb" id="e8637053-0d49-4c14-a82a-3390d777f4cb"></a>

The Solana program tracks reward accumulation in real-time:

```
Current Reward = Σ(Epoch Rewards) + P × [(1 + (R/365))^(C_d) - 1]
```

Where:

* Σ(Epoch Rewards) is the sum of all fully completed epoch rewards
* C\_d is the number of days in the current partial epoch

This enables accurate reward estimation at any point during the staking period.

### Additional Reward Factors <a href="#id-24f065b3-34b2-4301-a1bc-d629352e2234" id="id-24f065b3-34b2-4301-a1bc-d629352e2234"></a>

Several factors can enhance the base calculation:

#### DEX Liquidity Reward Integration <a href="#fa54f59c-e784-49af-a1fe-13b86ce7490d" id="fa54f59c-e784-49af-a1fe-13b86ce7490d"></a>

For vaults that incorporate DEX liquidity provision (primarily Blizzard Vaults):

```
LP Reward = (V × F × T) / 365
```

Where:

* V is the value of liquidity provided
* F is the estimated annual fee rate for the liquidity pool
* T is the time in days

This LP reward is added to the base staking reward.

#### Early Withdrawal Adjustments <a href="#c1198bf5-3ad5-4ba4-8288-aa45993f1e34" id="c1198bf5-3ad5-4ba4-8288-aa45993f1e34"></a>

If early withdrawal is permitted (in Glacier and Polar vaults), the penalty is calculated:

```
Early Withdrawal Reward = Accrued Reward × (1 - P_rate)
```

Where:

* P\_rate is the penalty rate (0.5 for Glacier, 0.75 for Polar)

#### Bonus Multipliers <a href="#id-7122046d-8599-49f8-9164-d7784be7d74b" id="id-7122046d-8599-49f8-9164-d7784be7d74b"></a>

Specific activities can earn bonus multipliers:

* **NFT Boost**: Holders of Frost Key NFTs receive additional multipliers
* **Loyalty Bonus**: Repeat stakers receive increasing bonuses
* **Ecosystem Participation**: Engagement with other protocol features earns additional rewards

The formula incorporating all bonuses:

```
Total Multiplier = 1 + NFT_boost + Loyalty_bonus + Ecosystem_bonus
```

### Implementation in Solana Smart Contracts <a href="#id-65a3430d-c72b-4d04-a652-8195bdd10d50" id="id-65a3430d-c72b-4d04-a652-8195bdd10d50"></a>

The reward calculation is implemented on-chain through several mechanisms:

* **Pre-computed Tables**: Optimization using lookup tables for common calculation components
* **High-Precision Arithmetic**: Using Solana’s built-in fixed-point decimal support
* **Efficient Time Calculation**: Leveraging Solana’s clock for accurate timestamp tracking
* **Transaction Batching**: Optimized reward distribution to minimize computational costs

### Example Calculations <a href="#id-5641b135-5900-4310-a4b4-0ccf5a589178" id="id-5641b135-5900-4310-a4b4-0ccf5a589178"></a>

To illustrate our reward system, consider these examples:

#### Example 1: Permafrost Vault <a href="#e42e6d06-2cf0-4def-ade4-cf313869854b" id="e42e6d06-2cf0-4def-ade4-cf313869854b"></a>

* Principal: 1,000 TUNDRA-S
* Duration: 30 days
* Base Rate: 5% APY
* Calculation: 1,000 × \[(1 + (0.05/365))^30 - 1] = 4.11 TUNDRA-S

#### Example 2: Glacier Vault <a href="#bae274b9-0aef-4987-9f85-21c4a2f7125a" id="bae274b9-0aef-4987-9f85-21c4a2f7125a"></a>

* Principal: 1,000 TUNDRA-S
* Duration: 60 days
* Base Rate: 7% APY
* Tier Multiplier: 1.3
* Time Weight: 1 + \[(60-30)/(60-30)] × 0.5 = 1.5
* Calculation: 1,000 × \[(1 + (0.07/365))^60 - 1] × 1.3 × 1.5 = 17.96 TUNDRA-S

#### Example 3: Blizzard Vault with LP <a href="#id-084277bd-8b94-4b91-832c-10f9b70ed153" id="id-084277bd-8b94-4b91-832c-10f9b70ed153"></a>

* Principal: 1,000 TUNDRA-S
* LP Value: 2,000 USDC
* Duration: 90 days
* Base Rate: 12% APY
* Tier Multiplier: 2.0
* LP Fee Rate: 10% APY
* Base Reward: 1,000 × \[(1 + (0.12/365))^90 - 1] × 2.0 = 59.51 TUNDRA-S
* LP Reward: (2,000 × 0.10 × 90) / 365 = 49.32 USDC value
* Total Reward Value: 59.51 TUNDRA-S + 49.32 USDC equivalent

The TUNDRA-S reward calculation system combines mathematical precision with Solana’s computational efficiency to deliver transparent, fair, and motivating rewards for vault participants. By accounting for multiple factors including stake amount, duration, tier selection, and additional participation, the system incentivizes behavior that benefits both individual stakers and the broader ecosystem.
