> For the complete documentation index, see [llms.txt](https://dev.init.capital/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.init.capital/contract-references/initoracle.md).

# InitOracle

INIT oracle contract.

## View Functions

### primarySources

Get the primary oracle source for the given token address.

{% hint style="info" %}
If the token is not supported, the primary source will be Solidity's default value (0 value).
{% endhint %}

```solidity
function primarySources(address _token) external view returns (address primarySource);
```

Parameters:

| Name     | Type      | Description                                |
| -------- | --------- | ------------------------------------------ |
| `_token` | `address` | token address to get primary oracle source |

Returns:

| Name            | Type      | Description                   |
| --------------- | --------- | ----------------------------- |
| `primarySource` | `address` | primary source oracle address |

### secondarySources

Get the secondary oracle source for the given token address.

{% hint style="info" %}
If the token is not supported, the secondary source will be Solidity's default value (0 value).
{% endhint %}

```solidity
function secondarySources(address _token) external view returns (address secondarySource);
```

Parameters:

| Name     | Type      | Description                                  |
| -------- | --------- | -------------------------------------------- |
| `_token` | `address` | token address to get secondary oracle source |

Returns:

| Name              | Type      | Description                    |
| ----------------- | --------- | ------------------------------ |
| `secondarySource` | `address` | seconary source oracle address |

### maxPriceDeviations\_e18

Get the maximum price deviation allowed between the sources for the given token address, with `10^18` precision.

```solidity
function maxPriceDeviations_e18(address _token) external view returns (uint maxPriceDeviation_e18);
```

Parameters:

| Name     | Type      | Description                              |
| -------- | --------- | ---------------------------------------- |
| `_token` | `address` | token address to get max price deviation |

Returns:

| Name                    | Type      | Description                                    |
| ----------------------- | --------- | ---------------------------------------------- |
| `maxPriceDeviation_e18` | `uint256` | maximum price deviation with `10^18` precision |

## External Functions

### getPrice\_e36

Get the price for a specified token, with `10^36` precision.

```solidity
function getPrice_e36(address _token) external view returns (uint price_e36);
```

Parameters:

| Name     | Type      | Description                |
| -------- | --------- | -------------------------- |
| `_token` | `address` | token address to get price |

Results:

| Name        | Type      | Description                        |
| ----------- | --------- | ---------------------------------- |
| `price_e36` | `uint256` | token price with `10^36` precision |

### getPrices\_e36

Get prices for the specified tokens, with `10^36` precision.

```solidity
function getPrices_e36(address[] calldata _tokens) external view returns (uint[] memory prices_e36);
```

Parameters:

| Name      | Type        | Description                         |
| --------- | ----------- | ----------------------------------- |
| `_tokens` | `address[]` | array of token address to get price |

Results:

| Name         | Type        | Description                                  |
| ------------ | ----------- | -------------------------------------------- |
| `prices_e36` | `uint256[]` | array of token prices with `10^36` precision |


---

# 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://dev.init.capital/contract-references/initoracle.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.
