# EthXSpotOracle

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

**Inherits:** SpotOracle

The ETHx spot oracle.

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

#### [REDSTONE\_ETHX\_PRICE\_FEED](https://docs.ionprotocol.io/devs/smart-contract-architecture/oracles/spot/lst/broken-reference) <a href="#redstone_ethx_price_feed" id="redstone_ethx_price_feed"></a>

```
IRedstonePriceFeed public immutable REDSTONE_ETHX_PRICE_FEED;
```

#### [USD\_PER\_ETH\_CHAINLINK](https://docs.ionprotocol.io/devs/smart-contract-architecture/oracles/spot/lst/broken-reference) <a href="#usd_per_eth_chainlink" id="usd_per_eth_chainlink"></a>

```
IChainlink public immutable USD_PER_ETH_CHAINLINK;
```

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

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

Creates a new `EthXSpotOracle` instance.

```
constructor(
    uint256 _ltv,
    address _reserveOracle,
    address _redstoneEthXPriceFeed,
    address _usdPerEthChainlink
)
    SpotOracle(_ltv, _reserveOracle);
```

**Parameters**

| Name                     | Type      | Description                           |
| ------------------------ | --------- | ------------------------------------- |
| `_ltv`                   | `uint256` | The loan to value ratio for ETHX.     |
| `_reserveOracle`         | `address` | The associated reserve oracle.        |
| `_redstoneEthXPriceFeed` | `address` | The redstone price feed for ETHx/USD. |
| `_usdPerEthChainlink`    | `address` | The chainlink price feed for ETH/USD. |

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

Gets the price of ETHx in ETH.

*Redstone oracle returns dollar value per ETHx with 6 decimals. This needs to be converted to a WAD and to ETH denomination.*

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

**Returns**

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