> For the complete documentation index, see [llms.txt](https://docs.mangrove.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mangrove.exchange/dev/vaults/managing-a-vault-cli/deploying-an-oracle.md).

# Deploying an oracle

In order to deploy an oracle first select the chain and the correct option in the main menu as well as the market you want to create the oracle for:

<figure><img src="/files/3v0vRyyYm1reYzhYbHqU" alt=""><figcaption><p>initial chain and market choice for oracle deployment</p></figcaption></figure>

### Chainlink adapter

{% hint style="info" %}
Chainlink price feeds addresses can be [found here](https://docs.chain.link/data-feeds/price-feeds/addresses?network=ethereum\&page=1).
{% endhint %}

To deploy a chainlink adapter, choose chainlink v2, in our example we will be deploying an oracle for WETH/USDC using 1 base feed (ETH/USD) and 1 quote feed (USDC/USD). Note that custom ERC4626 vaults can be added on both end.

<figure><img src="/files/nGLg6q45heyKNUZ0QKbb" alt=""><figcaption><p>confirm deployment of the oracle</p></figcaption></figure>

{% hint style="info" %}
Note here that decimals are set by default thanks to market informations. Make sure to double check the proposed decimals and report any error.
{% endhint %}

The oracle wil check for any existing deployment with these parameters and will return the oracle address (deploys it if needed)

<figure><img src="/files/59FX7wr47SZUX7OE9ZH0" alt=""><figcaption><p>oracle deployment result</p></figcaption></figure>

### Dia Adapter

{% hint style="info" %}
The oracle address and key must point to a DiaOracleInstance
{% endhint %}

To deploy a Dia instance, find the oracle and keys needed. Keys are limited in size for efficiency. If more storage is needed, please reach out. Select Dia, the pool and keys. ERC4626 vaults can also be added on both ends.

Before selecting a key at the contract level, I'd recommend testing the key first to check its correctness. you will then have to infer the number of decimals used for pricing. Here the price was 1951 USD os we can assume 8 decimals for pricing.

<figure><img src="/files/c9ICZAH8NGSwU2MaoUdB" alt=""><figcaption><p>checking key correctness for dia</p></figcaption></figure>

<figure><img src="/files/pS8VgvS6ZxD2BOD3nhON" alt=""><figcaption><p>deploying a dia oracle adapter</p></figcaption></figure>

### Combine oracles

Now let's say we need to combine different oracles together. It is possible as well. Above we deployed an oracle for WETH/USDC, and another one for superOETHb/WETH. We can combine them in order to create a single oracle:

<figure><img src="/files/uQRBhe7pRgKhGH6vb9J7" alt=""><figcaption><p>combining oracles</p></figcaption></figure>


---

# 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://docs.mangrove.exchange/dev/vaults/managing-a-vault-cli/deploying-an-oracle.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.
