# RswEthWstEthSpotOracle

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

**Inherits:** SpotOracle

The rswETH spot oracle denominated in wstETH

### [State Variables](broken://pages/g0B9LrtSwnLkrXMzFziE) <a href="#state-variables" id="state-variables"></a>

#### [MAX\_TIME\_FROM\_LAST\_UPDATE](broken://pages/g0B9LrtSwnLkrXMzFziE) <a href="#max_time_from_last_update" id="max_time_from_last_update"></a>

```
uint256 public immutable MAX_TIME_FROM_LAST_UPDATE;
```

### [Functions](broken://pages/g0B9LrtSwnLkrXMzFziE) <a href="#functions" id="functions"></a>

#### [constructor](broken://pages/g0B9LrtSwnLkrXMzFziE) <a href="#constructor" id="constructor"></a>

Creates a new `RswEthWstEthSpotOracle` instance.

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

**Parameters**

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

#### [getPrice](broken://pages/g0B9LrtSwnLkrXMzFziE) <a href="#getprice" id="getprice"></a>

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

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

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

**Returns**

| Name     | Type      | Description                                       |
| -------- | --------- | ------------------------------------------------- |
| `<none>` | `uint256` | wstEthPerRswEth price of rswETH 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/rswethwstethspotoracle.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.
