---
description: The first component of a vault is its
---

# 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 [Tick​](https://app.gitbook.com/s/-MdT1ftsp-ASVL0f7MSf/start-here/glossary#tick "mention").

{% @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
```
