> For the complete documentation index, see [llms.txt](https://autopilot-5.gitbook.io/autopilot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://autopilot-5.gitbook.io/autopilot/protocol/markdown/secure-storage-and-reward-distribution-architecture.md).

# Secure Storage & Reward Distribution Architecture

Autopilot uses a dedicated contract the `RewardsVault`  to manage reward storage and distribution. All rewards, once converted to USDC, are held in this contract until claimed by users. The vault operates independently from voting logic and follows a strict on-chain accounting model.

***

#### Key Properties

**Isolated Reward Storage**\
The `RewardsVault` is separate from the contracts responsible for voting, claiming, and swapping.\
No external party — including the protocol team — has access to the funds.

**Tracked Balances**\
All USDC balances are recorded under:

```solidity
solidityCopyEdittotal_tokens_stored
```

This allows the protocol to maintain accurate reward accounting across epochs.

**Built-in Validation**\
The contract includes a `withdrawNonAccounted()` function to resolve rare inconsistencies (e.g., incomplete swaps or edge-case rounding errors).\
This ensures the stored reward pool matches expected balances.

**Proportional Limits**\
User withdrawals are capped based on their voting share from the previous epoch.\
Claims are enforced using fixed formulas tied to veAERO vote weight, preventing overclaiming or manipulation.

***

> The `RewardsVault` is a non-custodial rewards contract.\
> Funds are allocated transparently, based on voting power, and can only be withdrawn by the rightful wallet.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://autopilot-5.gitbook.io/autopilot/protocol/markdown/secure-storage-and-reward-distribution-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
