# Key Components

Vaults is built from several core components that work together to deliver secure, transparent, and AI-assisted on-chain investment strategies.

### 3.1. Vault Smart Contracts

* The backbone of the platform, deployed on supported blockchains (e.g., Solana).
* Manage deposits, withdrawals, strategy execution, profit calculation, and automated profit-sharing.
* Enforce all vault rules, including fund allocation, risk parameters, and distribution logic, without centralized control.

### 3.2. AI Agent (Decision Support Layer)

* Assists Creators with market analysis, performance tracking, and strategy optimization.
* Prepares transactions for execution based on Creator-approved actions.
* Provides real-time risk metrics, opportunity detection, and protocol interaction recommendations.
* Does **not** execute trades autonomously without Creator command.

### 3.3. Unified Dashboard (Invested & Created)

A single, role-aware dashboard that aggregates both **Invested Vaults** and **Created Vaults**:

* **Portfolio views**
  * **Invested Vaults**: Total deposited, deposit PnL, PnL chart over time.
  * **Created Vaults**: TVL, deposit/withdraw, Creator earnings, Gas Tank, open positions, pending actions.
* **Analytics & charts (both roles)**: TVL, PnL (24H/7D/30D/90D), APR (age-aware display), allocation breakdown.
* **Controls**
  * Time filters
  * Deep links to vault details, activity, and chat.
* **Access & gating**
  * Role detection via wallet signature

### 3.4. AI Agent & Chat (Role-Aware)&#x20;

A single chat surface with **context-aware prompts** and **permissions by role**:

* **Common (both roles)**
  * Natural-language queries: performance explainer, risk, fees, activity recap.
* **Creator capabilities**
  * Strategy assistance: suggestions (swap, add/remove LP, stake/unstake, borrow/lend), routing & slippage advice.
  * **Transaction preparation**: AI prepares tx bundles, gas estimates, safety checks; **Creator must review & confirm** to execute on-chain.
  * Ops tools: claim rewards, profit-share calculation previews, Gas Tank top-up guide, scheduling recurring ops (where supported).
* **Depositor capabilities**
  * Portfolio Q\&A, deposit/withdraw flows, APR/PnL explanations, allocation over time.
  * View vault details such as PnL, drawdown thresholds, and Creator actions.
  * No strategy-changing actions.

### 3.5. Smart Contracts & Security

* Blockchain-based smart contracts for vault creation, deposits, withdrawals, and strategy execution.
* On-chain profit calculation & automated profit-share distribution according to vault parameters.
* Gas Tank mechanism to ensure transaction fees are covered for on-chain actions.
* Non-custodial fund management - only the vault smart contract controls assets according to predefined rules.
* Role-based function access: Creator actions vs. Depositor actions.
* Security measures: contract audits, protocol integration vetting, fail-safe controls (pause/withdraw all) in emergencies.

### 3.6. API & Integrations

* Integration with multiple **DeFi protocols** (Meteora, Jupiter, etc.) for swaps, LP, staking, lending.
* Internal APIs for AI Agent to fetch on-chain state, performance metrics, and historical activity.
* Market data API aggregating on-chain oracles, liquidity pools, and selected off-chain sources.
* AI Agent endpoints for strategy recommendations, risk assessment, and transaction preparation (role-aware).

Event streaming/webhooks for vault state changes, Gas Tank alerts, profit-share events.

* Secure API authentication & permission control based on wallet roles (Creator / Depositor).
