> ## 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.

# Treasury

> Treasury — Dark Matter Protocol on Robinhood Chain.

# The Treasury & Supernova

`DarkMatterTreasury` is the protocol's **autonomous funding engine**: every
protocol-owned ETH stream lands here and converts back into growth without manual work.

## Streams in

| Stream | Source | Note |
| - | - | - |
| Streak-rescue fees | `StardustWheel.saveStreak()` forwards 100% of the ETH fee | See [Stardust](casino/stardust.md) |
| Gas-sponsor skim | The reactor diverts ≤5% of its team-fee chunk (`gasSponsorBps`) | Fail-safe — a rejected skim never bricks fee routing |
| FounderPass mint revenue | 0.25 ETH × 215, forwarded on mint | Plus the permissionless legacy sweep |
| LootBoxNFT box revenue | 100% of every box price, fail-closed forward | See [Lootboxes](casino/lootbox.md) |
| EarnZapRouter exit fees | 1% of every zap withdrawal | See [Earn Zap](earn/earn-zap.md) |
| NftLoanPool interest fee | 10% of all loan interest | See [NFT Loans](earn/nft-loans.md) |

```solidity theme={null}
receive() external payable { emit Deposited(msg.sender, msg.value); }
```

## Autonomous outflows — allowance-capped

### Gas relay top-up

The treasury cron (the `operator`) tops up the first-deposit gas-sponsor wallet.
Spending is hard-capped by a **rolling 30-day allowance**:

```solidity theme={null}
uint256 public constant OPERATOR_PERIOD = 30 days;
function operatorSpend(address target, uint256 value, string calldata memo) external onlyOperator;
```

Two independent containment layers:

1. **How much** — `allowanceWei` per rolling period; a compromised operator key cannot
   exceed it even in principle.
2. **Where** — with the target allowlist enforced, operator spends only reach
   approved targets (the gas relay EOA). A leaked key funds nothing else.

### Supernova epochs

Every real outflow counts toward the next milestone. When cumulative spend crosses
`milestoneStepWei × (completed + 1)` (default step **0.5 ETH**), the next epoch is
armed and the cron fires it — a **server-wide DUST earning boost** on the wheel:

```solidity theme={null}
function completeMilestone() external;   // admin/operator; permissionless-ish by design
// calls: wheel.activateGlobalBoost(supernovaBoostBps /* default 2× */, supernovaDuration /* 1 day */)
```

The treasury's operating spend literally becomes a **community-visible event** — every
0.5 ETH of protocol gas/spend triggers a 24-hour 2× DUST epoch for everyone.

## The DAO seam

DUST (the non-transferable activity score) is the vote power:

| Parameter | Value |
| - | - |
| Vote period | **3 days** (`VOTE_PERIOD`) |
| Quorum | **1%** of DUST totalSupply, snapshotted at proposal creation |
| Propose | Anyone holding ≥ 1 DUST; target must be a contract |
| Vote weight | Live `balanceOf` at cast time |
| Execute | Admin — until ownership transfers to a DAO executor contract (two-step) |

```solidity theme={null}
function propose(address target, uint256 value, string calldata memo) external returns (uint256);
function castVote(uint256 id, bool support) external;
```

Quorum supply is **snapshotted per proposal**, so quorum can never retro-change when
DUST supply grows. Once the admin seat itself is transferred to a governor contract
(`adminIsGovernor`), proposals execute themselves and the treasury is fully
community-governed.

## Safety summary

| Threat | Containment |
| - | - |
| Operator key leak | 30-day allowance + target allowlist (both enforced on-chain) |
| Malicious proposal | Admin-gated execution until DAO handover; targets must be contracts |
| Quorum gaming | Per-proposal supply snapshot |
| Stranded protocol | Anyone may finalize timelocks; operator can be set to `address(0)` to freeze all autonomous spending |

Next: [Crash — Money Model](casino/crash-economy.md).


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