# 3.2 The Vault Standard: OmniVault

OmniVault is the "central bank" of the protocol. It adopts a Singleton architecture to centrally manage all liquidity within the protocol. To maximize capital efficiency and ensure the rigor of accounting standards, OmniVault strictly adheres to the ERC-4626 Tokenized Vault Standard.

#### 3.2.1 ERC-4626 Implementation for Yield-Bearing Escrow

In traditional guarantee agreements, funds remain idle during the Lock Period, resulting in significant opportunity costs. OmniVault converts idle funds into interest-bearing assets through modular Strategy Adapters.

1\. Architecture Logic

OmniVault implements the IERC4626 interface. When a user deposits assets (such as USDC) into the collateral contract, the Vault will perform the following atomic operations:

* Deposit: User deposits $$ $Asset$ $$。
* Mint: Vault Mint internal tokens according to the current exchange rate $$ $Share$ $$（份额）。
* Invest: Vault will $$ $Asset$ $$ Inject into low-risk DeFi protocols that have passed DAO whitelist certification (such as Aave V3 Lending Pool or Lido Staking).

2\. Share Calculation

To handle the balance changes caused by interest accrual, Vault only tracks shares internally. The asset exchange rate is determined by the following formula:

$$
ExchangeRate = \frac{TotalAssets\_{underlying} + AccumulatedYield}{TotalShares\_{minted}}
$$

* When the guarantee ends (Finalization), the seller receives not only the original principal but also can choose to be configured to receive principal + returns, or the agreement will use the return portion as Protocol Revenue to repurchase $PACT tokens.
* Risk isolation: Each asset (such as USDC, ETH) corresponds to an independent Vault instance to prevent the spread of bad debts from a single asset.

3\. Strategy Safety

To prevent risks from external DeFi protocols, OmniVault has implemented strict "Conservative LTV" (Conservative Loan-to-Value) and "Emergency Exit" mechanisms. Once a peg deviation in an external protocol is detected, the Keeper will trigger emergencyWithdraw(), withdrawing the funds to the local Vault for freezing.

***

#### 3.2.2 Asset Segregation Logic

Although all funds are physically stored in the same Vault contract address, logically, the funds for each secured transaction are absolutely isolated. This design of "physical centralization and logical isolation" greatly reduces Gas consumption.

1\. Virtual ledger (Virtual Accounting Ledger)

VaultIt internally maintains a multi-dimensional mapping table as the sole source of truth(Source of Truth)：

Solidity

```
// Mapping: EscrowID => (TokenAddress => Amount)
mapping(bytes32 => mapping(address => uint256)) private _escrowBalances;

// Mapping: EscrowID => StrategyAddress
mapping(bytes32 => address) private _activeStrategies;
```

2\. Access Control List(Access Control List - ACL)

OmniVault Not just anyone can call it. It implements a strict whitelist mechanism:

* OnlyOES: Only when `OmniRegistry`registered in and the status is `Active` OES instance of（Proxy Contract）Only has the right to call `transfer` or `withdraw` Function.
* Scope Restriction: OES instance A can only operate `_escrowBalances[ID_A]` funds. It strictly prohibits accessing or embezzling the balance of OES Instance B. This eliminates the risk of cross-order fund embezzlement at the code level.

3\.  Flash Loans & Liquidity Buffer

Due to Vault's deep capital pool, OmniVault natively supports the ERC-3156 Flash Loan standard.

* Idle uninvested funds can be lent to arbitrageurs.
* The handling fee generated by flash loans (such as 0.09%) is directly injected into`AccumulatedYield`so that all users engaged in secured transactions can passively share in this profit.
* Safety lock: The flash loan logic is being `ReentrancyGuard` Wrap, and strictly verify `callback` the integrity of the remaining balance afterwards, ensuring zero risk to the principal.

***

> OmniPact is not just a payment or transaction tool, but a financial infrastructure with DeFi composability and capital efficiency.


---

# Agent Instructions: 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://docs.omnipact.io/developers/omnipact-technology-white-paper/readme/oes-the-omni-escrow-system/3.2-the-vault-standard-omnivault.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.
