> For the complete documentation index, see [llms.txt](https://csigma-edge.gitbook.io/csigma-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://csigma-edge.gitbook.io/csigma-protocol/about-edge/oracles.md).

# Oracles

Edge and csUSD both rely on the **cSigma Asset Oracle** to ensure all deposits, withdrawals, and portfolio valuations are priced **transparently and accurately**.\
The oracle is designed to track **total assets under management (AUM)** for each vault or pool, updating exchange rates so that users always interact with the most accurate values.

***

### How It Works

The cSigma Oracle continuously calculates the **net asset value (NAV)** for each pool and vault by combining:

* **Reserve balances** (USDC, USDT held in the vault or pool)
* **Deployed capital** (funds lent to institutional borrowers)
* **Accrued interest** on outstanding loans

The Oracle updates AUM and exchange rates in two ways:

1. **Real-time updates** triggered whenever:
   * Borrowers make repayments
   * New funds are deployed
   * A deposit or withdrawal is initiated
   * The Fund Manager rebalances capital between reserves and deployed assets
2. **Scheduled updates** on a daily cycle to checkpoint AUM values.

For **Edge Pools**, updates apply individually to each ERC-4626 pool.\
For **csUSD**, updates are aggregated across all ERC-7575 sub-vaults to calculate the unified csUSD price.                                                                              For **csLYD**, updates reflect the performance of all ERC-7575 sub-vaults and their Variable Yield Pools (VYPs) managed under the csLYD Fund Manager contract.

For **Edge Pools**, updates apply individually to each ERC-4626 pool. For **csUSD**, updates are aggregated across all ERC-7575 sub-vaults to produce a unified csUSD price. For **csLYD**, updates reflect the performance of all ERC-7575 sub-vaults and their Variable Yield Pools (VYPs) managed under the csLYD Fund Manager contract.

***

### Why the Oracle Matters

The Oracle plays a critical role in both systems:

* **Deposits / Minting** – Determines how many LP tokens (Edge Pools), csUSD (csUSD Vault) and the csLYD (csLYD Vault) a user receives for their deposit.
* **Withdrawals / Burning** – Determines how much USDC or USDT a user receives when redeeming.
* **Yield Tracking** – Enables real-time yield accrual through rising token exchange rates.
* **Portfolio Transparency** – Displays accurate AUM and asset breakdowns to users.

***

### Exchange Rate Calculations

#### Edge Pools (ERC-4626)

* **Exchange Rate (Deposit)** = `totalSupply / totalAssets`
* **Exchange Rate (Withdraw)** = `totalAssets / totalSupply`
* **totalAssets** = `reserveBalance + assetsUnderManagement`

#### csUSD Vault (ERC-7575)

* A **single unified exchange rate** is used for both deposits and withdrawals:\
  **Exchange Rate (csUSD)** = `totalAssets / totalSupply`
* **totalAssets** = `Total reserveBalance (USD) + Total assetsUnderManagement (USD)`.

***

By combining **real-time recalculations** with **daily checkpoints**, the cSigma Oracle ensures that all interactions in Edge and csUSD are fair, transparent, and based on the most current asset values.
