# PriceFeedWrapper

Returns the price of an asset that doesn’t have a direct feed from [Chainlink](https://docs.chain.link/docs/data-feeds/price-feeds/addresses/).

Written as a generic implementation it can be used, for example, to retrieve the price of `wstETH`. Queries `stETH / ETH` feed and multiplies it by the exchange rate between `stETH / wstETH` before returning the price that it’s then used by the [Auditor](/guides/protocol/auditor.md).

## Public State Variables

### baseUnit

```solidity
function baseUnit() external view returns (uint256)
```

Base units that are sent to the conversion function to get the asset rate.

### conversionSelector

```solidity
function conversionSelector() external view returns (bytes4)
```

Function selector of the wrapper contract where the asset rate is fetched from.

### decimals

```solidity
function decimals() external view returns (uint8)
```

Number of decimals that the answer of this price feed has.

### mainPriceFeed

```solidity
function mainPriceFeed() external view returns (contract IPriceFeed)
```

Main price feed where the price is fetched from.

### wrapper

```solidity
function wrapper() external view returns (address)
```

Address of the wrapper contract where the asset rate is fetched from.

## View Methods

### latestAnswer

```solidity
function latestAnswer() external view returns (int256)
```

Returns the price feed's latest value considering the wrapped asset's rate.

**Returns**

| Type   | Description         |
| ------ | ------------------- |
| int256 | latest asset price. |


---

# 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.exact.ly/guides/protocol/pricefeedwrapper.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.
