> For the complete documentation index, see [llms.txt](https://cryptodao-it.gitbook.io/c-dao/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cryptodao-it.gitbook.io/c-dao/3.-technical/architecture.md).

# Architecture

## Design Philosophy

Crypto DAO V3 Pro uses a modular architecture where:

* Each component is independent
* Components communicate through defined interfaces
* Failure in one component doesn't cascade to others

This is the **Bophades Framework** — a sharded smart contract system.

## The Three Layers

```
┌─────────────────────────────────────────┐
│              KERNEL                      │
│   (Coordination & Authority Control)     │
├─────────────────────────────────────────┤
│              MODULES                     │
│   Treasury │ Staking │ RBS │ Structure  │
├─────────────────────────────────────────┤
│              POLICIES                    │
│   (Business Logic & Parameter Control)   │
└─────────────────────────────────────────┘
```

### Kernel

The operating system of the protocol:

* Manages permissions between modules
* Controls upgrade paths
* Coordinates cross-module operations
* Single source of authority truth

### Modules (Shards)

Independent smart contracts for each function:

| Module    | Responsibility                           |
| --------- | ---------------------------------------- |
| Treasury  | Asset storage, minting authority         |
| Staking   | Rebase calculation, user positions       |
| RBS       | Price monitoring, intervention execution |
| Structure | Relationships, permissions               |

Each module:

* Has isolated state
* Cannot directly modify other modules
* Communicates only through Kernel
* Can be upgraded independently

### Policies

Business logic layer:

* Rebase rate calculations
* Discount algorithms
* Circuit breaker triggers
* Parameter adjustments

## Permission Model

Unlike typical contracts where ownership is per-contract, Crypto DAO defines ownership at the protocol level:

```
Kernel
   ↓
Defines what can call what
   ↓
Modules respect Kernel authority
   ↓
Policies execute within boundaries
```

## Sharding Benefits

| Benefit            | Explanation                                |
| ------------------ | ------------------------------------------ |
| **Isolation**      | Bug in Module A doesn't affect Module B    |
| **Upgradeability** | Update one module without touching others  |
| **Auditability**   | Smaller, focused contracts easier to audit |
| **Security**       | Attack surface limited to single module    |

## Data Flow Example: Staking Reward

{% stepper %}
{% step %}

### User stakes PRO

Staking Module records position.
{% endstep %}

{% step %}

### Rebase calculation

Policy calculates reward amount.
{% endstep %}

{% step %}

### Treasury minting requested

Kernel verifies Staking can request from Treasury.\
Treasury mints PRO (backed by reserves).
{% endstep %}

{% step %}

### Distribution

Staking Module updates user balance and the user sees increased stake.
{% endstep %}
{% endstepper %}

Each step involves specific modules with defined permissions.

## Contract Relationships

```
┌─────────────┐     ┌─────────────┐
│  Treasury   │◄────│   Kernel    │────►│  Staking   │
└─────────────┘     └─────────────┘     └────────────┘
       ▲                   │
       │                   ▼
       │            ┌─────────────┐
       └────────────│     RBS     │
                    └─────────────┘
```

## Security by Design

{% stepper %}
{% step %}

### No direct access

Users interact through defined entry points.
{% endstep %}

{% step %}

### Permission checks

Every cross-module call is verified by Kernel.
{% endstep %}

{% step %}

### State isolation

Modules cannot read/write other modules' state directly.
{% endstep %}

{% step %}

### Multi-sig gates

Critical operations require multiple signatures.
{% endstep %}
{% endstepper %}

## Detailed Contract Documentation

* [Kernel](broken://pages/78bb87486af012aecf9c2fdadbae73ab46616d22)
* [Treasury Module](broken://pages/7f04be3808571a624051b9e652b22d2ca0076012)
* [Staking Module](broken://pages/215a4ebd2e3923285c4f3766bf46ee4b0dba2e0f)
* [RBS Module](broken://pages/1ab75aba7edc8cc8ff84f2430667426cdbec738d)

## Related

* [Security Overview](broken://pages/ff14e88ad13228ced9991e2cfa77a9a3582081fd)
* [Integration Guide](broken://pages/6481cb33650566697a7207aa5a60a45a9ca46c2e)


---

# 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://cryptodao-it.gitbook.io/c-dao/3.-technical/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.
