> For the complete documentation index, see [llms.txt](https://sovavault.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sovavault.gitbook.io/docs/technical-resources/developers-zone.md).

# Developers Zone

### Overview

This section outlines how power users and developers can interact directly with the protocol - whether to integrate with DeFi apps, build analytics dashboards, or automate workflows.

***

## Smart Contract Architecture

Sova is composed of **modular smart contracts**, following industry standards like **ERC-4626**. Below are the core components and their roles:

| **Contract**   | **Purpose**                                                                |
| -------------- | -------------------------------------------------------------------------- |
| **Registry**   | Manages deployments and component registration (strategies, hooks, assets) |
| **Strategy**   | Controls portfolio logic and interfaces with off-chain execution           |
| **tRWA Token** | ERC-4626 vault token representing user shares                              |
| **Conduit**    | Handles secure transfer of assets between user and protocol                |
| **Reporter**   | Provides NAV updates and price data                                        |
| **Escrow**     | Holds deposits temporarily during gated mint or withdrawal windows         |
| **Hook**       | Enforces compliance checks before actions like deposit or withdraw         |

***

## Key Standards Used

* **ERC-4626**: Vault interface standard for yield-bearing tokens
* **Minimal Proxy Pattern (EIP-1167)**: Used for gas-efficient strategy deployments
* **Role-Based Access Control (RBAC)**: Prevents unauthorized actions across the protocol
* **Off-chain Oracle Integration**: Reporter contract posts NAV and price feeds

***

## Roles & Access Permissions

Sova uses **granular, role-based permissions** to gate critical protocol functions:

| **Role**               | **Permissioned Actions**                   |
| ---------------------- | ------------------------------------------ |
| **PROTOCOL\_ADMIN**    | Add/remove assets, hooks, strategies       |
| **STRATEGY\_ADMIN**    | Manage strategies and their configuration  |
| **STRATEGY\_OPERATOR** | Pull/push funds from the strategy contract |
| **RULES\_ADMIN**       | Manage hook system for compliance logic    |
| **KYC\_OPERATOR**      | Modify allow/deny lists for investors      |
| **PRICE\_UPDATER**     | Push NAV updates to vault tokens           |

> 🔧 **Role Management**
>
> All roles are administered via a **Role Manager contract**. Roles can be granted, revoked, or self-renounced.

***

## Interacting with the Protocol

For developers looking to integrate:

### Read NAV and Vault Data

```solidity
uint256 nav = ITVault(tokenAddress).convertToAssets(userShares);
```

### Deposit Flow

```solidity
IERC20(USDC).approve(tokenAddress, amount);
ITVault(tokenAddress).deposit(amount, msg.sender);
```

### Redeem Flow

```solidity
ITVault(tokenAddress).redeem(shares, receiver, owner);
```

### For GatedMintRWA Vaults

```solidity
bytes32 depositId = IGatedMint(tokenAddress).requestDeposit(amount, receiver);
// Wait for manager approval...
IGatedMint(tokenAddress).mintShares(receiver, amount);
```

> 📚 **Documentation Resources**
>
> See the **Sova ABI & Interface repo** at <https://github.com/SovaNetwork/fountfi> for up-to-date contract ABIs and structs.

***

## Compliance Hooks & Extensibility

**Hooks** enable compliance logic (e.g. KYC, AML, transfer restrictions) to be modular and upgradeable.

* **Hooks can be added/removed** per vault
* **Operation-specific** (e.g., deposit, withdraw, transfer)
* **Common hooks include** KycRulesHook, TransferBlockHook, and WithdrawalQueueHook

> 🛠️ **Custom Development**
>
> Developers can write their own hook contracts following the **IHook interface** and register them via governance.

***

## Integrating tRWA Tokens in DeFi

Because tRWA tokens follow the **ERC-4626 interface**, they can be integrated into:

* **Lending markets**
* **Structured products**
* **Tokenized asset managers**
* **Portfolio dashboards** (e.g. Zapper, DeBank)

> ⚠️ **Integration Considerations**
>
> Be aware that some tRWA tokens are **non-transferable** or gated by compliance hooks - integration should account for that.


---

# 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://sovavault.gitbook.io/docs/technical-resources/developers-zone.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.
