# EthPerWstEthRateProvider

[Git Source](https://github.com/Ion-Protocol/nucleus-boring-vault/blob/cc0b494b83e17b9b169a73b96050d2810b690477/src/oracles/EthPerWstEthRateProvider.sol)

**Inherits:** IRateProvider

Reports the price of wstETH in terms of ETH.

## State Variables

### ST\_ETH\_TO\_ETH\_CHAINLINK

```solidity
IChainlink public immutable ST_ETH_TO_ETH_CHAINLINK;
```

### WST\_ETH

```solidity
IWstEth public immutable WST_ETH;
```

### MAX\_TIME\_FROM\_LAST\_UPDATE

```solidity
uint256 public immutable MAX_TIME_FROM_LAST_UPDATE;
```

## Functions

### constructor

```solidity
constructor(address _stEthToEthChainlink, address _wstETH, uint256 _maxTimeFromLastUpdate);
```

**Parameters**

| Name                     | Type      | Description                             |
| ------------------------ | --------- | --------------------------------------- |
| `_stEthToEthChainlink`   | `address` | The chainlink price feed for stETH/ETH. |
| `_wstETH`                | `address` | The wstETH contract address.            |
| `_maxTimeFromLastUpdate` | `uint256` |                                         |

### getRate

Gets the price of wstETH in terms of ETH.

*If the beaconchain reserve decreases, the wstETH to stEth conversion will be directly impacted, but the stEth to Eth conversion will simply be determined by the chainlink price oracle.*

```solidity
function getRate() public view returns (uint256 ethPerWstEth);
```

**Returns**

| Name           | Type      | Description                    |
| -------------- | --------- | ------------------------------ |
| `ethPerWstEth` | `uint256` | price of wstETH in ETH. \[WAD] |

## Errors

### MaxTimeFromLastUpdatePassed

```solidity
error MaxTimeFromLastUpdatePassed(uint256 blockTimestamp, uint256 lastUpdated);
```


---

# 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.nucleusearn.io/nucleus-architecture/smart-contracts/contracts/oracles/ethperwstethrateprovider.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.
