# CompositeOracle

Reads two oracles and returns their product

## Functions

### constructor

```solidity
function constructor(
    address _core,
    contract IOracle _oracleA,
    contract IOracle _oracleB
) public
```

CompositeOracle constructor

#### Parameters

| Name       | Type             | Description              |
| ---------- | ---------------- | ------------------------ |
| `_core`    | address          |                          |
| `_oracleA` | contract IOracle | first referenced oracle  |
| `_oracleB` | contract IOracle | second referenced oracle |

### update

```solidity
function update() external
```

updates the oracle price

### isOutdated

```solidity
function isOutdated() external returns (bool)
```

determine if read value is stale

#### Return Values

| Name  | Type | Description                 |
| ----- | ---- | --------------------------- |
| `[0]` | bool | true if read value is stale |

### read

```solidity
function read() external returns (struct Decimal.D256, bool)
```

read the oracle price

#### Return Values

| Name  | Type                | Description            |
| ----- | ------------------- | ---------------------- |
| `[0]` | struct Decimal.D256 | oracle price           |
| `[1]` | bool                | true if price is valid |


---

# 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.essencefinance.io/development/smart-contracts/oracle/compositeoracle.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.
