> ## Documentation Index
> Fetch the complete documentation index at: https://docs.darkmatter.rdytobash.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Yield Economics

> Yield Economics — Dark Matter Protocol on Robinhood Chain.

# Reactor Yield & Withdrawal Economics

The reactor is a **mutual bonding-curve miner**: deposits buy Radiation, Radiation
converts to Reactor Nodes, Nodes emit more Radiation, and exiting sells Radiation back
into the shared pool. This page documents the exact mechanics that make the numbers work.

## Core constants

```solidity theme={null}
uint256 private constant RADIATION_TO_CONV_1NODE = 1_080_000;
uint256 public constant PSN  = 10000;   // bonding-curve numerator
uint256 public constant PSNH = 5000;    // bonding-curve half-numerator
uint256 public constant MAX_WITHDRAW_MULTIPLIER = 2;   // 2× lifetime deposit cap
uint256 public constant SELL_FEES = 10;                // 10% node burn on exit
uint256 public constant VIRTUAL_SEED_BALANCE = 1 ether;
uint256 public constant INITIAL_MARKET_RADIATION = 108_000_000_000;
```

## How a deposit becomes yield

1. **Buy radiation** — bonding-curve pricing against the live pool:

```solidity theme={null}
function calculateTrade(uint256 rt, uint256 rs, uint256 bs) private pure returns (uint256) {
    uint256 numerator   = PSN * bs;
    uint256 denominator = PSNH + ((PSN * rs) + (PSNH * rt)) / rt;
    return numerator / denominator;
}
```

2. **Fee the purchase** — 10% of the bought radiation is removed
   (`radiationBought -= devFee(radiationBought)`, `FEE_PERCENT = 10`). This fee funds
   the referral tree, not a wallet (see [Referral Payments](reactor/referral-leaderboard.md)).

3. **Auto-convert** — every `1_080_000` radiation becomes one Reactor Node instantly:

```solidity theme={null}
uint256 newNodes = radiationUsed / RADIATION_TO_CONV_1NODE;
reactorNodes[msg.sender] += newNodes;
```

4. **Nodes emit** — nodes produce radiation continuously
   (`getRadiationSinceLastCondense` accrues it per second); compounding
   (`condenseMatter`, once per hour) converts radiation back into more nodes.

## Exiting — `extractRadiation()`

Selling radiation back to the curve pays out ETH with three protections:

**a. The 2× lifetime cap.**

```solidity theme={null}
uint256 maxLimit = userDeposits[msg.sender] * MAX_WITHDRAW_MULTIPLIER;
if (userClaims[msg.sender] + radiationValue >= maxLimit) {
    radiationValue = maxLimit > userClaims[msg.sender] ? maxLimit - userClaims[msg.sender] : 0;
}
```

Lifetime withdrawals can never exceed 2× lifetime deposits. Early extractors who grow
the pool are capped; the cap is per-user and cannot be lifted by anyone.

**b. The 10% node burn.**

```solidity theme={null}
uint256 feesNodes = (newNodes * SELL_FEES) / 100;
reactorNodes[msg.sender] -= feesNodes;   // 10% of nodes burned on exit
```

Extracting burns 10% of the nodes the accrued radiation represents — a direct cost for
leaving, which structurally rewards compounding.

**c. Reserved-balance accounting.** Sell value is computed against the pool balance
**minus** queued pool credits, so pending fee forwards can never be paid out to
extractors.

## Daily / weekly leaderboard prizes

Every deposit also feeds two prize ladders paid from the day's/week's total investment
volume (see [Referral & Leaderboard](reactor/referral-leaderboard.md) for the split):

```
daily:   0.5% of the day's total deposits, split 40/30/20/10 across the top 4
weekly:  1.0% of the week's total deposits, split 40/30/20/10 across the top 4
```

## Worked example — full lifecycle

Player deposits **1 ETH** (skim at 0 for simplicity):

| Step | Event | Balance effect |
| - | - | - |
| 1 | Fee waterfall pays 0.12 ETH out, 0.879 ETH stays in curve | pool +0.879 ETH |
| 2 | Buys radiation, minus 10% purchase fee | referral tree funded |
| 3 | Auto-converts to nodes (e.g. 40 nodes) | nodes +40 |
| 4 | Nodes emit radiation for 3 days | pending radiation grows |
| 5 | `condenseMatter()` — 2% fee, converts to nodes | nodes grow \~compounded |
| 6 | `extractRadiation()` — sells remaining radiation | ≤ 2× cap enforced, 10% nodes burned |

**Key insight:** the 2× cap makes the reactor structurally non-ponzi — the pool can
never owe more than twice what was deposited, and every fee in the waterfall reduces
the effective exposure further.

## View functions (integration surface)

| Function | Returns |
| - | - |
| `getMyNodes(address)` | Active Reactor Nodes |
| `getMyRadiation(address)` | Claimed + pending radiation |
| `radiationRewards(address)` | Pending radiation valued in ETH (sell price) |
| `getETHDeposited(address)` | Lifetime gross deposits |
| `getETHClaimed(address)` | Lifetime withdrawals |
| `claimableOf(...)` equivalents on pools | Unclaimed pool fees |

Next: [Referral & Leaderboard Payments](reactor/referral-leaderboard.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.