# Oracles

The first component of a vault is its oracle. The oracle is used to compute initial shares minting. When a deposit and burn event, it is also use to get the current price of the market and have an up to date price.

These oracles are adapters from existing oracles like chainlink.

### Reading a Mangrove Vault Oracle

An oracle just contains a single definition which is its tick (in a base/quote market). Here is a quick definition of the mangrove [Glossary](/start-here/glossary.md#tick).

{% @github-files/github-code-block url="<https://github.com/mangrovedao/mangrove-vault/blob/899abdb187f1801ba44621c0e25a697edda859e7/src/oracles/IOracle.sol#L12-L17>" %}

If the market in question was WETH/USDC, with *p* being the price and *t* being the tick, assuming the current price of ETH is 2500 USDC, WETH has 18 decimals, USDC has 6 decimals, we would have the following:

$$
p = \frac{2500e6}{1e18}
$$

$$
t = \frac{ln(p)}{ln(1.0001)} = \frac{ln(2.5e-9)}{ln(1.0001)} = -198079
$$

This formula is such that same decimals and price makes a tick of 0, in the market USDC/USDT for example.

By reversing the formula, computing the price from the tick is as follows for the same market.

$$
p = 1.0001^{t}
$$

```typescript
```


---

# 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.mangrove.exchange/dev/vaults/understanding-vaults/oracles.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.
