> For the complete documentation index, see [llms.txt](https://dexible.gitbook.io/dexible/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dexible.gitbook.io/dexible/dxbl/dxbl-technical-paper/community-vault-contract.md).

# Community Vault Contract

The Community Vault oversees the administration of Approved Vault Token assets and the supply of DXBL tokens. Following the Proof of Trade ("PoT") protocol contracts, the [Design Principles](/dexible/dxbl/dxbl-technical-paper/design-principles.md) outlined on that page must be upheld.

{% hint style="info" %}
See the bullet points under the headers titled *Security*, *Trading*, *Gas Fees*, and *Community Vault*.
{% endhint %}

{% content-ref url="/pages/vuMXme6Gi7h5Wqc2gvfP" %}
[Design Principles](/dexible/dxbl/dxbl-technical-paper/design-principles.md)
{% endcontent-ref %}

This diagram outlines the relationship between several contracts.

<figure><img src="https://lh5.googleusercontent.com/oQh_FxyWZ10YdjuSSWnuwLLWBb2mC0RQSIoPxkewzuzhZFUyxn7EBFrwDO_xajHxkWJVCmff9x2ozztIJNvTOX-iLstQ6XtxSjCgCdyzM3CFazb7ZbmGS3rQHismVatTIuSyoCiubDfqRXju-0qs3fU" alt=""><figcaption></figcaption></figure>

At the center is the **CommunityVault**. This hosts the primary configuration, redemption, and pausing features of the vault. It extends several base contracts that focus on accessing stored properties, computing something based on stored properties, rewarding traders, and migrating to new versions of the vault.

**StorageView** provides access to the vault’s configuration and storage properties. It’s a read-only contract.

**ComputationView** uses stored information to compute things like AUM, mint rates, redemption estimates, etc. It too is a read-only contract.

**RewardHandler** handles rewarding traders with tokens and updating volume metrics to adjust mint rates, etc.

**V1Migration** is a mechanism used to migrate the vault to a new version if the protocol and community decide a transition is needed.

The following table outlines how each requirement is satisfied by these contracts.

| Requirement | Satisfied By                       | Description                                                                         |
| ----------- | ---------------------------------- | ----------------------------------------------------------------------------------- |
| 1,2,4       | Gnosis Safe                        | All approvals for changes are managed by multi sig Safe                             |
| 5-8,10      | ComputationView and CommunityVault | Logic to manage asset values and mint rates                                         |
| 9           | Dexible/Vault                      | Dexible is allowed to request rewards for traders and the pool computes the rewards |
| 3           | None                               | This requires general community involvement and audits                              |

To maintain the **24-hour volume window**, the contract logic works like this:

* Hourly buckets of volume totals are maintained
* On each trade, the USD value of the trade's approved vault token is computed using the Chainlink oracle price feeds

{% hint style="info" %}
A vault token must be the input or output token in the swap
{% endhint %}

* The current hour's bucket is incremented with the USD value
* The bucket of the previous 24-hour slot is used to reduce the total 24-hour volume and then reset to 0 to avoid multiple deductions

The following image depicts this a little more clearly:

<figure><img src="/files/D8d2f02xwNB08oFjSQAf" alt=""><figcaption><p>The rolling 24-hour volume window is maintained as a circular list of buckets. 24-hour reductions are simply the next bucket with wraparound logic to account for 24-hour clock.</p></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://dexible.gitbook.io/dexible/dxbl/dxbl-technical-paper/community-vault-contract.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
