# WeEthWstEthSpotOracle

[Git Source](https://github.com/Ion-Protocol/ion-protocol/blob/88cc595825f1dc2eb738fb93e172a3e8ab7a5c43/src/oracles/spot/lrt/WeEthWstEthSpotOracle.sol)

**Inherits:** SpotOracle

The weETH spot oracle denominated in wstETH

### [State Variables](https://docs.ionprotocol.io/devs/smart-contract-architecture/oracles/spot/lrt/broken-reference) <a href="#state-variables" id="state-variables"></a>

#### [MAX\_TIME\_FROM\_LAST\_UPDATE](https://docs.ionprotocol.io/devs/smart-contract-architecture/oracles/spot/lrt/broken-reference) <a href="#max_time_from_last_update" id="max_time_from_last_update"></a>

```
uint256 public immutable MAX_TIME_FROM_LAST_UPDATE;
```

### [Functions](https://docs.ionprotocol.io/devs/smart-contract-architecture/oracles/spot/lrt/broken-reference) <a href="#functions" id="functions"></a>

#### [constructor](https://docs.ionprotocol.io/devs/smart-contract-architecture/oracles/spot/lrt/broken-reference) <a href="#constructor" id="constructor"></a>

Creates a new `WeEthWstEthSpotOracle` instance.

```
constructor(uint256 _ltv, address _reserveOracle, uint256 _maxTimeFromLastUpdate) SpotOracle(_ltv, _reserveOracle);
```

**Parameters**

| Name                     | Type      | Description                                        |
| ------------------------ | --------- | -------------------------------------------------- |
| `_ltv`                   | `uint256` | The loan to value ratio for weETH <> wstETH        |
| `_reserveOracle`         | `address` | The associated reserve oracle.                     |
| `_maxTimeFromLastUpdate` | `uint256` | The maximum delay for the oracle update in seconds |

#### [getPrice](https://docs.ionprotocol.io/devs/smart-contract-architecture/oracles/spot/lrt/broken-reference) <a href="#getprice" id="getprice"></a>

Gets the price of weETH in wstETH. (ETH / weETH) / (ETH / stETH) \* (wstETH / stETH) = wstETH / weETH

*Redstone oracle returns ETH per weETH with 8 decimals. This needs to be converted to wstETH per weETH denomination.*

```
function getPrice() public view override returns (uint256);
```

**Returns**

| Name     | Type      | Description                                     |
| -------- | --------- | ----------------------------------------------- |
| `<none>` | `uint256` | wstEthPerWeEth price of weETH in wstETH. \[WAD] |


---

# 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.ionprotocol.io/devs/smart-contract-architecture/oracles/spot/lrt/weethwstethspotoracle.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.
