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

# R33

ERC4626 vault built in `R33.sol`. The source contract is named `R33`, but the ERC20 share token it mints is `"xRAM Liquid Staking Token"` with symbol `hyperRAM`.

The vault wraps xRAM exposure, stakes the underlying into `VoteModule`, and lets an operator vote and compound on behalf of all depositors.

## Core ERC4626 Functions

### deposit

```solidity theme={null}
function deposit(uint256 assets, address receiver) external returns (uint256 shares)
```

Deposits xRAM, stakes it into `VoteModule`, and mints vault shares to `receiver`.

### withdraw

```solidity theme={null}
function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares)
```

Burns shares, withdraws xRAM from `VoteModule`, and transfers xRAM to `receiver`.

### redeem

```solidity theme={null}
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets)
```

Redeems a share amount for the corresponding xRAM assets.

### totalAssets

```solidity theme={null}
function totalAssets() public view returns (uint256)
```

Returns the xRAM currently staked by the vault in `VoteModule`.

### ratio

```solidity theme={null}
function ratio() public view returns (uint256)
```

Returns the current xRAM-per-share ratio, scaled by `1e18`.

## Operator and Governance Functions

### submitVotes

```solidity theme={null}
function submitVotes(address[] calldata pools, uint256[] calldata weights) external
```

Operator-only helper that forwards a vote through `Voter` on behalf of the vault.

### claimIncentives

```solidity theme={null}
function claimIncentives(address[] calldata feeDistributors, address[][] calldata tokens) external
```

Claims vote incentives and fee rewards to the vault.

### swapIncentiveViaAggregator

```solidity theme={null}
function swapIncentiveViaAggregator(AggregatorParams calldata params) external
```

Operator-only reward-processing hook that swaps incentive tokens through a whitelisted aggregator. RAM output is then available for `compound()`.

### compound

```solidity theme={null}
function compound() external
```

Converts any RAM held by the vault into xRAM, deposits that xRAM into `VoteModule`, and increases the vault ratio for all share holders.

### unlock

```solidity theme={null}
function unlock() external
```

Marks the current period as unlocked, but only when the `VoteModule` cooldown is not active.

## Key Concepts

* Deposits are gated by `isUnlocked()`, which requires the current period to be unlocked and not within one hour of the next weekly period.
* Withdrawals and redeems do not use the same vault lock, but they still depend on `VoteModule.withdraw()` succeeding, so the VoteModule cooldown matters.
* `totalAssets()` reads from `VoteModule.balanceOf(address(this))`, not from idle xRAM held directly in the vault.
* Aggregators must be whitelisted by `AccessHub` before `swapIncentiveViaAggregator()` can be used.
* Shares are transferable even though the underlying xRAM token is transfer-restricted.
