> For the complete documentation index, see [llms.txt](https://docs.midas.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.midas.app/transparency/oracle-architecture.md).

# Oracle Architecture

The oracle system is the backbone of accurate, tamper-resistant pricing across all mToken operations. It ensures that the NAV used in any deposit or redemption reflects a verified, up-to-date valuation of the underlying portfolio.

The oracle architecture connects the offchain NAV calculation process to the onchain smart contracts through a secure, three-step pipeline:

{% stepper %}
{% step %}

#### NAV Verification & Price Update

Once the NAV is provided by the strategy manager, Midas verifies and validates it internally. This includes deducting fees accrued since the last price update and applying sanity checks to ensure price integrity. The update is initiated from a secured backend and reviewed by at least 2 trained co-signers from the Midas team. After this verification step, Midas pushes the corresponding price update onchain to the Oracle Feed contract.
{% endstep %}

{% step %}

#### The Oracle Feed&#x20;

The Oracle Feed receives the price update and stores it onchain, alongside its exact cryptographic timestamp for transparent record-keeping.&#x20;

As part of this process, the Oracle Feed performs a deviation check: it compares the newly submitted price against the previously recorded price, enforcing deviation thresholds to prevent erroneous data entry or anomalous price volatility. If a proposed update exceeds the min/max bounds, the price update fails. To ensure price integrity, deposits and redemptions may then be manually paused until the next valid price update.&#x20;

High-deviation updates can still be pushed onchain, but require a different process with a higher quorum for approval than routine updates.
{% endstep %}

{% step %}

#### The Datafeed Contract

The Datafeed serves as the authoritative smart contract consumed by the minter and redeemer smart contracts. It retrieves the raw price from the Oracle Feed and applies a final layer of protection by validating the "heartbeat" (data freshness) and enforcing price boundaries. Only once these secondary security checks are satisfied is the NAV authorised for use in deposit and redemption transactions.

{% tabs %}
{% tab title="Freshness" %}
The contract verifies the exact time the data was generated to ensure it is recent. Rejecting stale data prevents users or the protocol from executing transactions at outdated valuations.
{% endtab %}

{% tab title="Boundaries" %}
The datafeed confirms that the price falls within hardcoded minimum and maximum limits. This acts as a failsafe against human or technical errors (for example, preventing a price from being set to zero).
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Atomic Execution**

If a price update fails one of the above checks, the smart contract reverts the entire transaction. The update is temporarily discarded, ensuring the valuation remains secure and user funds are protected.
{% endhint %}

## Third-Party Oracles for Payment Tokens

While the mToken NAV is updated via the Midas Oracle Pipeline, the payment tokens, i.e. the tokens used for deposits and redemptions, such as wETH, WBTC, or stablecoins, require continuous, real-time market pricing. Midas handles this through specific integrations and security bands:

* **Third-Party Oracles:** Midas integrates with established, decentralized oracle networks to provide real-time pricing for all payment tokens, including notably Chainlink and Pyth.
* **Asset Price Validation & Depeg Protection:** When users transact using stablecoins (such as USDC, USDT, or non-USD denominated stables), the system typically maintains a fixed 1:1 conversion ratio to its underlying peg. To ensure safety, Midas applies a Universal Tolerance Band to all payment tokens. For stablecoins, this is a strict corridor of 0.997 to 1.003. This narrow range accommodates routine market liquidity fluctuations while acting as a critical circuit breaker. If the market price of a token provided by our oracles breaks outside these pre-defined boundaries, the system detects the anomaly and halts transactions. This prevents the strategy and its investors from absorbing assets during a severe depeg or price manipulation event.

<br>


---

# 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://docs.midas.app/transparency/oracle-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.
